Redeem Cart Promotion

This API defines the endpoint for saving or applying a promotion that a customer used during a purchase. It specifies the method to record the details of the transaction, such as the customer information, the items bought, the discount received, and how the promotion was applied.

Example request

curl --location 'https://eu.api.capillarytech.com/api_gateway/v1/promotions/redemptions' \
--header 'Content-Type: application/json' \
--header 'X-CAP-API-AUTH-ORG-ID: 4000004' \
--header 'Authorization: Basic bmFtYW5fZG9jgyMzA3MWJmYjM5OGM5ZmM2YjZlY2I2MmEy' \
--header 'Cookie: _cfuvid=uvNcgoyanbmZMCVkA64njE4pSA_tJw1wkWo-1762160764633-0.0.1.1-604800000' \
--data '{
  "customerIdentifierValue" : "1234512345", 
  "customerIdentifierType" : "mobile",
  "customerId" : "566881933",
  "transactionIdentifier" : "txn-50",
  "transactionNumber" : "txn-50",
   "transactionDate":1743521508000, 
   "amount":1000,
   "lineItems" : [
    {
        "sku":"Sku#Fuel", 
        "promotionId":"67e3c1073919452f135e2da0",  
        "earnedPromotionId":"67e63559e1c34e7d8e9348aa", 
        "redemptionCount":1,
        "discount":500,
        "discountAppliedOnQuantity":1,
        "promotionAppliedOnQuantity":1
     }
   ],
   "redemptions" : [
      {
        "sku":"Sku#Fuel", 
        "promotionId":"67e3c1073919452f135e2da0",  
        "redemptionCount":1,
        "discount":500,
        "discountAppliedOnQuantity":1,
        "promotionAppliedOnQuantity":1
     }
   ]
}'

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Access group resource: Write access to customer group resource

Rate limit

  • Demo and Testing Clusters: 1,000 requests per minute per API key
  • Other Organizations: The rate limit is brand-specific.

Body parameters

FieldTypeRequiredDescription
customerIdentifierValueStringConditionalSpecifies the value used to identify the customer, such as their mobile number. Indicates this is required if customerId is not provided.
customerIdentifierTypeStringConditionalSpecifies the type of identifier used. Indicates this is required if customerId is not provided.
customerIdStringConditionalSpecifies the Unique Identifier of the customer. Indicates one of customerId or the identifier pair is required.
transactionIdentifierStringYesSpecifies the unique internal ID for the transaction. Indicates a max of 250 characters.
transactionNumberStringYesSpecifies the customer-facing bill or receipt number. Indicates a max of 250 characters.
transactionDateIntegerYesSpecifies the time of the transaction in milliseconds since epoch.
amountIntegerYesSpecifies the total amount of the transaction before any discount.
lineItemsArrayConditionalDefines the details of the items purchased. Indicates at least one of lineItems or redemptions must be specified.
.skuStringOptionalSpecifies the unique identifier for the product (SKU) to which the promotion is applied.
.promotionIdStringYesSpecifies the Unique Identifier of the promotion being redeemed or applied to the item.
.earnedPromotionIdStringOptionalSpecifies the Unique Identifier of the previously earned promotion being redeemed.
.redemptionCountIntegerYesSpecifies the number of times this promotion is being redeemed for the item.
.discountIntegerYesSpecifies the monetary value of the discount applied.
.discountAppliedOnQuantityIntegerYesSpecifies the number of item units on which the discount was actually applied.
.promotionAppliedOnQuantityIntegerYesSpecifies the quantity of the item that was eligible for the promotion.
redemptionsArray[Object]ConditionalDefines the details about the promotions redeemed. Indicates at least one of lineItems or redemptions must be specified.
.skuStringOptionalSpecifies the product SKU for which the promotion is being redeemed.
.promotionIdStringYesSpecifies the unique identifier of the promotion that is being redeemed.
.redemptionCountIntegerYesSpecifies the number of times this promotion is being redeemed for the item.
.discountIntegerYesSpecifies the discount amount applied as part of the redemption.
.discountAppliedOnQuantityIntegerYesSpecifies the quantity of the item on which the discount was actually applied.
.promotionAppliedOnQuantityIntegerYesSpecifies the quantity of the item on which the discount was actually applied.

Example request

{
    "data": {
        "orgId": 100737,
        "customerIdentifierValue": "1234512345",
        "customerIdentifierType": "mobile",
        "customerId": 566881933,
        "transactionIdentifier": "txn-50",
        "transactionNumber": "txn-50",
        "transactionDate": 1743521508000,
        "transactionDateISO": "2025-04-01T15:31:48Z",
        "amount": 1000.0,
        "redemptions": [
            {
                "promotionId": "67e3c1073919452f135e2da0",
                "redemptionCount": 1,
                "discount": "500.000000",
                "discountAppliedOnQuantity": "1.000000",
                "promotionAppliedOnQuantity": "1.000000"
            }
        ],
        "lineItems": [
            {
                "sku": "Sku#Fuel",
                "promotionId": "67e3c1073919452f135e2da0",
                "earnedPromotionId": "67e63559e1c34e7d8e9348aa",
                "redemptionCount": 1,
                "discount": "500.000000",
                "discountAppliedOnQuantity": "1.000000",
                "promotionAppliedOnQuantity": "1.000000"
            }
        ]
    }
}

Response parameters

FieldTypeDescription
dataObjectDefines the object that contains the details of the processed redemption.
.orgIdIntegerSpecifies the Unique Identifier of your organization.
.customerIdentifierValueStringSpecifies the value used to identify the customer.
.customerIdentifierTypeStringSpecifies the type of identifier provided.
.customerIdIntegerSpecifies the Unique Identifier of the customer.
.transactionIdentifierStringSpecifies the Unique Identifier used to track transaction.
.transactionNumberStringSpecifies the visible transaction number.
.transactionDateIntegerIndicates the timestamp of the transaction in milliseconds since epoch.
.amountIntegerSpecifies the total transaction amount before applying discounts.
.redemptionsArrayDefines the redemptions array that contains details about the promotions that were redeemed.
..promotionIdStringSpecifies the unique identifier of the promotion that is being redeemed.
..redemptionCountIntegerIndicates the number of times this promotion is being redeemed for the item.
..discountStringSpecifies the discount amount applied as part of the redemption.
..discountAppliedOnQuantityStringIndicates the quantity of the item on which the discount was actually applied.
..promotionAppliedOnQuantityStringIndicates the quantity of the item that was eligible for the promotion.
.lineItemsArrayDefines the details of the items purchased in the transaction.
..skuStringSpecifies the unique identifier for the product (SKU).
..promotionIdStringSpecifies the unique identifier of the promotion that is being redeemed.
..earnedPromotionIdStringSpecifies the Unique Identifier of the previously earned promotion being redeemed.
..redemptionCountIntegerIndicates the number of times this promotion is being redeemed for the item.
..discountStringSpecifies the discount amount applied as part of the redemption.
..discountAppliedOnQuantityStringIndicates the quantity of the item on which the discount was actually applied.
..promotionAppliedOnQuantityStringIndicates the quantity of the item on which the discount was actually applied.

Error codes

Error CodeDescriptionReason
400Bad RequestIndicates at least lineItems or redemptions must be specified
400Bad RequestIndicates CustomerIdentifierType 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!