# Create a payment method

Creates a new payment method for alternative payment types.

Endpoint: POST /payment-methods
Version: 1.0.0
Security: BasicAuth

## Request fields (application/x-www-form-urlencoded):

  - `type` (string, required)
    Enum: "ach"

  - `customerId` (string)
    Identifier of the customer that will be associated with this payment method.

  - `merchantAccountId` (string)
    Identifier of the merchant account that will be used to create this payment method.

  - `billing` (object)
    Billing details.

  - `billing.name` (string)
    name of billed person or company

  - `billing.email` (string)
    email of billed person or company

  - `billing.address` (object)
    address object

  - `billing.address.line1` (string)

  - `billing.address.line2` (string)

  - `billing.address.zip` (string)

  - `billing.address.city` (string)

  - `billing.address.state` (string)

  - `billing.address.country` (string)
    country represented as a two-letter ISO country code

  - `billing.phone` (string)
    phone number, eg. +12345678901

  - `billing.vat` (string)
    tax identification number

  - `fraudCheckData` (object)
    Additional data used for fraud protection.

  - `fraudCheckData.ipAddress` (string)
    IP address of the user

  - `fraudCheckData.ipCountry` (string)
    country derived from the user's IP address (two-letter ISO country code)

  - `fraudCheckData.email` (string)
    e-mail address of the user

  - `fraudCheckData.phone` (string)
    phone number of the user

  - `fraudCheckData.userAgent` (string)
    value of "User-Agent" HTTP header that was sent by the user

  - `fraudCheckData.acceptLanguage` (string)
    value of "Accept-Language" HTTP header that was sent by the user

  - `fraudCheckData.browserFingerprint` (string)
    hashed device identifier, available if Shift4.js was used to create Token

  - `blik` (object)
    Blik payment method details.

  - `blik.code` (string, required)
    The code obtained by the customer from the banking application (Blik Code flow).

  - `mbway` (object)
    MB Way payment method details.

  - `mbway.linkMethod` (string, required)
    The method used for MB Way integration.
    Enum: "phone_number", "redirect"

  - `swish` (object)
    Swish payment method details.

  - `swish.linkMethod` (string, required)
    The method used for Swish integration.
    Enum: "qr_code", "app_redirect", "phone_number"

## Response 200 fields (application/json):

  - `id` (string)
    Unique payment method identifier
    Example: pm_BokS87jDShjASDkjhdsak4kl

  - `created` (integer)
    Creation date as a UNIX timestamp
    Example: 1415810511

  - `objectType` (string)
    Value is always `payment_method`
    Enum: "payment_method"

  - `clientObjectId` (string)
    Public identifier of the Payment Method that allows to securely access the object from client frontend code without exposing any sensitive data.
    Example: client_pm_kjdS8DSj73DSkjhKJHDKSAna

  - `customerId` (string)
    Identifier of the customer that is the owner of this payment method.
    Example: cust_BokS87jDShjASDkjhdsak4kl

  - `type` (string)
    Enum: "ach"

  - `status` (string)
    Status of payment method. Possible values are:
- `chargeable` - Payment Method is ready to be used to create a charge.
- `pending` - Payment Method setup process is in progress.
- `failed` - setup process of the Payment Method failed.
- `used` - payment method was already charged and cannot be reused.
    Enum: "pending", "chargeable", "used", "failed", "canceled"

  - `billing` (object)
    Billing details.

  - `billing.name` (string)
    name of billed person or company

  - `billing.email` (string)
    email of billed person or company

  - `billing.address` (object)
    address object

  - `billing.address.line1` (string)

  - `billing.address.line2` (string)

  - `billing.address.zip` (string)

  - `billing.address.city` (string)

  - `billing.address.state` (string)

  - `billing.address.country` (string)
    country represented as a two-letter ISO country code

  - `billing.phone` (string)
    phone of billed person or company

  - `billing.vat` (string)
    tax identification number

  - `fraudCheckData` (object)
    Additional data used for fraud protection.

  - `fraudCheckData.ipAddress` (string)
    IP address of the user

  - `fraudCheckData.ipCountry` (string)
    country derived from the user's IP address (two-letter ISO country code)

  - `fraudCheckData.email` (string)
    e-mail address of the user

  - `fraudCheckData.phone` (string)
    phone number of the user

  - `fraudCheckData.userAgent` (string)
    value of "User-Agent" HTTP header that was sent by the user

  - `fraudCheckData.acceptLanguage` (string)
    value of "Accept-Language" HTTP header that was sent by the user

  - `fraudCheckData.browserFingerprint` (string)
    hashed device identifier, available if Shift4.js was used to create Token

  - `flow` (object)
    Describes the next action required to progress the payment method setup.

  - `flow.nextAction` (string)
    The next action to take (for example `wait`, `none`, `three_d_secure`).

  - `merchantAccountId` (string)
    Identifier of the merchant account that was used to create this payment method.

  - `ach` (object)
    Details specific to payment method of type `ach`.

  - `ach.verificationProvider` (string)
    Specifies what provider was used for account data verification.
    Enum: "plaid", "shift4"

  - `ach.last4` (string)

  - `ach.routingNumber` (string)

  - `ach.accountType` (string)

  - `applePay` (object)
    Details specific to payment method of type `apple_pay`.

  - `applePay.amount` (integer)
    amount for which Apple Pay token was created

  - `applePay.currency` (string)
    currency for which Apple Pay token was created

  - `applePay.expMonth` (string)
    month of device-specific expiration of the card used in Apple Pay

  - `applePay.expYear` (string)
    year of device-specific expiration of the card used in Apple Pay

  - `applePay.merchantTokenIdentifier` (string)
    external merchant token identifier from the Apple Pay payment network

  - `applePay.first6` (string)
    first 6 numbers of device-specific account number of the card used in Apple Pay

  - `applePay.last4` (string)
    last 4 numbers of device-specific account number of the card used in Apple Pay

  - `applePay.cardBrand` (string)
    brand of the card used in Apple Pay
    Enum: "Visa", "American Express", "MasterCard", "Discover", "JCB", "Diners Club", "Unknown"

  - `applePay.cardType` (string)
    type of the card used in Apple Pay
    Enum: "Credit Card", "Debit Card", "Unknown"

  - `blik` (object)
    Blik payment method details.

  - `blik.code` (string)
    the code obtained by the customer from the banking application.

  - `googlePay` (object)
    Details specific to payment method of type `google_pay`.

  - `googlePay.first6` (string)
    first 6 numbers of device-specific account number of the card used in Google Pay

  - `googlePay.last4` (string)
    last 4 numbers of device-specific account number of the card used in Google Pay

  - `googlePay.expMonth` (string)
    month of device-specific expiration of the card used in Google Pay

  - `googlePay.expYear` (string)
    year of device-specific expiration of the card used in Google Pay

  - `googlePay.authMethod` (string)
    authorization method used by Google Pay when generating token
    Enum: "pan_only", "cryptogram_3ds"

  - `googlePay.cardBrand` (string)
    brand of the card used in Google Pay
    Enum: "Visa", "American Express", "MasterCard", "Discover", "JCB", "Diners Club", "Unknown"

  - `googlePay.cardType` (string)
    type of the card used in Google Pay
    Enum: "Credit Card", "Debit Card", "Unknown"

  - `mbway` (object)
    MB Way payment method details.

  - `mbway.linkMethod` (string)
    The method used for MB Way integration.
    Enum: "phone_number", "redirect"

  - `swish` (object)
    Swish payment method details.

  - `swish.linkMethod` (string)
    The method used for Swish integration.
    Enum: "qr_code", "app_redirect", "phone_number"

  - `threeDSecure` (object)
    Details specific to payment method of type `three_d_secure`.

  - `threeDSecure.amount` (integer)
    amount for which ThreeDSecure was created

  - `threeDSecure.currency` (string)
    currency for which ThreeDSecure was created

  - `source` (object)
    Full Payment Method object that was used as source for the three_d_secure payment method. Currently the only supported source is a payment method of type google_pay.
    Example: {"id":"pm_BokS87jDShjASDkjhdsak4kl","created":1415810511,"objectType":"payment_method","clientObjectId":"client_pm_kjdS8DSj73DSkjhKJHDKSAna","customerId":"cust_BokS87jDShjASDkjhdsak4kl","type":"google…

  - `source.type` (string, required)
    Enum: "google_pay"

