HomeGuidesReference↗ Forage Dashboard
Log In
Reference

Capture an EBT or HSA/FSA Payment

Forage SDK Integrations And HSA/FSA Only

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. For EBT payments the response also 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.

Incompatible Fields for EBT Transactions

Avoid using capture_amount, qualified_healthcare_total, qualified_healthcare_subtotal, and product_list. Including these fields in EBT transactions may cause 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.

Capture Requests Must Be Server-Side

To keep your app secure, requests to capture a payment should only be generated from the server-side.

Path Params
string
required

A unique reference hash for the Forage Payment object, returned when the Payment was created.

Body Params

A request body to pass to /payments/{payment_ref}/capture_payment/. Required for HSA/FSA payments.

number

The amount to capture, in USD.

number

The total amount of qualified healthcare items in the order after discounts, including tax, shipping, and fees, in USD.

number

The total amount of qualified healthcare items in the order before any discounts, adjustments, taxes, or fees, in USD.

product_list
array of objects

A list of products that a customer has in their cart at checkout.

product_list
Headers
string
required

An OAuth 2.0 authentication token that validates the request. Send a POST to the /o/token/ endpoint to generate an authentication token. Pass the token in this header after the word Bearer and a whitespace, for example Bearer sandbox_sZawPSUSm9eetx8LrfBbJlzUZS3zWD.

string
required

A unique merchant ID that Forage provides during onboarding, as in 123ab45c67. The Merchant ID can be found in the Forage sandbox or production dashboard.

string
required

An alphanumeric key that clients can use to identify repeated requests that are dropped in transit. Generate a distinct key for every unique request and only re-use keys for retries.

string

The Forage version, represented as a string with the format of a YYYY-MM-DD date.

If not specified in the request header, then the version defaults to the value set in the Forage dashboard.

Responses

Language
Credentials
URL
Request
Response
Choose an example:
application/json