Revoke Earned Cart Promotion

This API is used to revoke an already earned cart promotion

Example request

curl --location 'https://{Host}/api_gateway/v1/promotions/revokeEarn' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--data '
{
  "customerId": 566881933,
  "earnRevokeDetails": [
    {
      "promotionId": "69117663b1cfc114606fd7fb",
      "earnIds": [
        "6911eaf1f57b486147effac0"
      ]
    },
    {
      "promotionId": "69058646b1cfc114606f7bbe",
      "earnIds": [
        "68f869d94a314550c4b46047"
      ]
    }
  ]
}
'
curl --location 'https://eu.api.capillarytech.com/api_gateway/v1/promotions/revokeEarn' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'Authorization: Basic Z2VvcmdlLmJ1a2w6NzYMGQ3YzI4ZjU4ZjY3MmNhZjY1ZmY=' \
--header 'Cookie: _cfuvid=cc8Wgks3OrtzAV5WVi0XvYs2zw.tj0w-1762861404837-0.0.1.1-604800000' \
--data '
{
  "customerId": 566881933,
  "earnRevokeDetails": [
    {
      "promotionId": "68f9f2904a314550c4b46dc0",
      "earnIds": [
        "string"
      ]
    }
  ]
}
'

Prerequisites

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

Resource information

PaginationNo
Batch supportNo

Rate limit

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

To modify the limit, create a ticket with the Capillary Product support team.

Request body parameters

Field

Type

Required

Description

customerId

Number

Yes

Specifies the unique identifier for the customer.

earnRevokeDetails

Array

Yes

Defines a list of cart promotion and earn ID details to be revoked.

..promotionId

String

Yes

Specifies the unique identifier of the cart promotion.

..earnIds

Array

Yes

Defines a list of specific earn transaction IDs to be revoked.

Maximum earnIds supported in a single request : 1000

Example : "earnIds": [ "earned_id_1A2B3C", "earned_id_4D5E6F", "earned_id_7G8H9I" ]

Example response

{
    "data": {
        "customerId": 566881933,
        "revokedDetails": [
          {
            "promotionId": "69117663b1cfc114606fd7fb",
            "revokedEarnIds": [
              "6911eaf1f57b486147effac0"
            ],
            "status": "SUCCESS"
          },
          {
            "promotionId": "69058646b1cfc114606f7bbe",
            "revokedEarnIds": [
              "68f869d94a314550c4b46047"
            ],
            "status": "SUCCESS"
          }
    T   ]
    },
    "errors": []
}

Response parameters

FieldTypeDescription
dataObjectIndicates the result of the revocation attempt.
..customerIdNumberIndicates customer ID for whom the revocation was processed.
..revokedDetailsArraySpecifies a list of objects detailing the outcome for each cart promotion.
....promotionIdStringIndicates the cart promotion ID for this specific revocation result.
....revokedEarnIdsArrayIndicates a list of earn IDs that were successfully revoked.
....statusStringIndicates status of the revocation.
errorsArraySpecifies a list of errors, if any, encountered during the request.
..codeNumberIndicates the error code.
..messageStringSpecifies a descriptive error message.

Error codes

CodeDescription
400Invalid request. Check required parameters. Ensure all required parameters (such as earn ID, promotion ID) are provided and valid.
404Promotion, Earn, or Customer not found. Use a valid and existing promotion, earn, or customer identifier.
729Promotion earn instance already redeemed. Cannot revoke; provide a valid, unredeemed earn instance.
730Earn revoke not possible for POS and CODE promotion. Only supported earn types can be revoked.
731Earn ID passed is not valid. Use a valid earn ID.
500Internal server error. Retry the request after a short delay, and contact support if the error persists.

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!