Update Redemption Reservation
PUT/client/users/:correlation_id/reservations/:reservation_token
-
This API will update the existing reservation.
-
The number of points reserved in the update cannot be greater than the number in the original redemption reservation.
-
If the redeemer is not a member of a household: If the update decreases the reservation amount, then the difference in points is awarded back to the member's account. For instance, if the reserved amount for the original reservationToken was 25000 and the updated reservation is 20000, then 5000 points are added back into the member's available point balance.
-
If the redeemer is a member of a household: If the update decreases the reservation amount, then points are awarded back to each household member account in the same proportions by which they originally contributed points.
Redemptions cannot be reserved, updated or made using PHONE_NUMBER as the X-Identifier-Type on Start Session, so if it is used, an error message is returned.
Body
| Attribute | Description | Format | Notes |
|---|---|---|---|
| reservationAmount | Specifies the number of reward units to reserve for redemption | Number | |
| redemptionId | Optional Specifies against which redemption identifier we are reserving the points | String | |
| redeemerId | Optional It's mandatory if redemptionId is provided. Specifies the owner of the redemptionId and catalogueItems(if provided) | String | |
| catalogueItems | Optional If provided, redemptionId and redeemerId should be present. This represents the array of products/items which user wants to redeem. catalogueItems[].#productCode: Corresponds to product which user want to redeem. catalogueItems[].#quantity: Corresponds to quantity of the productCode. Needs to be positive value. | Product objects within the catalogueItems array | For example: "catalogueItems": [ { "productCode":"123xy" } { "productCode": "456za", "quantity":2 } ] productCode is a string and quantity a number. If quantity is not included, it is assumed to be 1 for that productCode. |
| extendedExpiry | Optional | Boolean | Extends the expiration duration of the existing reservation. |
| offline | Optional | Boolean | If the reservation token does not exist, an offline attribute is passed as true, then a new reservation gets created. |
| isExcludedFromCap | Whether the redemption is excluded from redemption caps (for example, the number of points that can be redeemed in a day). | Boolean: Enum: true or false |
Response
| Attribute | Description | Format | Notes |
|---|---|---|---|
| reservationToken | Token provided to confirm reservation status | String | Required for redemption requests |
| reservationDuration | How long the reservation will be in place | Number | |
| availablePointBalance | Total number of points available for reservation | Number | |
| pointBalance | Total balance of points for this account | Number | |
| sessionId | Unique identifier for this session | String | GUID format. Optional attribute |
| redemptionName | Optional Name of redemption identifier against which points are reserved. It is returned if it's item level redemption. | String | |
| catalogueItemsData | Optional Description of the items used for reservation of points. Returned only if request has item level redemption. productCode: Product code sent in the request. quantity: Quantity sent via request. catalogueItemId: ID of the catalogueItem mapped to the product code. catalogueItemName: Name of the catalogueItem mapped to the product code. pointsAmount: pointsAmount which the catalogueItem corresponds to. totalPointsAmount: pointsAmount * quantity messages : localized messages related to the catalogue item. | catalogueItemsData array containing product data objects | Example: { "catalogueItemId": "CATALOGUE_ITEM_ID_6199", "catalogueItemName": "Item Name 6199", "quantity": 5, "productCode": "89947774-01", "redemptionType": "TENDER", "pointsAmount": 500, "totalPointsAmount": 2500, "messages": { "en-CA": { "promptText": "Prompt for BUYCO 1", "receiptTextLong": "buyco 2", "receiptTextShort": "buyco2" } } } The pointsAmount is multiplied by the quantity to derive the totalPointsAmount. |
| household | Contains the household pointsBalance and availablePointsBalance. | Object | Returned when member belongs to household and member has REDEEM privilege |
| pointsBalance | Overall balance of points | Number | |
| availablePointsBalance | Points available for redemption | Number |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Account is not eligible for redemption. | INVALID_REQUEST | Error shown if account cannot redeem or if PHONE_NUMBER is used as x-identifier-type in headers of Start Session call (not allowed). |
| 400 Bad Request | Invalid tier amount. | INVALID_REQUEST | The tier amount referenced is not valid for that tier. |
| 400 Bad Request | Either reservationAmount or catalogueItems is required. | INVALID_REQUEST | If both, reservationAmount and catalogueItems are absent in request. Either of them should be present. |
| 400 Bad Request | redemptionId and redeemerId, both are required . | INVALID_REQUEST | If only one of redemptionId or redeemerId is provided. Both are allowed together or none of them should be present. |
| 400 Bad Request | "invalidCatalogueItems": [ { "productCode": "89947774-03", "quantity": -50 }, { "productCode": "Invalid Product code", "quantity": 50 } ] | INVALID_REQUEST | If productCode and quantity provided in catalogueItem is not valid. |
| 400 Bad Request | "Reservation Token is invalid.", | INVALID_REQUEST | Reservation token does not exist and offline attribute is false. |
| 400 Bad Request | Total points for catalogue items should be less than or equal to the reservation amount. | INVALID_REQUEST | |
| 400 Bad Request | New reservation amount cannot be greater than existing reservation amount. | INVALID_REQUEST | |
| 400 Bad Request | Invalid redemption identifier: INVALID_redemption_id. | INVALID_REQUEST | |
| 400 Bad Request | Invalid Redeemer | INVALID_REQUEST | |
| 400 Bad Request | Account is not eligible for redemption. | INVALID_REQUEST | Error shown if account cannot redeem or if PHONE_NUMBER is used as x-identifier-type in headers of Start Session call (not allowed). |
| 400 Bad Request | Reservation belongs to a different session. | INVALID_REQUEST | If reservation is made using one x-identifier-type, then session is started again with a different x-identifier-type, this error is shown. |
| 400 Bad Request | Invalid catalogue item(s). | INVALID_REQUEST | Specific errors in data for catalogue items are returned in the response. |
| 400 Bad Request | Channel should be a string value. | INVALID_REQUEST | When channel not a string we will get this error. |
Request
Responses
- 200
- 400
200 - Expiry Extended According to extendedExpirationDuration in Config
Response Headers
Mon, 15 May 2023 07:03:47 GMT190keep-alivebf99c8cf-a30b-4bdb-809d-6ee750c60d6dno-referrer1;mode=block*ES-POS-V1mck-969239ea-fc42-4960-85d4-aed9f563a31cmax-age=86400max-age=31536000; includeSubDomains; preloadvibrate 'none'; geolocation 'none'sameoriginconnect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.netMay 15th 2023, 7:03:47E87lDEFCIAMFfww=no-cache, no-store, must-revalidateCORRELATION_ID_NOT_PROVIDED_IN_REQUESTnosniffRoot=1-6461d953-59a55bc5634fdb09703daf59;Sampled=0;lineage=8112f1f4:0400 - Account Not Eligible for Redemption
Response Headers
56keep-aliveThu, 16 May 2019 18:48:21 GMT2cec073b-780b-11e9-9336-69e826a91205*ES-POS-V1f3f51430-3bf0-a495-e094-dde74276c96bMay 16th 2019, 6:48:20ZyiCNEH4IAMFqbw=no-cache, no-store, must-revalidateCORRELATION_ID_NOT_PROVIDED_IN_REQUESTRoot=1-5cddb074-74dcb7c2adea4ccaa9b532f2;Sampled=0Error from cloudfront1.1 6eee7a01b0a1ee8458835948593a0694.cloudfront.net (CloudFront)YTO50-C1zbNxeAh3SmT8ubcjEcvi52Z22-KWuL3QKq8nnqTY08jQhtZJp70R8A==