| Send | Permission | Community scope |
|---|---|---|
Authorization: Bearer <apiKey> | customerSuccess | Community scope is derived from the key; do not send a community identifier. |
{
"redemptionInstructions": "Deliver to synthetic account AGENT-001"
}meta.code = PURCHASE_HISTORY_UPDATED{
"meta": {
"status": "success",
"statusCode": 200,
"code": "PURCHASE_HISTORY_UPDATED"
},
"message": "Update redemption instructions or voucher details successfully",
"data": {
"_id": "hist_agent_01",
"redemptionId": "ORD202607220001",
"productName": "Agent Test Voucher",
"price": 100,
"quantity": 1,
"status": "New Purchase",
"redemptionInstructions": "Deliver to synthetic account AGENT-001"
}
}meta.code, never message text.| HTTP | Machine code | What the caller should do | Retry? |
|---|---|---|---|
| 400 | VALIDATION_FAILED | Repair errors[]. | No, fix first |
| 401 | AUTH_API_KEY_REQUIRED | Add the Authorization header. | No, fix first |
| 401 | AUTH_API_KEY_INVALID | Replace or rotate the key. | No, fix first |
| 401 | AUTH_API_KEY_VALIDATION_FAILED | Authentication could not be completed. | Yes, with backoff |
| 403 | AUTH_PERMISSION_REQUIRED | Request the customerSuccess permission; no resource data is returned. | No, fix first |
| 404 | STORE_RESOURCE_NOT_FOUND | Refresh through order detail. | After refreshing the ID |
| 409 | STORE_RESOURCE_CONFLICT | Re-read status before retrying. | After reconciliation |
| 500 | INTERNAL_ERROR | Retry with exponential backoff and the same request context, then escalate. | Yes, with backoff |
| 502 | STORE_DEPENDENCY_UNAVAILABLE | Retry with backoff and the same request context. | Yes, with backoff |
curl --location --request PATCH 'https://sgtr-api.returning.ai/v1/purchase-histories/ph_agent_01' \
--header 'Authorization: Bearer <apiKey>' \
--header 'Content-Type: application/json' \
--data '{
"redemptionInstructions": "Deliver to synthetic account AGENT-001"
}'{
"meta": {
"status": "success",
"statusCode": 200,
"code": "PURCHASE_HISTORY_UPDATED"
},
"message": "Update redemption instructions or voucher details successfully",
"data": {
"_id": "hist_agent_01",
"redemptionId": "ORD202607220001",
"productName": "Agent Test Voucher",
"price": 100,
"quantity": 1,
"status": "New Purchase",
"redemptionInstructions": "Deliver to synthetic account AGENT-001"
}
}