Partial Refunds Must Be Server-Side
To keep your app secure, requests to refund part of an Order should only be generated on the server-side.
API Version Requirements
You must use Forage version
2024-01-08or higher for this endpoint to return populatedreceiptdata. Earlier versions return the receipt value as null, so to retrieve the data you need to sendGETrequests to/orders/{order_ref}/refunds/{refund_ref}/until the status of the refund issucceeded.
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.
