Get Auth Code From Offer Code API
Customer will share the offer code (barcode or numeric code) with the 3P as discussed in the onboarding section. 3P clients will make a call to Prime’s get auth code from offer code API to retrieve the auth code. The Benefit ID to be passed as part of the request will be provided by Amazon Prime team during the onboarding process.
Get Auth Code API Request
GET https://prime-apis.amazon.com/v1/customer/benefit/{benefit-id}/offer-code/{offer-code}/auth-code
Request Parameters
| Parameter Name | Data type | Description |
|---|---|---|
| benefit-id | string | benefit-id that Prime provides during the time of client onboarding based on the deal construct. |
| offer-code | string | offer code shared by customer |
HTTP Headers
All conventional request headers for Prime APIs that need to be passed to Get Auth Code API, are highlighted in detail here.
Sample API Request
The following details give a view of how a sample request has to be passed to Prime's Get Auth Code API in the 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"
-X GET
'https://prime-apis.amazon.com/v1/customer/benefit/PRIME_3P_PARTNER_BENEFIT/offer-code/123456789/auth-code'
Get Auth Code API Response
1. Success
When a call to the get auth code API is successful, clients will get the following responses below:
HTTP status code : 200
{
message= "SUCCESS",
authCode="authCodeValue"
}
2. Failure
Response when there is error:
Http Status Code: <code>
Body:
{
"error":{
"code": "<code>",
"message": "<message>"
}
}
Error codes are highlighted in detail here.