Log In

Create a Payment


To keep your app secure, requests to create a Payment should only be generated on the server-side.

A POST request to /payments/ tells Forage’s servers how much to charge an existing PaymentMethod.

On success, the API responds with a Forage Payment object that represents the one-time charge. You need to pass the ref response value to an SDK function to authorize and capture the payment, one of:

Pass customer_id in the request to Create a Payment

customer_id helps Forage's servers more quickly identify and associate the correct customer with the Payment. While customer_id is not technically a required parameter, if you omit it then the request to create the Payment could take longer to process. It is strongly recommended to pass customer_id.

Each customer should only have one unique customer_id. For example, if you create both a Payment and a PaymentMethod for the same customer, then the customer_id should be the same in both requests.


Payment objects expire after 30 minutes.

If a Payment is not captured or canceled within 30 minutes of when it's created, then it expires. To attempt the transaction again, create a new Payment.