Docs/API reference/Issuances API
Issuances API
Store signed issuance actions and read completed issuance events.
POST /issuances#
Create an issuance session with an API key or signed-in issuer session.
{
"issuance": {
"issuer": "0x1111111111111111111111111111111111111111",
"loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
"amount": "1000",
"expiresAt": "0",
"deadline": "1790965800",
"nonce": "0x7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a",
"chainId": "8453",
"verifyingContract": "0x3333333333333333333333333333333333333333",
"operationHash": "0x9999999999999999999999999999999999999999999999999999999999999999",
"metadata": {
"loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
"name": "Bloom Coffee Rewards",
"symbol": "BLOOM",
"media": "ipfs://bafy.../bloom.png",
"description": "Rewards for Bloom Coffee customers."
},
"data": "0x"
},
"signature": "0xababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab",
"to": "0x2222222222222222222222222222222222222222"
}// Run on your backend. Sign the issuance as shown in Signing.
// verifiedWallet is the recipient saved with this customer’s conversion.
const response = await fetch("https://api.loyfin.com/issuances", {
method: "POST",
headers: {
"content-type": "application/json",
"x-loyfin-api-key": process.env.LOYFIN_API_KEY
},
body: JSON.stringify({
issuance,
signature,
to: verifiedWallet
})
});
if (!response.ok) {
throw new Error(await response.text());
}
const { issuance: session, duplicate } = await response.json();{
"ok": true,
"duplicate": false,
"issuance": {
"id": "11111111-1111-4111-8111-111111111111",
"operationId": "128",
"kind": "issuance",
"status": "requires_wallet_authorization",
"chainId": "8453",
"issuer": "0x1111111111111111111111111111111111111111",
"walletAddress": "0x2222222222222222222222222222222222222222",
"loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
"amount": "1000",
"expiresAt": "0",
"deadline": "1790965800",
"nonce": "0x7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a",
"checkoutUrl": "https://loyfin.com/issuances/11111111-1111-4111-8111-111111111111?claim=..."
}
}GET /issuances#
List completed issuance events.
curl "https://api.loyfin.com/issuances?issuer=0x1111111111111111111111111111111111111111&limit=25"Filters: cursor, limit, chainId, issuer, to, loyaltyId, token, and operationHash.
Objects#
POST /issuances accepts a Loyfin API key for server integrations or the Privy access token of a signed-in issuer. When you supply issuance.issuer, include its valid EIP-712 signature. An API key with signing enabled can instead omit both fields to use the assigned wallet. If customer wallet authorization is missing, the response includes a checkout URL that carries an opaque claim token. The UUID alone is not a bearer secret; the query-string claim token is. Keep the complete URL out of logs, analytics, support tickets, and referrer data. GET /issuances returns completed Issuance event objects.