Refunding Entire Orders Must Be Server-Side
To keep your app secure, requests to refund an entire Order should only be generated on the server-side.
A POST request to /orders/{order_ref}/refund_all/ refunds an entire Order. It tells Forage’s servers to create an OrderRefund for every associated OrderPayment, and to refund all charges to their original payment methods, net any already processed refunds. This request has immediate financial side effects.
On success, the API responds with the original Order. The refunds field details a list of reference hashes, refund_refs, for all of the OrderRefunds that Forage created as part of the refund process.
If there are any OrderRefunds still processing when you send the POST, then the API returns a 400 until those refunds have resolved.
To retrieve information about a particular OrderRefund in the list, send a GET to /orders/{order_ref}/refunds/{refund_ref}/.
Retrieving Refund Receipt Info
This endpoint does not return
receiptinformation.To retrieve transaction information to display to a customer, send periodic
GETrequests to/orders/{order_ref}/refunds/{refund_ref}/for everyOrderRefundreturned in therefundsfield until the status of each issucceeded. Then, confirm that thereceipt.balance.updatedtimestamp is no longer changing and retrieve the latest balance.
Webhooks For Refund Status Updates
Forage sends a
REFUND_STATUS_UPDATEDwebhook when the status of a refund changes. Check out the guide to Forage webhooks for instructions on how to listen for the event.
