List redemption orders by custom-field identifier
List one trader's redemption orders in your community, newest first, finding the trader by a custom user field such as your broker customer ID.
- Method
- POST
- Path
https://api.returning.ai / v1/ redemption-transactions/ by-identifier - Permission
- customerSuccess
- Retries
- Read-only; exact retries are safe
When to use this
- A trader contacts support and you only have their broker customer ID.
- Show a trader's reward orders inside your own client portal.
- Find an order ID (
ORD...) for one trader before you change its status or read its history.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- customerSuccessShown in the dashboard as “Customer Success”
Use a Community API key with customerSuccess, and keep it on your server. The key decides the community, so never send a communityId. The lookup only finds traders in that community, and only their orders there.
Behaviour#
The identifier must match exactly one active trader in your community. Deleted accounts and removed members aren't matched, and return 404 USER_NOT_FOUND. Text values are compared exactly, including capital letters, after leading and trailing spaces are removed. For a numerical field, "10042" and 10042 match the same trader.
Orders come back newest first, by redemption time, whatever their status. Orders the trader redeems while you page push older ones down, so de-duplicate by redemptionId.
Request#
Headers#
Body#
identifier is required, with both key and value. page and limit are optional; limit defaults to 10 and can be at most 100. To look a trader up by email, use List redemption orders by user email instead: id and email aren't accepted as keys here. Unknown fields are ignored.
Eg{"key": "customerid", "value": "<brokerCustomerId>"}
customerid. Case-sensitive.RuleCustom field key; not id or email
Eg"customerid"
RuleNon-empty string, or a number
Eg"<brokerCustomerId>"
RuleWhole number, 1 or more; default 1
Eg1
RuleDefault 10; max 100
Eg20
curl --request POST \
--url https://api.returning.ai/v1/redemption-transactions/by-identifier \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"identifier": {
"key": "customerid",
"value": "<brokerCustomerId>"
},
"page": 1,
"limit": 20
}'
Response#
A 200 returns the page in data.transactions and the totals in data.pagination, with the same order fields as List redemption orders by community plus the redemption method when the order has one, and without userData. A trader with no orders gets an empty list and total of 0, not a 404. redemptionId is the order ID (ORD...) that every other redemption endpoint takes as transactionId. Map statusID to your own status labels with List redemption statuses.
Rulesuccess
RuleREDEMPTION_TRANSACTIONS_RETRIEVED
Eg"Redemption transactions fetched successfully"
Eg{ ... }
Eg[ ... ]
redemptionId, not this.Eg"66f000000000000000000401"
ORD...). Send it as transactionId to update the order or read its history.Eg"ORD20269268300418273"
Eg"66f000000000000000000010"
Eg"<userObjectId>"
Eg"66f000000000000000000101"
Eg"66f000000000000000000502"
RuleMin 0
Eg500
RuleMin 0
Eg1
New Purchase or Refunded.Eg"Refunded"
Eg"66f000000000000000000402"
voucher.Eg"voucher"
Eg{ ... }
customInstructions or physicalDelivery, when the product sets one.RuleNullable
Eg"digital"
Eg"method-synthetic-001"
Eg"Email delivery"
RuleNullable
Eg{"client_id": "synthetic-client-id"}
RuleDate-time
Eg"2026-09-26T08:30:00.000Z"
RuleDate-time
Eg"2026-09-26T08:30:00.000Z"
RuleDate-time
Eg"2026-09-26T09:15:00.000Z"
null if unknown.RuleNullable
Eg"$25 Trading Credit"
Eg{"total": 1, "page": 1, "limit": 20, "totalPages": 1}
RuleMin 0
Eg1
RuleMin 1
Eg1
Rule1-100
Eg20
limit. 0 when the trader has no orders.RuleMin 0
Eg1
{
"status": "success",
"code": "REDEMPTION_TRANSACTIONS_RETRIEVED",
"message": "Redemption transactions fetched successfully",
"data": {
"transactions": [
{
"_id": "66f000000000000000000401",
"redemptionId": "ORD20269268300418273",
"serverId": "66f000000000000000000010",
"userId": "<userObjectId>",
"rewardId": "66f000000000000000000101",
"voucherId": "66f000000000000000000502",
"price": 500,
"quantity": 1,
"status": "Refunded",
"statusID": "66f000000000000000000402",
"type": "voucher",
"userInfo": {
"username": "sample_trader",
"name": "Sample Trader",
"email": "trader@example.com"
},
"purchasedDate": "2026-09-26T08:30:00.000Z",
"createdAt": "2026-09-26T08:30:00.000Z",
"updatedAt": "2026-09-26T09:15:00.000Z",
"productName": "$25 Trading Credit"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1
}
}
}
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 request06
VALIDATION_FAILEDFix the requestidentifier is missing, identifier.key is empty, id or email, identifier.value is empty or not a string or number, or page or limit is out of range. detail names the field. For id or email, use the email endpoint or Get User Data instead.CUSTOM_FIELD_IDENTIFIER_NOT_FOUNDFix the requestcountry aren't accepted, and keys are case-sensitive. Check the key against List user field definitions.CUSTOM_FIELD_IDENTIFIER_UNSUPPORTED_TYPEFix the requestCUSTOM_FIELD_IDENTIFIER_INVALID_VALUEFix the requestAUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestcustomerSuccess, or it is a personal key. Use a Community API key and add the permission in Settings > Integration > API Keys.Fix the data04
USER_NOT_FOUNDFix the dataCOMMUNITY_NOT_FOUNDFix the dataCUSTOM_FIELD_IDENTIFIER_DUPLICATEFix the dataCUSTOM_FIELD_IDENTIFIER_LOOKUP_AMBIGUOUSFix the dataRetry with backoff04
INTERNAL_ERRORRetry with backoffAUTHENTICATION_FAILEDRetry with backoffCUSTOM_FIELD_IDENTIFIER_NOT_READYRetry with backoffCUSTOM_FIELD_IDENTIFIER_SCAN_LIMIT_EXCEEDEDRetry with backoff{
"status": "fail",
"code": "CUSTOM_FIELD_IDENTIFIER_NOT_FOUND",
"message": "Custom field identifier does not exist."
}