Earn Cart Promotions in Bulk

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

This API grants multiple cart promotions to a customer in a single request.

  • When you call this API, the system immediately adds all specified promotions to the customer's wallet, making them available for redemption.
  • Use this API when you need to award several promotions to a customer at once, such as during a batch processing operation or as part of a loyalty program milestone.
  • You can specify different earn counts for each promotion in the earnedPromotions array to control how many times each promotion is granted.
  • To earn a single promotion for a customer, use the Earn Cart Promotion API instead.

Example request

curl --location 'https://eu.api.capillarytech.com/api_gateway/v1/promotions/earn/bulk' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'Authorization: Basic Z2Vvcmd2RlbW81OTNhMjI2MTk1OGE2NWI5ZjAxMzU5NGIwNDllZTk=' \
--header 'Cookie: _cfuvid=GAReJgp167bbzDQ8s5vEdbLfhfncjBmtRbikkGl8-1762840589756-0.0.1.1-604800000' \
--data '{
  "orgId": 100737,
  "customerId": 566881933,
  "eventTime": 1761750000000,
  "earnedFromType": "BULK_ISSUE",
  "eventDetails": {
    "id": "6911e951f57b486147effa6c",
    "type": "BULK_ISSUE"
  },
  "earnedPromotions": [
    {
      "promotionId":"6912ced9d39e256f754a83f8",
      "earnCount": 1,
      "earnedFromId": "68fb1c9731d91c625a8d9e80"
    },
    {
      "promotionId":"6912cfff6629ee07040e15ef",
      "earnCount": 1,
      "earnedFromId": "68fb1c9731d91c625a8d9e80"
    }
  ]
  
}
'

Prerequisites

  • Authentication: Basic or OAuth authentication.
  • Default access group

Body parameters

FieldTypeRequiredDescription
orgIdIntegerOptionalSpecifies the organization ID.
customerIdLongYesSpecifies the unique identifier of the customer earning the cart promotions.
eventTimeLongConditionalSpecifies the timestamp when the bulk earning event occurred in UTC.
  • The promotion uses this timestamp to determine whether the earnings are valid.

  • A past timestamp can be provided if the earning is being recorded after the event occurred, as long as it falls within the promotion's active earning period.

Time format : epoch timestamp in milliseconds
Note: This field will be deprecated in the future and is being replaced by eventTimeISO.
eventTimeISOStringConditionalDefines the timestamp when the bulk earning event occurred in ISO 8601 format, including the region offset.
  • The promotion uses this timestamp to determine whether the earnings are valid.

  • A past timestamp can be provided if the earning is being recorded after the event occurred, as long as it falls within the promotion's active earning period.

For example, the bulk earning event occurred at 14:30:45 on December 16, 2025, in India.
Format for the request parameter: 2025-12-16T14:30:45+05:30.
earnedFromTypeEnumYesSpecifies how the cart promotion was earned.
Supported values:
BULK_ISSUE: Cart promotion granted via a bulk operation.
ACTIVITY: Triggered by a specific customer event.
MILESTONE: Triggered by achieving a predefined milestone.
REWARD: Granted as a reward.
eventDetailsObjectYesDefines contextual details about the triggering event for this bulk operation.
Example: "eventDetails": { "id": "6911e951f57b486147effa6c", "type": "BULK_ISSUE" }
.idStringYesSpecifies the unique ID of the event or bulk operation reference.
.typeStringYesSpecifies the type of event. Consistent with earnedFromType.
Supported values:
• BULK_ISSUE: Cart promotion granted via a bulk operation.
•ACTIVITY: Triggered by a specific customer event.
• MILESTONE: Triggered by achieving a predefined milestone.
• REWARD: Granted as a reward.
earnedPromotionsObjectYesDefines a list of cart promotions to be earned by the customer in this request. Min items: 1.
.promotionIdStringYesSpecifies the unique identifier of the specific cart promotion being earned.
.earnCountIntegerYesSpecifies the number of times this specific cart promotion should be earned. Must be 1 or greater.
.earnedFromIdStringYesIndicates a unique identifier for this specific earning within the bulk operation.

Example response

{
    "data": [
        {
            "earnedFromId": "68fb1c9731d91c625a8d9e80",
            "promotionId": "6912cfff6629ee07040e15ef",
            "successfulEarnCount": 1,
            "failedEarnCount": 0,
            "customerEarnedPromotions": [
                {
                    "id": "6912d0256629ee07040e15f2",
                    "customerId": 566881933,
                    "promotionId": "6912cfff6629ee07040e15ef",
                    "earnedFromType": "BULK_ISSUE",
                    "earnedFromId": "68fb1c9731d91c625a8d9e80",
                    "eventTime": 1761750000000,
                    "eventTimeISO": "2025-10-29T15:00:00Z",
                    "eventDetails": {
                        "id": "6911e951f57b486147effa6c",
                        "type": "BULK_ISSUE"
                    },
                    "validTill": 1767205799999,
                    "validTillISO": "2025-12-31T18:29:59Z"
                }
            ]
        },
        {
            "earnedFromId": "68fb1c9731d91c625a8d9e80",
            "promotionId": "6912ced9d39e256f754a83f8",
            "successfulEarnCount": 1,
            "failedEarnCount": 0,
            "customerEarnedPromotions": [
                {
                    "id": "6912d0256629ee07040e15f1",
                    "customerId": 566881933,
                    "promotionId": "6912ced9d39e256f754a83f8",
                    "earnedFromType": "BULK_ISSUE",
                    "earnedFromId": "68fb1c9731d91c625a8d9e80",
                    "eventTime": 1761750000000,
                    "eventTimeISO": "2025-10-29T15:00:00Z",
                    "eventDetails": {
                        "id": "6911e951f57b486147effa6c",
                        "type": "BULK_ISSUE"
                    },
                    "validTill": 1767205799999,
                    "validTillISO": "2025-12-31T18:29:59Z"
                }
            ]
        }
    ],
    "errors": []
}

Response parameters

FieldTypeDescription
dataArray[Object]Defines a list of results , one for each entry in the request's earnedPromotions array.
.earnedFromIdStringIndicates the unique identifier provided in the request for this specific earning instance.
.promotionIdStringSpecifies the cart promotion ID from the corresponding request entry.
.successfulEarnCountIntegerIndicates how many instances specified by earnCount were successfully created.
.failedEarnCountIntegerIndicates how many instances specified by earnCount failed to be created.
.errorDetailsObjectDefines details about the failure, present only if failedEarnCount > 0.
...errorCodeIntegerSpecifies a code indicating the reason for failure.
...errorMessagesStringSpecifies a descriptive message explaining the failure.
.customerEarnedPromotionsArray[Object]Defines a list containing the details of each successfully created earning cart promotion for this entry.
....idStringSpecifies the unique identifier (earnId) for the successfully created earning cart promotion.
....customerIdLongSpecifies the ID of the customer.
....promotionIdStringSpecifies the ID of the cart promotion definition.
....earnedFromTypeEnumIndicates how the cart promotion was earned.
....earnedFromIdStringIndicates the identifier for this specific earning instance.
....eventTimeLongSpecifies the timestamp when the earning occurred.
....eventTimeISOString

Specifies the earning timestamp in UTC in ISO 8601 format, returned in the server time zone.

EU server example 2026-02-04T09:08:48Z → 04 February 2026, 09:08:48 (UTC)

India server example 2026-02-04T14:38:48+05:30 → 04 February 2026, 14:38:48 (IST)

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

....eventDetailsObjectDefines details about the triggering event.
....validTillLongSpecifies the expiry timestamp in UTC for this earned cart promotion.
Time format : Unix epoch milliseconds
....validTillISOString

Specifies the expiry timestamp in UTC in ISO 8601 format, returned in the server time zone.

EU server example 2026-02-04T09:09:30Z → 04 February 2026, 09:09:30 (UTC)

India server example 2026-02-04T14:39:30+05:30 → 04 February 2026, 14:39:30 (IST)

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

errorsArrayDefines an array for errors encountered.

Error codes

CodeDescription
400Invalid request. Check required parameters. Ensure all required parameters (such as promotion and customer details) are valid.
404Promotion or customer not found. Use valid, existing promotion and customer identifiers.
705Exceeded maximum active promotions for an org. Deactivate some active promotions before issuing more in bulk.
706Promotion has expired. Use a valid, non-expired promotion.
707The passed promotion type is not supported. Change the promotion type to one supported by the system.
713Earned from type cannot be changed. Do not change earnedFromType on existing earned promotions.
714Earn is not supported for this promotion type. Switch to a promotion type that supports earning.
1006Invalid customer identifier. Provide a valid customer identifier for every request in the bulk call.
1007Error while fetching customer identifier. Retry and validate all customer data in your bulk payload.
500Internal server error. Retry the request after a short delay, and contact support if the error persists.

Body Params
string
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