post https://{host}/api_gateway/v1/promotions/redemptions#
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. Note: This field is required if customerId is not provided. It works together with customerIdentifierType to locate the customer. |
customerIdentifierType | String | Specifies the type of identifier used for the customer. Note: This field is required if customerId is not provided. It must match the type of value provided in customerIdentifierValue . |
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 transactionIdentifier . |
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. Note: At least one of lineItems or redemptions must be specified in the request. |
- sku | String | Unique identifier for the product (Stock Keeping Unit) to which the promotion is applied |
- promotionId | String | Unique Identifier of the promotion being redeemed or applied to the item. |
- earnedPromotionId | String | Unique Identifier of the previously earned promotion being redeemed. |
- redemptionCount | Integer | The number of times this promotion is being redeemed for the item. |
- discount | Integer | The monetary value of the discount applied through the promotion |
- discountAppliedOnQuantity | Integer | Number of item units on which the discount was actually applied. |
- promotionAppliedOnQuantity | 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. Note: Either lineItems or redemptions must be provided. Both are optional individually, but one is required. |
- sku | String | The product SKU (Stock Keeping Unit) for which the promotion is being redeemed. |
- 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 | Integer | Discount amount applied as part of the redemption |
- discountAppliedOnQuantity | Integer | Quantity of the item on which the discount was actually applied. |
- promotionAppliedOnQuantity | 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. |