Award Post Purchase Points
POST/client/users/:OriginalCorrelation_id/award
Use to award reward points after a purchase for any one of a number of reasons (for instance, points were not properly awarded during the original transaction). Also:
- Account and LoyaltyId must be eligible to earn.
- Awards post-purchase credits based on a historical Correlation Id (within 30 days).
- The latest transaction in the original transaction chain must be anonymous. The correlationId for the anonymous transaction is passed in the request path.
- Invalid requests are rejected.
- When a valid request is processed, the member's balance is increased, the Last Activity Date (LAD) is updated (if earn is set as a tracking activity), and if the member is a household member, the household balance is returned.
Validations:
- Account must be eligible to earn.
- PPE must be performed within specified (X) days from transactionDate of the original transaction.
- The latest transaction in the original transaction chain must be anonymous.
Request
Note that sending the call without the proper "currentCorrelationId" will result in a 400 error.
Body
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| currentCorrelationId | Correlates the session with the external system that is making the call. | Number | Recommend using GUID mapped to the value of your Session ID or something directly referenced in your system as long as it is always globally unique. The Correlation ID also becomes the Transaction ID used to log any session transactions. |
| externalTransactionID | Unique identifier for transaction used by the client. | String | Optional. |
Response
| Attributes | Definitions | Format | Notes |
|---|---|---|---|
| loyaltyId | Loyalty Card number for this session. | Number | Optional. If loyaltyId was not provided in the request, then this is the primary card number on the account. |
| originalTransactionId | Unique identifier for the original transaction. | String | |
| pointsEarned | The number of points earned through this transaction. | Number | |
| pointsBalance | Total number of points currently attributed to this account. | Number | |
| transactionId | Unique identifier for the new transaction to add pointsEarned. | String | |
| household | Object containing information about the household to which the member belongs. | Object | Only returned if the member is a member of a household. |
| id | Unique identifier for the household. | String | |
| role | The member's role in the household. | Enum: "PRIMARY" or "SECONDARY" | |
| balance | Object containing data about the balances available to the household. | Object | |
| totalPointsBalance | The total points balance of the household. | Number | The sum of all member balances. |
| totalDollarBalance | The total dollar balance of the household. | Number | The sum of all member balances. |
| totalAvailablePointBalance | The total points available to the household. | Number | |
| totalAvailableDollarBalance | The total dollars available to the household. | Number | |
| totalRedeemablePointBalance | The total number of points that can currently be redeemed by the household members. | Number | |
| totalRedeemableDollarBalance | The total number of dollars that can currently be redeemed by the household members. | Number | |
| minRedeemPoints | The minimum number of points that can be redeemed by the household. | Number | |
| maxRedeemPoints | The maximum number of points that can be redeemed by the household. | Number | |
| minRedeemDollars | The minimum number of dollars that can be redeemed by the household. | Number | |
| maxRedeemDollars | The maximum number of dollars that can be redeemed by the household. | Number |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Must provide a session correlation ID | INVALID_REQUEST | Must provide a valid session correlation ID for this request |
| 400 Bad Request | Original session does not exist | INVALID_REQUEST | Cannot find session to which to award post-purchase points |
| 400 Bad Request | Account is not eligible to earn | INVALID_REQUEST | For example, when loyalty status is ‘CANCELLED’, or account status is different from ‘ACTIVE’ and ‘UNREGISTERED’ |
| 400 Bad Request | Account is not anonymous or a post purchase award has already been completed | PPE_ACCOUNT_NONANON_ALREADY_COMPLETED | When original transaction was not anonymous or it was already completed |
| 400 Bad Request | Original transaction is older than {maxDays} days | INVALID_REQUEST | When the maximum days for the post-purchase award are exceeded. See maxDays in configuration ConfigType = ‘PPE’, attribute ‘ppeMaxOTAge’ |
Request
Responses
- 200
- 400
200 - PPE Awarded
Response Headers
Date
Example:
Thu, 21 May 2020 03:48:56 GMTContent-Length
Example:
196Connection
Example:
keep-alivex-amzn-RequestId
Example:
dd9522d9-c186-467b-9c52-45a9c083aaf1Referrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*Expect-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.netx-amz-apigw-id
Example:
M3QGOGoMoAMFqJg=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-5ec5fa27-3932c218b29d5ad48c0f7a28;Sampled=0400 - Invalid Current Session ID
Response Headers
Date
Example:
Thu, 21 May 2020 03:48:56 GMTContent-Length
Example:
196Connection
Example:
keep-alivex-amzn-RequestId
Example:
dd9522d9-c186-467b-9c52-45a9c083aaf1Referrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*Expect-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.netx-amz-apigw-id
Example:
M3QGOGoMoAMFqJg=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-5ec5fa27-3932c218b29d5ad48c0f7a28;Sampled=0