Response to Offer
PUT/client/users/:correlation_id/offer/:offer_id
Accepts or declines a given offer on behalf of a loyalty member; valid acceptance states are "ACCEPTED", "DECLINED", and "UNACCEPTED".
Request
Body
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| acceptanceState | Whether or not the offer has been accepted | Enum: "ACCEPTED", "NONE", or "COMPLETED" |
Response
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| accountID | The ID of the account associated with the offer | String | |
| offerCode | Primary key that identifies the offer | String | Unique string value |
| acceptanceDate | ISO-compliant date and time stamp when the offer was accepted | String | |
| acceptanceDateEpoch | Epoch date and time stamp of when the offer was accepted | Number | Epoch date and time are in milliseconds |
| acceptanceState | Whether or not the offer has been accepted | Enum: "ACCEPTED", "NONE", or "COMPLETED" | |
| effectiveDate | Start date/time which the offer becomes live | String | Valid ISO date or date-time string |
| expiryDate | Date/time which the offer expires | String | Valid ISO date or date-time string. If empty, the offer does not expire. |
| effectiveDateEpoch | Epoch date and time stamp of when the offer started | Number | Epoch date and time are in milliseconds |
| expiryDateEpoch | Epoch date and time stamp of when the offer expired | Number | Epoch date and time are in milliseconds |
| version | Version of the offer | Number | Incremented every time the offer is updated |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Acceptance state is invalid | INVALID_REQUEST | acceptanceState value must be 'ACCEPTED' or 'DECLINED' |
| 400 Bad Request | Cannot change state of declined offer | INVALID_REQUEST | If a user has already decline an offer, the state cannot be changed |
| 400 Bad Request | Cannot change state of a completed offer | INVALID_REQUEST | If a user has already accepted an offer, the state cannot be changed |
| 400 Bad Request | Cannot accept {promoStatus} offer | INVALID_REQUEST | Provided offer has status different from 'ACTIVE' |
| 400 Bad Request | Current date is after expiry date | INVALID_REQUEST | Provided offer is expired |
| 400 Bad Request | Current date is prior to display date | INVALID_REQUEST | Provided offer is not yet displayed |
| 404 Not Found | Targeted offer does not exist | PROMO_NOT_FOUND | The account was not targeted by the provider offerId |
Request
Responses
- 200
- 400
- 404
200 - Respond to Offer
Response Headers
Date
Example:
Thu, 21 May 2020 03:55:47 GMTContent-Length
Example:
358Connection
Example:
keep-alivex-amzn-RequestId
Example:
e1b92cf0-e566-45ee-ab9b-b5c6929986dbReferrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*MCK-APPID
Example:
ES-CB-V1MCK-MSGID
Example:
mck-560020bd-786a-4cb8-aa4f-f81a8962ef17Expect-CT
Example:
max-age=86400Strict-Transport-Security
Example:
max-age=31536000Feature-Policy
Example:
vibrate 'none'; geolocation 'none'X-Frame-Options
Example:
sameoriginContent-Security-Policy
Example:
connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.netMCK-MSGTIMESTAMP
Example:
May 21st 2020, 3:55:46x-amz-apigw-id
Example:
M3RGdH4EIAMFcwQ=cache-control
Example:
no-cache, no-store, must-revalidateMCK_CORRELATIONID
Example:
mck-cd4e126a-f0fa-c00e-f1e3-fc2d319203c7X-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-5ec5fbc2-ce1e1bd62d011c221b8ec3b1;Sampled=0400 - Acceptance State is Invalid
404 - Targeted Offer Does Not Exist
Response Headers
Date
Example:
Thu, 21 May 2020 03:55:47 GMTContent-Length
Example:
358Connection
Example:
keep-alivex-amzn-RequestId
Example:
e1b92cf0-e566-45ee-ab9b-b5c6929986dbReferrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*MCK-APPID
Example:
ES-CB-V1MCK-MSGID
Example:
mck-560020bd-786a-4cb8-aa4f-f81a8962ef17Expect-CT
Example:
max-age=86400Strict-Transport-Security
Example:
max-age=31536000Feature-Policy
Example:
vibrate 'none'; geolocation 'none'X-Frame-Options
Example:
sameoriginContent-Security-Policy
Example:
connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.netMCK-MSGTIMESTAMP
Example:
May 21st 2020, 3:55:46x-amz-apigw-id
Example:
M3RGdH4EIAMFcwQ=cache-control
Example:
no-cache, no-store, must-revalidateMCK_CORRELATIONID
Example:
mck-cd4e126a-f0fa-c00e-f1e3-fc2d319203c7X-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-5ec5fbc2-ce1e1bd62d011c221b8ec3b1;Sampled=0