Create a payment method

Creates a payment method.

SecurityOAuth2
Request
header Parameters
Toast-Idempotency-Key
required
string <UUID>

An integration generated universally unique identifier (UUID) that is used to recognize retries of the same request.

Toast-Session-Secret
required
string <string>

A unique and randomized identifier for the payment or setup intent.

Request Body schema: application/json
object
object (Card)
type
string

The type of payment method.

  • CARD - Payment card.
  • CARD_PRESENT - This is reserved for future use.
Enum: "CARD" "CARD_PRESENT"
usage
string or null

Field used to determine if the logged-in customer will save the payment method for future usage. The value is ON_SESSION for cards saved during checkout. The value is NULL if the card will not be saved for future usage.

  • ON_SESSION - Saves the payment method for future usage by the customer.

  • OFF_SESSION - Saves the payment method for future usage initiated by the restaurant.

  • ON_AND_OFF_SESSION - Reserved for future use.

Enum: "ON_SESSION" "OFF_SESSION" "ON_AND_OFF_SESSION"
Responses
200

Succesful operation. Payment method created.

403

Your Toast API client does not permission to create the payment method.

404

The specified saved payment method was not found.

409

Payment method not found or hasn't been scoped to payment or setup intent.

500

Internal server error.

post/v1/payment-methods
Request samples
application/json
{
  • "type": "CARD",
  • "card": {
    },
  • "billingDetails": {
    },
  • "usage": "ON_SESSION"
}
Response samples
application/json
{
  • "id": "string",
  • "type": "string",
  • "card": {
    }
}