Validate a customer
| POST | /customers/validate |
|---|
Utilize this endpoint to verify whether a customer is registered and recognized as valid within our system.
Header
Authorization
Example: Bearer {YOUR_AUTH_KEY}
Content-Type
Example: application/json
Accept
Example: application/json
Request Parameters
| Parameter | Datatype | Description |
|---|---|---|
| string | The customer's email address. | |
| customer_code | string | The customer's unique code. |
| contact_person_phone | string | The customer's phone number. |
| company_phone | string | The company's phone number. |
Note : To validate a customer, you may utilize any one of the parameters mentioned above at a time.
Response Parameters
| Parameter | Datatype | Description |
|---|---|---|
| message | string | This message show you a customer current status/exesitance. |
Sample Request
curl --location --request POST 'https://webservices.sourcehub.in/api/customers/validate?customer_code=1639328586' \
--header 'Authorization: Bearer **********'
Sample Success Response
{
"message": "The customer is a valid customer."
}
Sample 401 Faliure Response
{
"error": {
"code": "AUTHENTICATION_ERROR",
"description": "Invalid credential or token.",
"source": "https://webservices.sourcehub.in/api/customer/validate",
"status_code": 401
}
}
Sample 404 Faliure Response
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The value of the parameter provided does not exist.",
"source": "https://webservices.sourcehub.in/api/customer/validate",
"status_code": 404
}
}
Errors
1. The API key/secret provided is invalid. Error Status: 401
The API credentials used in your request do not match those generated on the Dashboard. This discrepancy may be due to one of the following reasons:
- Different Keys: Ensure you are using the correct keys for either test mode or live mode.
- Expired Key: The API key may have expired.
Solution :
To resolve this issue, please verify that your API keys are active and entered correctly. Ensure there are no leading or trailing whitespaces around the keys. This version is clearer and more structured, making it easier for users to understand the problem and solution.
2. The parameter provided does not exist. Error Status: 404
The provided email, customer code, contact person phone number, or company phone number does not exist or is not associated with the requestor.
Solution : Please verify and use a valid email, customer code, contact person phone number, or company phone number that is linked to the requestor. This version maintains clarity while enhancing professionalism and readability.
3. email/customer_code/contact_person_phone/company_phone is not valid. Error Status: 404
The email/customer_code/contact_person_phone/company_phone passed is invalid.
Solution : Use valid email/customer_code/contact_person_phone/company_phone.
4. Too many parameters. Error Status: 404
It seems that multiple parameters have been submitted for a single request.
Solution : Please ensure that only one parameter is included with a value for each request. This version clarifies the issue and presents the solution in a more structured manner.