Get redemption status by ID
Read one active redemption order status in your community by its ID, with its name, category and colour.
- Method
- POST
- Path
https://api.returning.ai / v1/ redemption-transactions/ status/ detail - Permission
- getRedemptionStatusById
- Retries
- Read-only; exact retries are safe
When to use this
- An order shows a
statusIDyou don't recognise, and you want its name and category. - Check that a status is still switched on before you move orders to it.
- Confirm whether a status is in the refunded category before you send a coin refund.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- getRedemptionStatusByIdShown in the dashboard as “Get Redemption Status By ID”
Use a Community API key with getRedemptionStatusById, and keep it on your server. This permission is separate from getRedemptionStatuses, which List redemption statuses needs. 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 returned. A status your team has switched off in the dashboard returns 404, the same as an ID that doesn't exist, and orders can't be moved to it.
Request#
Headers#
Body#
Send both id and communityId as JSON strings. If you don't have your community ID yet, read serverId from any order in the order lists. Other fields are ignored.
statusID on an order.Rule24-character hex ID
Eg"66f000000000000000000402"
serverId on every order.Rule24-character community ID; must match your key
Eg"66f000000000000000000010"
curl --request POST \
--url https://api.returning.ai/v1/redemption-transactions/status/detail \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"id": "66f000000000000000000402",
"communityId": "66f000000000000000000010"
}'
Response#
A 200 returns the status in data, with the same fields as each entry in List redemption statuses.
Rulesuccess
RuleREDEMPTION_STATUS_RETRIEVED
Eg"Redemption status fetched successfully"
Eg{ ... }
statusID to Update redemption order status.Eg"66f000000000000000000402"
Refunded. Orders show it as their status.Eg"Refunded"
Rulenew_purchase, in_progress, completed or refunded
Eg"refunded"
#EB5757.Eg"#EB5757"
Eg0
true for the category's default status.Egtrue
{
"status": "success",
"code": "REDEMPTION_STATUS_RETRIEVED",
"message": "Redemption status fetched successfully",
"data": {
"_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 requestid or communityId is missing, isn't a string, or isn't a 24-character ID. A missing or non-string value has detail naming the field; a bad format has message: Invalid status ID format or Invalid community ID format.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestgetRedemptionStatusById, 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.Fix the data02
REDEMPTION_STATUS_NOT_FOUNDFix the dataCOMMUNITY_NOT_FOUNDFix the dataRetry with backoff02
INTERNAL_ERRORRetry with backoffAUTHENTICATION_FAILEDRetry with backoff{
"status": "fail",
"code": "VALIDATION_FAILED",
"message": "Invalid status ID format"
}