Returning.AIDevelopers
v1

API reference / Rewards & Redemptions

.md

Update redemption order status

Move one redemption order to another status, and optionally return the trader's coins when the new status is a refund.

Last updated 26 Sep 2026API v1

Method
PUT
Path
https://api.returning.ai/v1/redemption-transactions/status
Permission
updateRedemptionTransactionStatus
Retries
No Idempotency-Key; read history first

When to use this

  • Your team has fulfilled a reward, and the order should show Completed.
  • A reward can't be delivered, and the trader should get their coins back.
  • Your fulfilment system tracks its own progress and mirrors each step onto the order.

Authentication#

Header
Authorization: Bearer <API_KEY>
Permission
updateRedemptionTransactionStatusShown in the dashboard as “Update Redemption Transaction Status”

Use a Community API key with updateRedemptionTransactionStatus, and keep it on your server. The key decides the community, so you can only change orders and use statuses in that community.

Behaviour#

You can move an order from any status to any active status in your community; there are no transition rules. Every successful call adds an entry to the order's status history, even when the status is unchanged. The one exception is a repeated refund to the same status. This call doesn't email the trader.

A refund happens only when refundCoins is true and the new status is in the refunded category. It credits the order's price in coins to the trader, recorded in their coin history as a refund. It also returns the voucher to the product's stock if the voucher hasn't expired. If the voucher can't be restocked, the coins are still refunded.

An order is refunded at most once. If it has ever been in a refunded status, even one set without refundCoins, a later refund returns credited: 0 and alreadyRefunded: true. Moving an order out of a refunded status doesn't take the coins back. If two requests change the same order at once, only one can credit coins, and the status that finishes last is kept.

Request#

Headers#

Authorization#stringREQUIRED
Community API key with updateRedemptionTransactionStatus.

RuleBearer <API_KEY>

Content-Type#stringREQUIRED
Request body format.

Ruleapplication/json

Body#

Send the order ID (ORD...) as transactionId. This is the order's redemptionId from the order lists, not its internal _id. Get status IDs from List redemption statuses. The field is statusID with a capital ID. Unknown fields are ignored.

transactionId#stringREQUIRED
The order ID (ORD...) from redemptionId in the order lists. Not the order's internal _id.

RuleOrder ID in your community

Eg"ORD20269268300418273"

statusID#stringREQUIRED
ID of an active status in your community. Spelled statusID; statusId is rejected.

RuleStatus ID in your community

Eg"66f000000000000000000402"

refundCoins#booleanOPTIONAL
true returns the order's coins to the trader. Only allowed when the status is in the refunded category.

RuleBoolean; default false

Egtrue

remark#stringOPTIONAL
A note saved with the change and shown in the order's status history. Defaults to Updated by API.

RuleUp to 500 characters

Eg"Reward out of stock"

curl --request PUT \
  --url https://api.returning.ai/v1/redemption-transactions/status \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "transactionId": "ORD20269268300418273",
    "statusID": "66f000000000000000000402",
    "refundCoins": true,
    "remark": "Reward out of stock"
  }'

Response#

A 200 returns the order's new status. When you sent refundCoins: true, data.refund says whether coins moved: check credited and alreadyRefunded, not just the code.

status#stringALWAYS
Result of the request.

Rulesuccess

message#stringALWAYS
Human-readable summary. Do not branch on it.

Eg"Transaction status updated successfully"

data#objectALWAYS
The order's new status.

Eg{ ... }

transactionId#stringALWAYS
The order ID you sent.

Eg"ORD20269268300418273"

status#objectALWAYS
The order's new status.

Eg{ ... }

_id#stringALWAYS
Status ID.

Eg"66f000000000000000000402"

name#stringALWAYS
Status name.

Eg"Refunded"

category#stringALWAYS
The status category.

Rulenew_purchase, in_progress, completed or refunded

Eg"refunded"

color#stringALWAYS
Display color, a hex code.

Eg"#EB5757"

statusID#stringALWAYS
The status ID you sent.
refund#objectWHEN REFUNDCOINS IS TRUE
What happened to the coins. Present when you sent refundCoins: true.
requested#boolean
Always true.
credited#number
Coins credited to the trader by this call. 0 when the order was already refunded.
alreadyRefunded#boolean
true when no coins moved because the order had already been refunded.
code#stringALWAYS
REDEMPTION_TRANSACTION_REFUNDED when you sent refundCoins: true, otherwise REDEMPTION_TRANSACTION_STATUS_UPDATED.

RuleREDEMPTION_TRANSACTION_REFUNDED or REDEMPTION_TRANSACTION_STATUS_UPDATED

{
  "status": "success",
  "code": "REDEMPTION_TRANSACTION_REFUNDED",
  "message": "Transaction status updated successfully",
  "data": {
    "transactionId": "ORD20269268300418273",
    "statusID": "66f000000000000000000402",
    "status": {
      "_id": "66f000000000000000000402",
      "name": "Refunded",
      "category": "refunded",
      "color": "#EB5757"
    },
    "refund": {
      "requested": true,
      "credited": 500,
      "alreadyRefunded": false
    }
  }
}

Errors#

401 and 403 responses, and the authentication errors 404 COMMUNITY_NOT_FOUND and 500 AUTHENTICATION_FAILED, carry the code in meta.code; every other error carries it in code. A 400 or 404 changes nothing. A 500 may come after the status has already changed.

Fix the request04

400VALIDATION_FAILEDFix the request
A field is missing or has the wrong type. detail names it. Check the statusID spelling and send refundCoins as a JSON boolean.
400REDEMPTION_REQUEST_INVALIDFix the request
refundCoins is true but the status isn't in the refunded category. Nothing changed. Pick a refunded status, or send refundCoins: false.
401AUTHENTICATION_REQUIREDFix the request
The key is missing, invalid or expired. Send Authorization: Bearer <API_KEY> with a current Community API key.
403API_KEY_PERMISSION_DENIEDFix the request
The key lacks updateRedemptionTransactionStatus, or it is a personal key. Use a Community API key and add the permission in Settings > Integration > API Keys.

Fix the data02

404REDEMPTION_TRANSACTION_NOT_FOUNDFix the data
Nothing changed. message says which: Transaction not found (use the ORD... order ID from the order list, not _id) or Status not found or inactive (the status is switched off).
404COMMUNITY_NOT_FOUNDFix the data
The community this key belongs to no longer exists. Contact Returning.AI support.

Retry with backoff02

500INTERNAL_ERRORRetry with backoff
The update failed, or statusID is not a status in your community. Check the ID with List redemption statuses. The status may already have changed, so read the status history before you retry.
500AUTHENTICATION_FAILEDRetry with backoff
The key could not be checked. Retry with backoff; nothing changed.
{
  "status": "fail",
  "code": "REDEMPTION_REQUEST_INVALID",
  "message": "Cannot refund coins for this status"
}

Next step#

Get redemption order status historyPOST/v1/redemption-transactions/transaction-historyConfirm the change was recorded, with your remark, in the order's status history.