Webhook Notification - Transaction Refunded

View as Markdown
Example webhook notification sent by SQRIL when a settled transaction is manually refunded by ops. **When it is sent:** - After an admin marks a SUCCESS transaction as REFUNDED (ledger credit). - Sent to all active webhook configs whose event filter matches `transaction.refunded`. **Payload notes:** - Required fields: `tx_id`, `status` (`REFUNDED`). - Optional fields: `amount`, `fee`, `percentage_fee`, `fixed_fee`, `refund_reason`, `sender`, `recipient`. - `refund_reason` is included when ops supplied a reason on the refund request. **Headers:** - `Content-Type: application/json` - `User-Agent: SQRIL-Webhook/` - `X-SQRIL-Signature` only when a webhook secret is configured. **Verifying `X-SQRIL-Signature`:** ``` X-SQRIL-Signature = base64(HMAC-SHA256(webhook_secret, exact_raw_request_body)) ``` Use the exact raw HTTP body (do not re-serialize JSON). Encoding is base64, not hex. See the Account Webhook Notifications folder description for a Node.js verification example.

Authentication

AuthorizationBasic

Basic Auth: base64(client_id:client_secret)

Headers

X-SQRIL-SignaturestringOptional

base64(HMAC-SHA256(webhook_secret, exact_raw_request_body)). Included only when webhook secret is configured. Verify against the raw body; do not re-serialize JSON.

Request

This endpoint expects an object.
tx_idstringRequired
statusenumRequired
Allowed values:
amountdoubleOptional
feedoubleOptional
percentage_feedoubleOptional
fixed_feedoubleOptional
refund_reasonstringOptional
sendermap from strings to anyOptional
recipientmap from strings to anyOptional

Response

OK
receivedbooleanOptional
messagestringOptional