Skip to main content

Order Refunded

Webhook 

Type: order.refunded.v1

Occurs when an order has been refunded

Payload​

The data object in the payload contains order ID, along with the amount, currency and the amount refunded

Example:​

{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.refunded.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"refund_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"merchant_refund_reference": "merchant_refund_reference",
"root_order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"merchant_order_id": "999999",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"gross_amount": "150.65",
"invoice_amount": "150.65",
"payable_amount": "150.65",
"prepaid_amount": "0.00",
"currency": "GBP"
"buyer_company_name": "TWO B2B LTD",
"refunded_gross_amount": "100.65",
"refunded_payable_amount": "100.65",
"refunded_prepaid_amount": "0.00"
"status": "APPROVED",
"state": "REFUNDED",
}
}

Triggering in sandbox​

  1. Create an order through the checkout API service in your sandbox environment. Capture the order ID from the resulting response.
  2. Open the payment_url in the response body and complete verification (in production, this step would be completed by the buyer).
  3. Using the order ID captured, Fulfill the order through the checkout API service in your sandbox environment.
  4. Once the order state moves from Fulfilling to Fulfilled, use the order ID captured to Refund the order through the checkout API service in your sandbox environment.
  5. Once the order state moves to REFUNDED, the order.refunded.v1 webhook will be sent by the webhook gateway to any endpoints you have configured to receive it.

Request​

Responses​

Successful Response