Redeem Cart Promotion

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

ParameterData TypeDescription
customerIdentifierValueStringThe 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.
customerIdentifierTypeStringSpecifies 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.
customerIdStringUnique Identifier of the customer.
transactionIdentifier*StringUnique identifier for the transaction.
transactionNumber*StringNumber assigned to transaction. It could be same as transactionIdentifier.
transactionDate*IntegerTime of the transaction in milliseconds since epoch
amount*IntegerTotal amount of the transaction before any discount
lineItemsObjectDetails of the items purchased in the transaction along with the promotions applied to them.
Note: At least one of lineItemsor redemptions must be specified in the request.
- skuStringUnique identifier for the product (Stock Keeping Unit) to which the promotion is applied
- promotionIdStringUnique Identifier of the promotion being redeemed or applied to the item.
- earnedPromotionIdStringUnique Identifier of the previously earned promotion being redeemed.
- redemptionCountIntegerThe number of times this promotion is being redeemed for the item.
- discountIntegerThe monetary value of the discount applied through the promotion
- discountAppliedOnQuantityIntegerNumber of item units on which the discount was actually applied.
- promotionAppliedOnQuantityIntegerQuantity of the item that was eligible for the promotion.
redemptionsObjectThe 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.
- skuStringThe product SKU (Stock Keeping Unit) for which the promotion is being redeemed.
- promotionIdStringUnique identifier of the promotion that is being redeemed.
- redemptionCountIntegerNumber of times this promotion is being redeemed for the item.
- discountIntegerDiscount amount applied as part of the redemption
- discountAppliedOnQuantityIntegerQuantity of the item on which the discount was actually applied.
- promotionAppliedOnQuantityIntegerQuantity of the item on which the discount was actually applied.

Response Body Parameters

ParameterData TypeDescription
orgIdIntegerUnique Identifier of your organization.
customerIdentifierValueStringValue used to identify the customer
customerIdentifierTypeStringType of identifier provided
customerIdIntegerUnique Identifier of the customer
transactionIdentifierStringUnique Identifier used to track transaction
transactionNumberStringVisible transaction number, may be same as or different from
transactionDateIntegerTimestamp of the transaction in milliseconds since epoch
amountIntegerTotal transaction amount before applying discounts.
redemptionsObjectThe redemptions array contains details about the promotions that were redeemed in the transaction.
- promotionIdStringUnique identifier of the promotion that is being redeemed.
- redemptionCountIntegerNumber of times this promotion is being redeemed for the item.
- discountStringDiscount amount applied as part of the redemption
- discountAppliedOnQuantityStringQuantity of the item on which the discount was actually applied.
- promotionAppliedOnQuantityStringQuantity of the item that was eligible for the promotion.
lineItemsObjectDetails of the items purchased in the transaction along with the promotions applied to them.
- skuStringUnique identifier for the product (Stock Keeping Unit) to which the promotion is applied
- promotionIdStringUnique identifier of the promotion that is being redeemed.
- earnedPromotionIdStringUnique Identifier of the previously earned promotion being redeemed.
- redemptionCountIntegerNumber of times this promotion is being redeemed for the item.
- discountStringDiscount amount applied as part of the redemption
- discountAppliedOnQuantityStringQuantity of the item on which the discount was actually applied.
- promotionAppliedOnQuantityStringQuantity of the item on which the discount was actually applied.

API Specific Error Code

Error CodeDescriptionReason
400Bad RequestAt least lineItems or redemptions must be specified
400Bad RequestCustomerIdentifierType and CustomerIdentifierValue is mandatory when customerId is not specified.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!