TRANSACTION_UPDATED
TRANSACTION_UPDATED is sent whenever a transaction is created or changes. It is the event you will rely on most.
When it is sent
Scenario | Trigger |
Gift card, hosted payment model | The customer pays on the page from |
Gift card, float model | A call to |
Affiliate | A transaction is recorded, or its status or commission changes, for example from pending to approved. These are sent by the Spendstream dashboard rather than the API. |
Each gift card purchase sends one webhook. If you have more than one webhook URL or API key pair registered, each one receives its own copy, so deduplicate as described below.
⚠️ Warning: An affiliate transaction can change several times before it is final. Treat every delivery as the latest known state of that transaction, and never assume a pending transaction is settled.
Request format
The request is an HTTP POST with a multipart/form-data body, not a raw JSON body.
Field | Type | Description |
| string | Always |
| string | A JSON-encoded string describing the transaction. Decode it after reading the form field. |
Headers:
Header | Description |
| Hexadecimal HMAC-SHA256 signature. See Webhook security. |
| The time the webhook was signed, |
The header names are exactly Signature and TimeStamp. There is no Spendstream- prefix.
Example: hosted payment
POST /webhooks/spendstream HTTP/1.1
Content-Type: multipart/form-data; boundary=------------------------7d1f
Signature: 3f2c9a...example...b71d
TimeStamp: 2026-10-08 10:15:00
--------------------------7d1f
Content-Disposition: form-data; name="eventType"
TRANSACTION_UPDATED
--------------------------7d1f
Content-Disposition: form-data; name="transaction"
{"UID":"12345","brand-name":"Example Brand","date":"2026-10-08 10:14:58","transaction-id":"a03823e0-316b-11f0-aecc-73ec0aa304a8","order-id":"17872646666a877e9aee2bf","amount-spend":"10.00","total-spendAmount":"10.00","total-commission":"0.00","total-comission":"0.00","gift-card-url":"https://example-publisher.dev.spendstream.co/gift-card-url/20","gift-card-expiry-date":"2027-10-08 23:59:59","free-entries":0,"transaction-type":"gateway"}
--------------------------7d1f--
Gift card fields
Field | Float ( | Hosted payment ( | Meaning |
| Yes | Yes | Your identifier for the user. |
| Yes | Yes | Brand of the card issued. |
| Yes | Yes | Time the card was issued, in UTC. |
| Yes | Yes | Spendstream’s reference for the card. Use it to deduplicate. |
| Empty | Yes | The |
| Yes | Yes | Face value of the card. |
| Sometimes | Yes | Same value as |
| Yes | Yes | Commission on this purchase. |
| Yes | Yes | Where the user views and redeems the card. Send this to your customer. |
| No | Yes | Card expiry. |
| Yes | Yes | Free entries earned, for prize-draw publishers. Otherwise |
|
|
| How the card was paid for. |
| Sometimes | No | Your prepaid balance after the purchase. |
| No | Sometimes | Promotion, brand and the user’s reward balances. |
total-comission is a legacy misspelling of total-commission that is still sent for compatibility. Read total-commission.
Other fields may also appear, sometimes empty. They are used only by white-label sites. Ignore any field you do not recognise.
💡 Tip: The payment success page response uses different names from the webhook: giftcard-url, user-id and giftcard-face-value (now also purchase-amount). Build your fulfilment on the webhook fields above, not on the success page.
Handling the event
- Verify the signature and timestamp first.
- Read
eventType, then decode thetransactionJSON string. - For hosted payments, find your order using
order-id. Then delivergift-card-urlto the customer. - Upsert the record using
transaction-idas the key, so a repeated delivery changes nothing. - Return
200quickly.
There is no event identifier, so deduplicate on transaction-id plus its status. See Webhook processing best practices.
Related reference
- Status values are described in the API reference for
getTransactionsListandgetTransactionsById. - Use
getTransactionsListfor periodic reconciliation, because failed deliveries are not retried.
On this page
- TRANSACTION_UPDATED