v1
latestOpenAPI 3.0.02026-07-244352379.2 KBCreate a Custom Payment Capture Session
A POST request to /capture_sessions/ initiates a Session of the Forage Custom Payment Capture UI.
The response payload represents the Custom Payment Capture Session. The ref and redirect_url fields are the most important:
- ref represents the Order
- Store this ref so that you can pass it in a future request to Create an Order Payment, or to check the status of the Order via a GET to /orders/{order_ref}/
- redirect_url is the URL that launches the front-end, customer-facing Forage UI
- Point customers to this URL to enter their PIN to complete checkout
If PIN entry is successful, then Forage points the customer to the success_redirect_url specified in the request body. Forage directs the customer to the cancel_redirect_url if they cancel the balance inquiry from the Forage UI.
To check the status of an Order after the customer completes the Forage UI, send a GET to /orders/{order_ref}/.
📘 Use customer_id For Better Performance
Pass customer_id in the request to Create a Capture Session.
Forage automatically adds the customer_id to the Session's corresponding Order and OrderPayments.
customer_id helps Forage's servers more quickly identify and associate the correct customer with the Session. While customer_id is not technically a required parameter, if you omit it then the request to create the Session could take longer to process. It is strongly recommended to pass customer_id.
When the same customer_id is provided for a returning customer, Forage will retrieve and reuse their stored payment method, if available. Alternatively, passing the same ebt_payment_method can also pre-fill the stored payment method in the checkout session.
Each customer should only have one unique customer_id. For example, if you create both a Capture Session and a PaymentMethod for the same customer, then the customer_id should be the same in both requests to ensure continuity of stored payment methods.
Request body
Example request
{
"delivery_address": {
"city": "San Francisco",
"country": "US",
"line1": "1856 Market St.",
"state": "CA",
"zipcode": "94102"
},
"is_delivery": false,
"payment_details": {
"snap_payment": {
"amount": 20.12,
"metadata": {},
"payment_method": "fsdf45345",
"description": "A SNAP payment"
},
"ebt_cash_payment": {
"amount": 25.99,
"metadata": {},
"payment_method": "fsdf45345",
"description": "An EBT Cash payment"
}
},
"customer_id": "cus_1234567890",
"supported_benefits": [
"snap",
"non_ebt"
],
"success_redirect_url": "https://www.your-app.com/?status=SUCCEEDED",
"cancel_redirect_url": "https://www.your-app.com/?status=CANCELED"
}Response
OK - Success
Example response
{
"status": "draft",
"delivery_address": {
"city": "San Francisco",
"country": "US",
"line1": "1856 Market St.",
"state": "CA",
"zipcode": "94102"
},
"is_delivery": false,
"payment_details": {
"snap_payment": {
"ref": "b29dj92e4g",
"amount": 20.12,
"metadata": {},
"payment_method": "fsdf45345",
"description": "A SNAP payment",
"funding_type": "ebt_snap"
},
"ebt_cash_payment": {
"ref": "c4gdj92e4g",
"amount": 25.99,
"metadata": {},
"payment_method": "fsdf45345",
"description": "An EBT Cash payment",
"funding_type": "ebt_cash"
}
},
"supported_benefits": [
"snap",
"non_ebt"
],
"ref": "b873fe62dc",
"success_date": null,
"receipt": null,
"customer_id": null,
"is_commercial_shipping": null,
"success_redirect_url": "https://www.your-app.com/?status=SUCCEEDED",
"cancel_redirect_url": "https://www.your-app.com/?status=CANCELED",
"redirect_url": "https://checkout.sandbox.joinforage.app/payment?order=b873fe62dc&merchant=9000055",
"previous_errors": []
}