List redemption statuses
List every active redemption order status in your community, grouped by category, with the IDs you send as statusID when you update an order.
- Method
- POST
- Path
https://api.returning.ai / v1/ redemption-transactions/ statuses - Permission
- getRedemptionStatuses
- Retries
- Read-only; exact retries are safe
When to use this
- Find the
statusIDto send when you move an order to another status. - Map the
statusIDon each order to a status name and colour in your own system. - Check whether a status already exists before you create one.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- getRedemptionStatusesShown in the dashboard as “Get Redemption Statuses”
Use a Community API key with getRedemptionStatuses, and keep it on your server. The key decides the community. The body must still name that same community in communityId; any other ID is rejected with 403.
Behaviour#
Only active statuses are listed. A status your team has switched off in the dashboard is left out, and orders can't be moved to it. The categories are fixed: new_purchase, in_progress, completed and refunded. Each category has a default status, created as New Purchase, In Progress, Completed and Refunded, which your team can rename or switch off.
A category with no active status is left out of data, not returned as an empty list, so check that a key exists before you read it. Statuses you create are added after the existing ones. The whole list comes back in one response, with no paging.
Request#
Headers#
Body#
Send communityId as a JSON string. If you don't have it yet, read serverId from any order in List redemption orders by community. Other fields are ignored.
serverId on every order in the order lists.Rule24-character community ID; must match your key
Eg"66f000000000000000000010"
curl --request POST \
--url https://api.returning.ai/v1/redemption-transactions/statuses \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"communityId": "66f000000000000000000010"
}'
Response#
A 200 returns the statuses in data, one list per category. Use _id as statusID when you update an order, and match it against statusID on the orders you read.
Rulesuccess
RuleREDEMPTION_STATUSES_RETRIEVED
Eg"Redemption statuses fetched successfully"
Eg{ ... }
order.Eg[ ... ]
statusID to Update redemption order status.New Purchase. Orders show it as their status.Rulenew_purchase, in_progress, completed or refunded
#FF9C00.true for the category's default status. New orders start in the default new_purchase status unless the product or its Store category sets another.new_purchase.Eg[ ... ]
new_purchase.Eg[ ... ]
new_purchase.Eg[ ... ]
{
"status": "success",
"code": "REDEMPTION_STATUSES_RETRIEVED",
"message": "Redemption statuses fetched successfully",
"data": {
"new_purchase": [
{
"_id": "66f000000000000000000403",
"name": "New Purchase",
"category": "new_purchase",
"color": "#FF9C00",
"order": 0,
"isDefault": true
}
],
"in_progress": [
{
"_id": "66f000000000000000000404",
"name": "In Progress",
"category": "in_progress",
"color": "#2F80ED",
"order": 0,
"isDefault": true
},
{
"_id": "66f000000000000000000406",
"name": "Awaiting Delivery",
"category": "in_progress",
"color": "#808080",
"order": 1,
"isDefault": false
}
],
"completed": [
{
"_id": "66f000000000000000000405",
"name": "Completed",
"category": "completed",
"color": "#27AE60",
"order": 0,
"isDefault": true
}
],
"refunded": [
{
"_id": "66f000000000000000000402",
"name": "Refunded",
"category": "refunded",
"color": "#EB5757",
"order": 0,
"isDefault": true
}
]
}
}
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. Branch on the HTTP status and code, never on message.
Fix the request04
VALIDATION_FAILEDFix the requestcommunityId is missing, isn't a string, or isn't a 24-character ID. A missing or non-string value has detail.communityId; a bad format has message: Invalid community ID format. Send your community ID as a JSON string.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestgetRedemptionStatuses, or it is a personal key. Use a Community API key and add the permission in Settings > Integration > API Keys.API_KEY_COMMUNITY_MISMATCHFix the requestcommunityId isn't the community your key belongs to, so nothing was read. Send your own community ID, or use the other community's key.Fix the data01
COMMUNITY_NOT_FOUNDFix the dataRetry with backoff02
INTERNAL_ERRORRetry with backoffAUTHENTICATION_FAILEDRetry with backoff{
"status": "fail",
"code": "VALIDATION_FAILED",
"message": "Invalid community ID format"
}