Customer Identity API
Clients will make a call to Prime’s customer identity API to store the identity information and mark the customer as pre-verified against the given segment to skip verification challenge during signup.
Overall Flow
Starting at the client page with Amazon offer banner/CTA
Once the customer clicks the CTA, client will log in the customer into Amazon using LWA - https://developer.amazon.com/apps-and-games/login-with-amazon
- Client will fetch and store the ‘LWAAccessToken’ for the customer using LWA APIs.
Client will then call Prime Customer Identity API using the LWA AccessToken to mark the Amazon customer as pre-verified. Detailed API specs are given below.
After successfully sending the pre-verified customer details by calling Prime Customer Identity API, client will redirect the customer to an Amazon URL. This will direct the customer to the appropriate sign up flow. The signup experience will skip the verification challenge at Amazon end and allow the customer to directly signup for Prime.
Redirect Endpoint: https://www.amazon.com/prime/offer/redirect-handler?offerType=<offerType>&clientName=<clientName>
offerType defines type of the offer, for example, student-discount.
clientName is name of the client.
- Client can call Prime Benefits Discovery API to check the latest Prime status of the customer and accordingly disable Prime Upsell on the client pages.
Customer Identity API Request
POST https://prime-apis.amazon.com/v2/customer/identity?
customerIdentifierType={customerIdentifierType}&customerIdentifier={customerIdentifierValue}
Request Parameters
| Parameter Name | Data type | Description |
|---|---|---|
| customerIdentifierType | Enum value (LWAAccessToken) | This parameter is used to indicate the type of customer identifier being passed in the request. The value used for this will always be 'LWAAccessToken'. |
| customerIdentifier | opaque value (String type) | This parameter will be an unique Id passed by the client which identifies an Amazon customer. Value passed here is the LWAAccessToken stored after using LWA APIs. |
Request Payload
Content-Type: application/json
{
identityData: [
{
"type": <identityType>
}
]
}
| Parameter Name | Data type | Description |
|---|---|---|
| type | String value (identityType) | This value indicates the identity type against which the identity is being stored (Segment for which the verification is taking place). |
For example, ‘C97110025’ is the identityType value to be used for pre-verified Students. Prime team will convey if there is a change in this value.
HTTP Headers
Along with the conventional request headers, one additional http header need to be passed for customer identity API.
| Header Name | Value |
|---|---|
| Content-Type | application/json |
Sample API Request
The following details give a view of how a sample request has to be passed to Prime Customer Identity API for US marketplace.
curl -i
-H "Authorization: AWS4-HMAC-SHA256 Credential=A*************F/20210504/us-east-1/execute-
api/aws4_request, SignedHeaders=x-amz-marketplace;host;x-amz-date,
Signature=9160882a20351d49ae497e7a37367c6165c62ec5060f7361050f43ec064410bc"
-H "x-amz-date: 20210504T201012Z"
-H "x-amz-marketplace: US"
-H "x-amz-request-id: 1234"
-H "Host: prime-apis.amazon.com"
-H "Content-Type: application/json"
-d '{"identityData": [{"type": "C97110025"}]}'
-X POST
'https://prime-apis.amazon.com/v2/customer/identity
?customerIdentifierType=LWAAccessToken
&customerIdentifier=Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR'
Customer Identity API Response
1. Success
When a call to the API is successful, clients can expect below response:
HTTP status code : 200
Content-Type: application/json
Body: {}
2. Failure
Response when there is error:
Http Status Code: <code>
Content-Type: application/json
Body:
{
"error":{
"code": "<code>",
"message": "<message>"
}
}
Error codes are highlighted in detail here.
API Explorer
Explore Customer Identity API with Swagger to send test requests and see the response.