# Create a pay method

This endpoint is used for creating a Pay Method to store customer card details for future payments. Note: This feature is only enabled on request and may not be enabled by default for your account.

Endpoint: POST /pay/methods
Version: 0.9
Security: JWT

## Header parameters:

  - `Authorization` (string, required)

  - `Content-Type` (string, required)
    Enum: "application/json"

## Request fields (application/json):

  - `customerId` (string, required)
    A unique customer id in your system to link this Pay Method to.
    Example: "1d448ac1-862a-4c7b-bdb4-a3b7cdbf6160"

  - `isDefault` (boolean)
    Optional. Set to true to mark this payment method as the default for the customer. Omit or set to false for non-default payment methods.
    Example: true

  - `tokenId` (string, required)
    tokenId can be used to make payments to an external payment provider and corresponds to the tokenised representation of the payment card.
    Example: "4111111234567890"

  - `card` (object, required)
    The card details for the Pay Method

  - `card.brand` (string, required)
    Card brand such as Visa or Mastercard
    Example: "VISA"

  - `card.expiryMonth` (number, required)
    Month of card expiry
    Example: 10

  - `card.expiryYear` (number, required)
    Year of card expiry
    Example: 50

  - `card.lastFourDigits` (string, required)
    Last four digits of the card number
    Example: "4365"

  - `card.firstSixDigits` (string, required)
    First six digits of the card number (BIN/IIN)
    Example: "411111"

## Response 200 fields (application/json):

  - `id` (string)
    The id of the Pay Method in the Tyro Connect system. This id can be specified in the Pay Request when making payments for the associated customer.
    Example: "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149"

  - `customerId` (string)
    The id of the Customer in the Tyro Connect system linked to this Pay Method.
    Example: "1d448ac1-862a-4c7b-bdb4-a3b7cdbf6160"

  - `isDefault` (boolean)
    When true, indicates this is the default payment method for the customer. This field is only present when the payment method is set as default.
    Example: true

  - `tokenId` (string)
    tokenId can be used to make payments to an external payment provider and corresponds to the tokenised representation of the payment card.
    Example: "4111111234567890"

  - `tokenStatus` (string)
    The status of the token associated with this Pay Method. Indicates whether the token is valid for use in payments.
    Enum: "VALID", "INVALID"

  - `card` (object)
    The card used by the Pay Method

  - `card.brand` (string)
    Card brand such as Visa or Mastercard
    Example: "VISA"

  - `card.expiryMonth` (number)
    Month of card expiry
    Example: 10

  - `card.expiryYear` (number)
    Year of card expiry
    Example: 50

  - `card.firstSixDigits` (string)
    First six digits of the card number
    Example: "411111"

  - `card.lastFourDigits` (string)
    Last four digits of the card number
    Example: "4365"

## Response 400 fields (application/json):

  - `error` (string)
    The validation error message.

  - `errorCode` (string)
    The unique error code for message.


## Response 403 fields
