This API records a customer's cart promotion redemption during a transaction.
This API saves or applies a promotion that a customer used during a purchase. It records the details of the transaction, such as the customer information, the items bought, the discount received, and how the promotion was applied.
Note
For an overview on our APIs and for hands-on testing, refer to API overview and Make your first API call documentation.
Prerequisites
- Authentication - Basic or OAuth authentication
- Access group resource - Write access to customer group resource
- customerId and evaluationId
API Endpoint Example
https://eu.api.capillarytech.com/api_gateway/v1/promotions/redemptions
Request Body Parameters
Parameter | Data Type | Description |
---|---|---|
customerIdentifierValue | String | The value used to identify the customer, such as their mobile number.
|
customerIdentifierType | String | Specifies the type of identifier used for the customer.
|
customerId | String | Unique Identifier of the customer. |
transactionIdentifier* | String | Unique identifier for the transaction. |
transactionNumber* | String | Number assigned to transaction. It could be same as |
transactionDate* | Integer | Time of the transaction in milliseconds since epoch |
amount* | Integer | Total amount of the transaction before any discount |
lineItems | Object | Details of the items purchased in the transaction along with the promotions applied to them.
|
| String | Unique identifier for the product (Stock Keeping Unit) to which the promotion is applied |
| String | Unique Identifier of the promotion being redeemed or applied to the item. |
| String | Unique Identifier of the previously earned promotion being redeemed. |
| Integer | The number of times this promotion is being redeemed for the item. |
| Integer | The monetary value of the discount applied through the promotion |
| Integer | Number of item units on which the discount was actually applied. |
| Integer | Quantity of the item that was eligible for the promotion. |
redemptions | Object | The redemptions array contains details about the promotions that were redeemed in the transaction.
|
| String | The product SKU (Stock Keeping Unit) for which the promotion is being redeemed. |
| String | Unique identifier of the promotion that is being redeemed. |
| Integer | Number of times this promotion is being redeemed for the item. |
| Integer | Discount amount applied as part of the redemption |
| Integer | Quantity of the item on which the discount was actually applied. |
| Integer | Quantity of the item on which the discount was actually applied. |
Response Body Parameters
Parameter | Data Type | Description |
---|---|---|
orgId | Integer | Unique Identifier of your organization. |
customerIdentifierValue | String | Value used to identify the customer |
customerIdentifierType | String | Type of identifier provided |
customerId | Integer | Unique Identifier of the customer |
transactionIdentifier | String | Unique Identifier used to track transaction |
transactionNumber | String | Visible transaction number, may be same as or different from |
transactionDate | Integer | Timestamp of the transaction in milliseconds since epoch |
amount | Integer | Total transaction amount before applying discounts. |
redemptions | Object | The redemptions array contains details about the promotions that were redeemed in the transaction. |
- promotionId | String | Unique identifier of the promotion that is being redeemed. |
- redemptionCount | Integer | Number of times this promotion is being redeemed for the item. |
- discount | String | Discount amount applied as part of the redemption |
- discountAppliedOnQuantity | String | Quantity of the item on which the discount was actually applied. |
- promotionAppliedOnQuantity | String | Quantity of the item that was eligible for the promotion. |
lineItems | Object | Details of the items purchased in the transaction along with the promotions applied to them. |
- sku | String | Unique identifier for the product (Stock Keeping Unit) to which the promotion is applied |
- promotionId | String | Unique identifier of the promotion that is being redeemed. |
- earnedPromotionId | String | Unique Identifier of the previously earned promotion being redeemed. |
- redemptionCount | Integer | Number of times this promotion is being redeemed for the item. |
- discount | String | Discount amount applied as part of the redemption |
- discountAppliedOnQuantity | String | Quantity of the item on which the discount was actually applied. |
- promotionAppliedOnQuantity | String | Quantity of the item on which the discount was actually applied. |
API Specific Error Code
Error Code | Description | Reason |
---|---|---|
400 | Bad Request | At least lineItems or redemptions must be specified |
400 | Bad Request | CustomerIdentifierType and CustomerIdentifierValue is mandatory when customerId is not specified. |