Payment intents

A payment intent represents your intent to take a payment from a customer on your checkout page. A payment intent is associated with a single shopping cart or an individual customer shopping session during the checkout phase. For example, you create a payment intent for a customer's online order. When you create a payment intent, you must include the payment amount and the currency type.

The following procedure is a high-level overview of how to create and confirm a payment intent.

  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.

  2. Send a POST request to the /v1/payment-methods endpoint of the payment methods API to create a payment method to attach to the payment intent. This returns a PaymentMethodResponse object.

  3. Confirm the payment intent by invoking the confirmIntent SDK function or send a POST request to the /v1/payment-intents/{paymentIntentId}/confirm endpoint of the payment intents API.

    If the payment intent is successfully confirmed, then the response returns an Order object with the checkId and the paymentId. The paymentId indicates that a payment has been successfully attached to an order.

    If the payment intent fails to attach to the Toast order, the Toast platform auto-cancels the payment and displays an error message to the integration partner.