Docs/Reference/Redeem action
Redeem action
A developer-focused reference for constructing and signing a burn that adds tokenized points back into the brand account.
When to use#
Redeem when a customer adds tokenized loyalty value back into the brand account.
A redemption burns the exact signed tokenized amount from the selected expiry bucket after validation succeeds. deadline can limit how long the signed redemption remains executable. The brand should credit or restore offchain points only after the completed burn receipt is indexed, and should process each receipt exactly once.
Fields#
| Field | Type | Required | Meaning |
|---|---|---|---|
issuer | address | yes | Brand wallet that signs the redemption. |
from | address | session | Customer wallet whose tokenized balance is burned. Not part of the issuer-signed terms; add it with the holder signature or collect it on checkout. |
loyaltyId | bytes32 | yes | Brand-scoped program ID. |
amount | uint256 string | yes | Tokenized loyalty amount to burn and reconcile offchain. Must be greater than zero. |
expiresAt | uint256 string | yes | The exact bucket to burn. Use 0 for non-expiring balances. |
deadline | uint256 string | yes | Last Unix timestamp when the redemption can be submitted. Use 0 for no execution deadline. |
nonce | bytes32 | yes | Unique per issuer. Replays are rejected. |
chainId | uint256 string | yes | Expected chain ID. Loyfin uses Base 8453. |
verifyingContract | address | yes | The Loyfin factory that will execute the action. |
operationHash | bytes32 | optional | Brand reference hash for correlating this action with an internal database row. Defaults to zero bytes when omitted. |
data | hex bytes | optional | Brand-defined fulfillment data. Defaults to 0x. Max 2048 bytes. |
Example#
{
"redemption": {
"issuer": "0x1111111111111111111111111111111111111111",
"loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
"amount": "250",
"expiresAt": "0",
"deadline": "0",
"nonce": "0x7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a",
"chainId": "8453",
"verifyingContract": "0x3333333333333333333333333333333333333333",
"operationHash": "0x9999999999999999999999999999999999999999999999999999999999999999",
"data": "0x"
},
"signature": "0xababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab"
}