# Cancels a payment

Cancels a payment. It is possible to cancel payment only in open or initialiazed state.

Endpoint: DELETE /payments/{id}
Version: v1
Security: apiKey

## Path parameters:

  - `id` (string, required)
    ID of the payment

## Response 200 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: "EUR"

  - `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: "de", "en", "fr", "nl"

  - `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)


