Process redemption execution using role-based detection. Supports user, business, and admin redemption processing.
ERC721 Dynamic Context & Template Interpolation:
For ERC721 tokens, you can provide a context object whose values become available as {{context.xxx}} placeholders in the token's name/description and AI prompts.
Context sources (merge order):
TokenMetadata.defaultPromptContext→{{defaults.xxx}}Redemption.context(admin-defined) →{{context.xxx}}(always applied)RedemptionRedeemRequest.context(this field) →{{context.xxx}}(only ifallowExternalContextOverwrite=true)
Example - Event ticket redemption:
{
"redemptionId": "redemption-uuid",
"context": {
"seatNumber": "A12",
"attendeeName": "John Smith"
}
}With TokenMetadata name: "{{context.attendeeName}} - Seat {{context.seatNumber}}" Result: "John Smith - Seat A12"
Business ID for this redemption transaction.
Token Recipient Priority:
redemption.ownerBusinessId- Business that created/owns the redemption (default)dto.businessId- This field (override for marketplace/facilitator scenarios)TENANT- Platform fallback for platform-wide redemptions
Stamp Token Resolution (resolveByBusiness=true): When a redemption's priceTokenUnits contains stamp tokens with resolveByBusiness=true, this field is also used to identify which business's on-chain tokenId to burn.
- If the redemption has an
ownerBusinessId, that is used automatically — no need to provide this. - For tenant-level redemptions (no
ownerBusinessId), you must provide this field so the server knows which business's stamp slot to resolve and burn.
Use Cases:
- Omit for standard business-owned redemptions (both recipient and stamp resolution default to owner)
- Provide for tenant-level stamp redemptions to specify which business's stamps to burn
- Provide for marketplace scenarios where a facilitator processes redemptions for another business
ERC721 only - User-provided external context for template interpolation and AI prompts.
SECURITY: Only applied if TokenMetadata.allowExternalContextOverwrite is true (admin opt-in required). Redemption.context (admin-controlled) is ALWAYS applied regardless.
Template Interpolation: Values become available as {{context.keyName}} placeholders in TokenMetadata name/description fields and AI prompts.
Special validity keys:
validityDate- Base date for trigger-based validityvalidityEndDate- End date for date ranges (e.g., hotel checkout)validityDuration- Override duration in days/hours
Custom keys: Any arbitrary key becomes {{context.keyName}} placeholder.
Example: { guestName: "John", roomNumber: "305", validityEndDate: "2026-04-20T11:00:00Z" }
{ "guestName": "John Doe", "validityDate": "2026-04-15T14:00:00Z", "validityEndDate": "2026-04-20T11:00:00Z" }
- Mock serverhttps://docs.pers.ninja/_mock/swagger/redemptions/redeems
- https://api.pers.ninja/v2https://api.pers.ninja/v2/redemptions/redeems
- projectKey
- authJWT
curl -i -X POST \
https://docs.pers.ninja/_mock/swagger/redemptions/redeems \
-H 'Content-Type: application/json' \
-H 'x-project-key: YOUR_API_KEY_HERE' \
-d '{
"redemptionId": "string",
"businessId": "string",
"context": {
"guestName": "John Doe",
"validityDate": "2026-04-15T14:00:00Z",
"validityEndDate": "2026-04-20T11:00:00Z"
}
}'Redemption executed successfully
{ "redeem": { "id": "string", "userId": "string", "redemptionId": "string", "userCountryCode": "string", "status": "PENDING", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "message": "string", "dataSource": { … }, "included": { … } }, "senderTransaction": { "transaction": { … }, "transactionStatus": "created", "signingData": {}, "actionable": { … }, "walletSigningStatus": "string", "signatureData": {} } }