A captured transaction can be refunded by calling the POST /transactions/{transaction_id}/refunds API. Refunds can be full or partial.

If the transaction was not yet successfully captured, the operation will fail. Authorized transactions can be voided instead.

curl -i -X POST "https://api.mattildapayments.com/transactions/fe26475d-ec3e-4884-9553-f7356683f7f9/refunds" \
    -H "Authorization: Bearer [JWT_TOKEN]"
    -H "Content-Type: application/json"  \
    -H "X-GR4VY-MERCHANT-ACCOUNT-ID: merchant_id" \
    -d '{
          "amount": 1299
        }'