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

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 lineItemsor 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

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!