---
title: "Payments - Cancel"
method: POST
path: "/payments/{payment_id}/cancel"
tags: ["Payments"]
---

# Payments - Cancel

`POST /payments/{payment_id}/cancel`

A Payment could can be cancelled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_customer_action`.

## Path parameters

- `payment_id` string, required

## Request body

- PaymentsCancelRequest
  - `cancellation_reason` string, nullable — The reason for the payment cancel
  - `merchant_connector_details` MerchantConnectorDetailsWrap — Merchant connector details used to make payments.
    - `creds_identifier` string, required — Creds Identifier is to uniquely identify the credentials. Do not send any sensitive info, like encoded_data in this field. And do not send the string "null".
    - `encoded_data` MerchantConnectorDetails
      - `connector_account_details` object, nullable — Account details of the Connector. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Useful for storing additional, structured information on an object.
      - `metadata` object, nullable — Metadata is useful for storing additional, unstructured information on an object.
  - `all_keys_required` boolean, nullable — If enabled, provides whole connector response

## Response `200`

Payment canceled

## Other responses

- `400` — Missing mandatory fields

---

[API](https://skmtc.net/hyperswitch/apis/dynamic-routing-openapi-3-0.md) · [All operations](https://skmtc.net/hyperswitch/apis/dynamic-routing-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hyperswitch/dynamic-routing-openapi-3-0/revisions/8fbf69ab2597/schema)
