We’ve added a new webhook event, for refunded transactions

A transaction.refund or refund transaction event is triggered when a transaction is refunded. A refunded transaction also triggers a cleared event, with the auth property set to false. The amount on both events is negative.

The Fidel API tries to identify the initial transaction for which the refund was issued, using cardId, locationId, merchantId, amount and datetime. If we can identify an associated initial transaction, the webhook data contains the originalTransactionId. If we can’t identify the initial transaction, the data comes in on both webhooks with a negative amount but no originalTransactionId property.

You can use the Fidel Dashboard or the Webhooks API to register your webhook URL with the new transaction.refund event.

curl -X POST \
  https://api.fidel.uk/v1/programs/06471dbe-a3c7-429e-8a18-16dc97e5cf35/hooks \
  -H 'content-type: application/json' \
  -H 'fidel-key: sk_test_50ea90b6-2a3b-4a56-814d-1bc592ba4d63' \
  -d '{
    "event": "transaction.refund",
    "url": "https://example.com/refund-webhook"
  }'

To read more about the new transaction.refund webhook event, visit our documentation!