Revoke User Reward

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

This API revokes an issued reward transaction, moving every user reward in the transaction from the ISSUED state to CANCELLED, and refunds the points that were consumed when the reward was issued.

Use it to reverse a mis-issued or cancelled reward so that its value does not leak. Only transactions in the ISSUED state can be revoked; a reward that has already been redeemed must be reverse-redeemed back to ISSUED before it can be revoked.

The endpoint is gated by the brand-level REVOKE_ENABLE configuration flag, which is false by default. If the flag is not enabled for the org, the request is rejected.

👍

Note

  • For detailed information about our APIs and for hands-on testing, refer to the documentation in API overview and the step-by-step guide on making your first API call in Make your first API call.
  • All user rewards belonging to the transaction are revoked together. The points reversal is a single call for the whole transaction, because the rewards of a transaction share one redemption identifier.

Prerequisites

  • Authentication: Basic or OAuth authentication.
  • The REVOKE_ENABLE brand configuration flag must be set to true for the org. It is false by default and is managed through the brand configuration API.
  • The reward transaction must be in the ISSUED state.

Resource information

URI/api_gateway/rewards/core/v1/user/reward/revoke?username=\{store\}
HTTP MethodPOST
PaginationNo
Batch supportNo
Rate limit informationNone

API endpoint example

https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/user/reward/revoke?username=swati

Request query parameters

FieldTypeRequiredDescription
usernamestringOptionalStore identifier used for gateway authentication, consistent with other reward APIs.

Request body parameters

FieldTypeRequiredDescription
txnIdintegerRequiredTransaction ID of the issuance transaction whose rewards are to be revoked. This is the reward issuance transaction ID returned at the time of issuance.
revokedEventDateTimestringOptionalThe date and time at which the revoke happened at the source, in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Defaults to the processing time if not provided.
revokedBystringOptionalIdentifier of the actor who initiated the revoke, for example BRAND_OPERATOR. Stored against the revoke record for audit.
revokeReasonstringOptionalReason for revoking the reward, for example VENDOR_FULFILMENT_FAILURE. Stored against the revoke record for audit.

Example request

curl --location --request POST 'https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/user/reward/revoke?username=swati' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic <token>' \
  --data '{
    "txnId": 9876543210,
    "revokedEventDateTime": "2026-05-13T09:32:11.000Z",
    "revokedBy": "BRAND_OPERATOR",
    "revokeReason": "VENDOR_FULFILMENT_FAILURE"
  }'

Example response

A successful revoke returns the resulting state and the number of user rewards that were cancelled for the transaction.

{
  "status": {
    "success": true,
    "code": 200,
    "message": "Reward revoked successfully"
  },
  "txnId": 9876543210,
  "state": "CANCELLED",
  "userRewardCount": 1
}

When the points reversal could not be completed, the state is not changed and the response reports the failure. The caller should retry the revoke.

{
  "status": {
    "success": false,
    "code": 1018,
    "message": "Failed to reverse points"
  },
  "txnId": 9876543210
}

Response parameters

FieldTypeDescription
statusobjectObject containing the outcome of the request.
.successbooleanIndicates whether the revoke succeeded.
.codeintegerStatus code for the outcome. 200 indicates success; other values indicate the failure reason. See API-specific error codes.
.messagestringHuman-readable description of the outcome.
txnIdintegerTransaction ID that was revoked, echoed from the request.
statestringResulting state of the transaction's user rewards. Returned as CANCELLED only when the revoke succeeds.
userRewardCountintegerNumber of user rewards transitioned to CANCELLED for the transaction. Returned only when the revoke succeeds.

Points reversal behaviour

On revoke, the points consumed during issuance are refunded through a single points reversal call for the transaction:

  1. Rewards that have no points attached (free or non-points rewards) need no reversal, and the revoke proceeds to CANCELLED.
  2. If the points reversal succeeds, the user rewards move to CANCELLED and the reversal reference is recorded against the revoke.
  3. If the points reversal fails (the points service is unreachable, returns a non-success response, or the points could not be returned), the state does not change. The response returns code 1018 and the revoke attempt is recorded so it can be retried.

API-specific error codes

The endpoint returns HTTP 200 in all cases. The outcome is conveyed through the status object in the response body. The table below lists the status.code values and the symbolic name of each.

CodeSymbolic nameMessageWhen it occurs
200REWARD_REVOKED_OKReward revoked successfullyThe transaction was revoked and its rewards moved to CANCELLED.
400must not be nullThe required txnId field is missing from the request body.
13005REVOKE_FEATURE_NOT_ENABLEDRevoke feature is not enabled for this brandThe REVOKE_ENABLE flag is false for the org.
13003INVALID_REWARD_STATETransaction is not in the required state for this operationOne or more user rewards in the transaction are not in the ISSUED state.
10007TRANSACTION_NOT_FOUNDTransaction not foundNo transaction exists for the provided txnId.
10008USER_REWARD_NOT_FOUNDUser reward not foundThe transaction exists but has no associated user rewards.
1018REVERSE_POINTS_API_EXCEPTIONFailed to reverse pointsThe points reversal could not be completed. The state is unchanged; retry the revoke.
Query Params
string
Body Params
int64
required
string
string
string
Headers
string
string
Response

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