HomeGuidesReference
Log In

Create a refund for part of an Order

This endpoint is only relevant to Fully Hosted and Custom integrations.

If you’re building with a Forage SDK, then use the PaymentRefunds endpoints.

🚧

To keep your app secure, requests to refund part of an Order should only be generated on the server-side.

🚧

You must use Forage version 2024-01-08 or higher for this endpoint to return populated receipt data.

Earlier versions return the receipt value as null, so to retrieve the data you need to send GET requests to /orders/{order_ref}/refunds/{refund_ref}/ until the status of the refund is succeeded.

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.

Language
Authorization
OAuth2
URL