This endpoint is only relevant to Forage SDK integrations and HSA/FSA payments.
Instead of calling a front-end SDK method to capture a payment, you can use this endpoint to capture a payment from the backend.
A POST
request to /payments/{payment_ref}/capture_payment/
captures an existing Forage Payment.
On success, Forage automatically begins processing the charge to the customer, so this endpoint has immediate financial side effects.
The API responds with a Payment object that represents the transaction and includes complete receipt
information.
For HSA/FSA payments, the capture_amount
must be less than or equal to the original amount
field in the Payment
object.
Passing a
capture_amount
for non-HSA/FSA transactions may result in unexpected behavior.
Once an HSA/FSA payment is captured, the amount
field in the Payment
object is updated to match the capture_amount
. The originally authorized amount moves to the authorization_amount
field, which is used only for debugging and bookkeeping.
To keep your app secure, requests to capture a payment should only be generated from the server-side.
This endpoint is only relevant to Forage SDK integrations.
Instead of calling a front-end SDK method to capture a payment, you can use this endpoint to capture a payment from the backend.
A POST
request to /payments/{payment_ref}/capture_payment/
captures an existing Forage Payment.
On success, Forage automatically begins processing the charge to the customer, so this endpoint has immediate financial side effects.
The API responds with a Payment object that represents the transaction and includes complete receipt
information.
Security Considerations
Always generate requests to capture a payment from your server to ensure secure processing.
Timeout Behavior
The
capture_payment
endpoint processes payments synchronously and has an API timeout of 30 seconds. Ensure your server’s timeout aligns with this value.If your server times out before receiving a response, use the
GET /payments
endpoint or webhooks to confirm the payment status before taking further actions, such as issuing a refund.