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. Raise a ticket with Product support to enable this for your organisation.

👍

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.

Example request

curl --location --request POST 'https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/user/reward/revoke?username={tillusername}' \
  --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"
  }'

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.

Request query parameters

FieldTypeRequiredDescription
usernamestringOptionalThe unique name of the store(till). If not provided, the store is derived from the authorisation used within the API.

Request body parameters

FieldTypeRequiredDescription
txnIdintegerRequiredThe issuance transaction ID to revoke. Use the transactionId value returned in the Issue Reward response.
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 response

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

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.

Error codes

CodeSymbolic nameMessageWhen it occurs
200REWARD_REVOKED_OKReward revoked successfullyThe transaction was revoked and its rewards moved to CANCELLED.
13005REVOKE_FEATURE_NOT_ENABLEDRevoke feature is not enabled for this brandThe REVOKE_ENABLE flag is false for the org.
13008REVOKE_INVALID_STATETransaction <txnId> is in state <current_state> but for revoke the state should be in ISSUEDOne or more user rewards in the transaction are not in the ISSUED state. The message reports the actual current state (for example, REDEEMED or CANCELLED).
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

Store identifier used for gateway authentication.

Body Params
int64
required

Transaction ID of the issuance transaction to revoke.

string

Source event date-time in ISO 8601 format. Defaults to the processing time.

string

Actor who initiated the revoke.

string

Reason for revoking the reward.

Headers
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