Use this API to validate the Customer’s userID against the Product to be distributed
Overview
The User Validation API allows the Partner to validate the userId of their customer against the requirements of the Product. Some products require an in app userID or identifier; others require just a valid email address. We call the first identifier the recipient identifier.
Pre Requisites
- An access token needs to be generated in order to use this API (see Authentication - Generate Access Token)
API Description
Headers
| Header | Description/Value |
|---|---|
| AccessToken | This is the Access Token field returned from the Authentication - Generate Access Token response. This should be in the format Bearer <AccessToken> |
| Content-Type | application/vnd.carry1st.order.distributor+json |
URL Format
To retrieve a list of available payment methods, make a GET request to the following endpoint:
- GET /api/orders/distributors/user-validation?recipientIdentifier=?&productBundleSku=?&externalReference=?&countryCode=?¤cyCode=?&amount=?&quantity=?
List of URL Query Parameters
| Parameter | Format | Mandatory | Description |
|---|---|---|---|
| recipientIdentifier | String | Y | The userId of the customer that exists on the platform of the Product |
| productBundleSku | String | Y | This is the SKU value that is obtained from the List Product Catalog API |
| externalReference | String | Y | An externalReference to provide to the Product |
| countryCode | String | Y | The country code. It should match the Product Bundle output in List Catalog API |
| currencyCode | String | Y | The currency code. It should match the Product Bundle output in List Catalog API |
| amount | Number | Y | The amount. It should match the Product Bundle output in List Catalog API |
| quantity | Number | Y | The quantity. This should always be 1 |
Response
The API will respond with a JSON object.
{
"recipientIdentifier": "GEDKZW",
"productBundleSku": "codm30cp",
"externalReference": "test",
"customerInfo": {
"openId": "14318806390642915925",
"nickName": "Char",
"picUrl": "https://graph.facebook.com/v19.0/115897970854428/picture?width",
"country": "Qatar"
},
"quantity": 1,
"amount": 10,
"currencyCode": "USD",
"countryCode": "QA"
}Fields
| Name | Type | Description |
|---|---|---|
| recipientIdentifier | String | The userId of the customer that exists on the platform of the Product |
| productBundleSku | String | This is the SKU value that is obtained from the List Product Catalog API |
| externalReference | String | An externalReference to provide to the Product |
| countryCode | String | The country code. It should match the Product Bundle output in List Catalog API |
| currencyCode | String | The currency code. It should match the Product Bundle output in List Catalog API |
| amount | Number | The amount. It should match the Product Bundle output in List Catalog API |
| customerInfo | Json <Key, Value Pairs> | An object that returns more detailed information about the recipientIdentifier. This is not guaranteed to be returned in all Products |
HTTP Response Codes
The User Validation API may return the following HTTP Response Codes:
| HTTP Status Code | Name | Description |
|---|---|---|
| 200 | Success | This indicates that the request has been successful |
| 400 | Bad Request | The recipientId could be invalid or missing from the request |
| 401 | Unauthorized | The Access Token might be missing or invalid (see Authentication - Generate Access Token) |
| 403 | Forbidden | The credentials provided might not have access to the resources required |
| 404 | Not Found | The productBundleSku is incorrectly referenced |
Error Handling
See Handling Error Codes for more details on handling error responses.
