This endpoint is only relevant to Fully Hosted and Custom integrations.
If you’re building with a Forage SDK, then use the
PaymentRefunds
endpoints.
A POST
request to /orders/{order_ref}/refunds/
refunds part of an Order
. It tells Forage’s servers to refund a specific amount
of a single OrderPayment
associated with the Order
. This request has immediate financial side effects.
On success, the API responds with an OrderRefund
that represents the transaction and a 201
HTTP status code.
HTTP STATUS 201
This endpoint always returns a 201
, even if the refund attempt fails, because Forage always creates an OrderRefund
to preserve a record of the attempted transaction. To make sure that the refund was successful, check that the status
is succeeded
. Send periodic GET
requests to /orders/{order_ref}/refunds/{refund_ref}/
to retrieve the updated object. If the status is failed
, then inspect the last_processing_error
field of the response object for information about the error.
This endpoint does not return
receipt
information.To retrieve transaction information to display to the customer, send periodic
GET
requests to/orders/{order_ref}/refunds/{refund_ref}/
. Then, confirm that thereceipt.balance.updated
timestamp is no longer changing and retrieve the latest balance.