Payments - Cancel Post Capture

Cancel a payment after it has been captured by providing a cancellation reason.

POST /payments/{payment_id}/cancel_post_capture

cURL

Cancel post-capture (cURL)
curl --request POST \
  --url https://sandbox.hyperswitch.io/payments/{payment_id}/cancel_post_capture \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "cancellation_reason": "requested_by_customer"
}
'

Authorizations

Path parameters

  • payment_id (string, required) — The identifier for the payment.

Body (application/json)

Request to cancel a payment when the payment is already captured.

  • cancellation_reason (string | null) — The reason for the payment cancel.

Example body:

Responses

  • 200 — Payment canceled post capture

Error example (400)

  • Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/payments/payments--cancel-post-capture.mdx

  • Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/payments/payments--cancel-post-capture

Related:

  • Payments - Cancel: https://api-reference.hyperswitch.io/v1/payments/payments--cancel

  • Payments - Capture: https://api-reference.hyperswitch.io/v1/payments/payments--capture