Accepting a payment using the hosted checkout integration payments APIs

The following procedure is a high-level overview of how to accept a payment using the hosted checkout integration payments APIs and SDKs.

  1. Use your hosted checkout - payment credentials to send a POST request to the /v1/payment-intents endpoint of the payment intents API to create a payment intent. Include the payment amount in the request. Generate and include an identifier for the payment intent in the request.

  2. Initiate a payment session and display the hosted checkout iframe interface to your customer using hosted checkout integration JavaScript SDK functions. Include the OAuth bearer token that you get with the hosted checkout - iframe credentials for your hosted checkout client.

  3. Monitor the result of the customer payment authorization using functions of the hosted checkout integration JavaScript SDK.

  4. Apply the payment identifier you successfully generated as a payment for a Toast orders API check. The payment must be applied to a Toast order within five minutes of the payment card authorization. After five minutes the Toast platform automatically voids the payment.