# Creates a payment

Creates a Payment object.

After you have created a Payment you can use the _links.checkout link to redirect your customer.

Endpoint: POST /payments
Version: v1
Security: apiKey

## Request fields (application/json):

  - `amount` (integer, required)
    The amount that the customer will have to pay.
    Example: 1000

  - `currency` (string, required)
    The currency of the payment. Only 'EUR' is supported.
    Enum: "EUR"

  - `description` (string, required)
    The description of the payment. This will be shown to your customer and will be visible in the dashboard.
    Example: "Test Payment"

  - `return_url` (string,null)
    The URL where the customer will be send to after the payment has been processed.
    Example: "https://example.com/thank-you"

  - `cancel_url` (string,null)
    The URL where the customer will be send to after the payment has been canceled by the customer.
    Example: "https://example.com/cancel"

  - `pay_methods` (array,null)
    The allowed pay methods of the payment. If only one pay method is specified, it will be set as the payment pay method. Cannot be used together with a mandate.
    Enum: "afterpay", "bancontact", "bank-transfer", "creditcard", "direct-debit", "ideal", "ideal-qr", "klarna-paynow", "paypal"

  - `metadata` (object,null)
    You can put in random data that you like to save alongside the payment. When you fetch the payment this will be returned in the metadata field.

  - `customer` (string,null)
    ID of the customer that pays. This field is optional, if nothing is given we create a new Customer. Cannot be used together with a mandate.

  - `mandate` (string,null)
    ID of the mandate for payment

  - `setup_mandate` (boolean,null)
    Indicates if the payment should create a mandate after it has been paid. This allows to setup recurring payments without the need to use a Subscription or InstallmentPlan. Needs the customer parameter to be set as well. Cannot be used together with a mandate.

  - `locale` (string,null)
    Specifies the language to be used for the payment pages shown to the customer. If no locale or an invalid locale is specified we will ignore it and choose the locale based on the account settings or the locale used by the customer.
    Enum: "de", "en", "fr", "nl"

  - `issuer` (string,null)
    Specifying the iDEAL issuer is deprecated and will be ignored if provided.
    Enum: "SNSBNL2A", "ASNBNL21", "ABNANL2A", "BUNQNL2A", "KNABNL2H", "RABONL2U", "REVOLT21", "RBRBNL21", "TRIONL2U", "FVLBNL22", "INGBNL2A", "BITSNL2A", "NTSBDEB1", "NNBANL2G"

## Response 201 fields (application/json):

  - `id` (string, required)
    Example: "PPH25H07JYWLR7PA82"

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

  - `amount` (integer, required)
    Example: 1000

  - `description` (string, required)
    Example: "Test Payment"

  - `currency` (string, required)
    Enum: same as `currency` (1 values)

  - `pay_method` (any, required)
    Example: {"id":"ideal","type":"pay_method","name":"iDEAL | Wero","currencies":["EUR"],"minimum_amount":10,"maximum_amount":5000000,"details":{}}
    - `id` (string, required)
      Example: "ideal"
    - `type` (string, required)
      Enum: "pay_method"
    - `name` (string, required)
      Example: "iDEAL | Wero"
    - `currencies` (array)
      Enum: same as `currency` (1 values)
    - `minimum_amount` (integer)
      Example: 10
    - `maximum_amount` (integer)
      Example: 5000000
    - `details` (object)
      Example: {}
    - `details.issuers` (array,null)
    - `details.issuers.code` (string)
    - `details.issuers.name` (string)
    - `details.iban` (string,null)
    - `details.bic` (string,null)
    - `details.account_name` (string,null)
    - `details.routing_number` (string,null)
    - `details.account_number` (string,null)

  - `state` (string, required)
    Example: "paid"

  - `refunded_amount` (integer, required)

  - `return_url` (string,null, required)
    Example: "https://example.com/thank-you"

  - `cancel_url` (string,null, required)
    Example: "https://example.com/cancel"

  - `metadata` (object, required)
    Example: {}

  - `customer` (string,null, required)
    Example: "CU7JRN6W6K3DA9"

  - `mandate` (string,null, required)
    Example: "MD6ULYXJ4HP9RJ"

  - `subscription` (string,null, required)

  - `installment_plan` (string,null, required)

  - `locale` (string,null, required)
    Enum: same as `locale` (4 values)

  - `paid_at` (string,null, required)
    Example: "2023-06-30T12:44:35Z"

  - `fail_reason` (string,null)
    Enum: "The transaction amount or count exceeds the permitted frequency for this card or account.", "The card holder lacks sufficient funds to complete the transaction.", "The transaction could not be processed with the provided card number.", "The issuer has declined the transaction for authentication reasons.", "The transaction is suspected to be fraudulent.", "The issuer did not allow this transaction against this card based on internal reasons, such as the transaction originated from a specifically restricted industry or country.", "The payment is declined."

  - `created_at` (string,null, required)
    Example: "2023-06-30T12:40:10Z"

  - `_links` (object, required)
    Example: {"self":"https://api.paypro.nl/payments/PPH25H07JYWLR7PA82","customer":"https://api.paypro.nl/customers/CU7JRN6W6K3DA9","mandate":"https://api.paypro.nl/mandates/MD6ULYXJ4HP9RJ"}

  - `_links.self` (string, required)
    Example: "https://api.paypro.nl/payments/PPH25H07JYWLR7PA82"

  - `_links.customer` (string)
    Example: "https://api.paypro.nl/customers/CU7JRN6W6K3DA9"

  - `_links.mandate` (string)
    Example: "https://api.paypro.nl/mandates/MD6ULYXJ4HP9RJ"

  - `_links.subscription` (string)

  - `_links.installment_plan` (string)

  - `_links.checkout` (string)


