| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
This API redeems an issued reward transaction, moving every user reward in the transaction from the ISSUED state to REDEEMED.
Use it to mark a reward as consumed once the customer has actually used it (for example, a voucher scanned in-store or a coupon applied at checkout). Only transactions in the ISSUED state can be redeemed.
The endpoint is gated by the brand-level REDEEM_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 redeemed together. If any one of them is not in the
ISSUEDstate, the entire request is rejected and none of them are redeemed.- A successful redeem also triggers a
rewardRedeemedevent notification, if configured. See Supported Events.
Prerequisites
- Authentication: Basic or OAuth authentication.
- The
REDEEM_ENABLEbrand configuration flag must be set totruefor the org. It isfalseby default and is managed through the brand configuration API. - The reward transaction must be in the
ISSUEDstate.
Request query parameters
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Optional | Store identifier used for gateway authentication, consistent with other reward APIs. |
Request body parameters
| Field | Type | Required | Description |
|---|---|---|---|
txnId | integer | Required | Transaction ID of the issuance transaction whose rewards are to be redeemed. This is the reward issuance transaction ID returned at the time of issuance. |
redeemedAtEventDateTime | string | Optional | The date and time at which the redemption happened at the source, in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Defaults to the processing time if not provided. |
API Quick Reference
POST /api_gateway/rewards/core/v1/user/reward/redeem
├─ Request
│ ├─ txnId (integer)
│ └─ redeemedAtEventDateTime (string)
└─ Response
├─ status
│ ├─ success (boolean)
│ ├─ code (integer)
│ └─ message (string)
├─ txnId (integer)
├─ state (string)
└─ userRewardCount (integer)
Example request
curl --location --request POST 'https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/user/reward/redeem?username=swati' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"txnId": 9876543210,
"redeemedAtEventDateTime": "2026-05-13T09:32:11.000Z"
}'Example response
A successful redeem returns the resulting state and the number of user rewards that were redeemed for the transaction.
{
"status": {
"success": true,
"code": 200,
"message": "Reward redeemed successfully"
},
"txnId": 9876543210,
"state": "REDEEMED",
"userRewardCount": 1
}When the transaction's user rewards are not all in the ISSUED state, the state is not changed and the response reports the failure.
{
"status": {
"success": false,
"code": 13003,
"message": "Transaction is not in the required state for this operation"
},
"txnId": 9876543210
}Response parameters
| Field | Type | Description |
|---|---|---|
status | object | Object containing the outcome of the request. |
.success | boolean | Indicates whether the redeem succeeded. |
.code | integer | Status code for the outcome. 200 indicates success; other values indicate the failure reason. See API-specific error codes. |
.message | string | Human-readable description of the outcome. |
txnId | integer | Transaction ID that was redeemed, echoed from the request. |
state | string | Resulting state of the transaction's user rewards. Returned as REDEEMED only when the redeem succeeds. |
userRewardCount | integer | Number of user rewards transitioned to REDEEMED for the transaction. Returned only when the redeem succeeds. |
API-specific error codes
The endpoint returns HTTP 200 for every outcome once the request reaches the business logic, with the outcome conveyed through the status object in the response body. The one exception is a missing required txnId, which fails standard request validation before the business logic runs and returns a raw HTTP 400. The table below lists the status.code values and the symbolic name of each.
| Code | Symbolic name | Message | When it occurs |
|---|---|---|---|
| 200 | REWARD_REDEEMED_OK | Reward redeemed successfully | The transaction was redeemed and its rewards moved to REDEEMED. |
| 400 | — | must not be null | The required txnId field is missing from the request body. |
| 400 | INVALID_REQUEST | Invalid date format: <value> | redeemedAtEventDateTime was provided but is not a valid ISO 8601 date-time. |
| 13001 | REDEEM_FEATURE_NOT_ENABLED | Redeem feature is not enabled for this brand | The REDEEM_ENABLE flag is false for the org. |
| 13003 | INVALID_REWARD_STATE | Transaction is not in the required state for this operation | One or more user rewards in the transaction are not in the ISSUED state. |
| 10007 | TRANSACTION_NOT_FOUND | Transaction not found | No transaction exists for the provided txnId. |
| 10008 | USER_REWARD_NOT_FOUND | User reward not found | The transaction exists but has no associated user rewards. |
