Redeem Cart Promotion

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

This API defines the endpoint for saving or applying a cart 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 cart 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

Body parameters

FieldTypeRequiredDescription
customerIdentifierValueStringConditionalSpecifies the value used to identify the customer, such as their mobile number. Required if customerId is not provided.
customerIdentifierTypeStringConditionalSpecifies the type of identifier used. Required if customerId is not provided.
customerIdStringConditionalSpecifies the Unique Identifier of the customer.
Note : One of customerId or the identifier pair is required.
transactionIdentifierStringYesSpecifies the unique ID for the transaction. Supports a max of 250 characters.
transactionNumberStringYesSpecifies the customer-facing bill or receipt number. Supports a max of 250 characters.
transactionDateIntegerYesSpecifies the time of the transaction in UTC.
Time format : milliseconds since epoch.
transactionDateISOStringConditional

Specifies the time of the transaction in ISO 8601 format, returned in the server time zone.

EU server example 2025-04-01T15:31:48Z → 01 April 2025, 15:31:48 (UTC)

India server example 2025-04-01T21:01:48+05:30 → 01 April 2025, 21:01:48 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

amountIntegerYesSpecifies the total amount of the transaction before any discount.
lineItemsArrayConditionalDefines the details of the items purchased. At least one of lineItems or redemptions must be specified.
.skuStringOptionalSpecifies the unique identifier for the product (SKU) to which the cart promotion is applied.
.promotionIdStringYesSpecifies the Unique Identifier of the cart promotion being redeemed or applied to the item.
.earnedPromotionIdStringOptionalSpecifies the Unique Identifier of the previously earned cart promotion being redeemed.
.redemptionCountIntegerYesSpecifies the number of times this cart 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 cart promotion.
redemptionsArrayConditionalDetails about the cart promotions redeemed. You must specify at least one of the lineItems or redemptions.
.skuStringOptionalSpecifies the product SKU for which the cart promotion is being redeemed.
.promotionIdStringYesSpecifies the unique identifier of the cart promotion that is being redeemed.
.redemptionCountIntegerYesSpecifies the number of times this cart promotion needs to be redeemed for the item.
.discountIntegerYesSpecifies the discount amount applied as part of the redemption.
.discountAppliedOnQuantityIntegerYesSpecifies the quantity of the item on which the discount is applied.
.promotionAppliedOnQuantityIntegerYesSpecifies the quantity of the item on which the discount was is applied.

Example response

{
    "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 cart promotions that were redeemed.
..promotionIdStringSpecifies the unique identifier of the cart promotion that is being redeemed.
..redemptionCountIntegerIndicates the number of times this cart 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 cart 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 cart promotion that is being redeemed.
..earnedPromotionIdStringSpecifies the Unique Identifier of the previously earned cart promotion being redeemed.
..redemptionCountIntegerIndicates the number of times this cart 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

CodeDescription
400Invalid request. Check required parameters. Ensure all required parameters are provided and valid.
404Passed promotion, redemption, or evaluation ID not found. Use a valid and existing promotion, redemption, or evaluation ID.
405Org not enabled for redemption without cart evaluation. Enable this feature for your org or perform cart evaluation.
406Web engage account Id is not valid for this org. Verify and update your web engage account ID for this org.
500Internal server error. Retry the request after a short delay, and contact support if the error persists.
521Could not acquire the lock on the resource. Retry after some time or resolve resource contention.

Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json