Authorization headerpurchase-history permissioncommunityID401 if the key is missing/invalid, 403 if the key lacks the permissionPurchaseHistory.product and overwrites product.redemptionInstructions on the purchase history documentupdate:purchase-history pub/sub event; the store service processes it and performs the DB write502 if the upstream store service is unreachable or the publisher times outpurchaseHistoryID accepts either the Mongo _id or the human-readable order ID (e.g. ORD202641612055614747)redemptionInstructions: required, non-empty string, trimmed, max 10000 chars404 if the purchase history does not exist in this community400{
"redemptionInstructions": "Collect at the main counter between 10am and 6pm. Present your order ID and a valid photo ID."
}curl --location --request PATCH 'https://api.returning.ai/v1/purchase-histories/ORD202641612055614747' \
--header 'Authorization: Bearer XXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"redemptionInstructions": "Collect at the main counter between 10am and 6pm. Present your order ID and a valid photo ID."
}'{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Update purchase history success.",
"data": {
"_id": "507f1f77bcf86cd799439012",
"orderID": "ORD202641612055614747",
"communityID": "507f1f77bcf86cd799439013",
"userID": "507f1f77bcf86cd799439014",
"product": {
"_id": "507f1f77bcf86cd799439015",
"name": "Gold Voucher",
"redemptionInstructions": "Collect at the main counter between 10am and 6pm. Present your order ID and a valid photo ID."
},
"createdAt": "2026-04-01T00:00:00.000Z",
"updatedAt": "2026-04-20T00:00:00.000Z"
}
}