POST
/
payments
/
{payment_id}
/
cancel
curl --request POST \
  --url https://sandbox.hyperswitch.io/payments/{payment_id}/cancel \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "cancellation_reason": "requested_by_customer"
}'

Authorizations

api-key
string
headerrequired

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Path Parameters

payment_id
string
required

The identifier for payment

Body

application/json
cancellation_reason
string | null

The reason for the payment cancel

merchant_connector_details
object