---
title: "Cancel Charge"
method: POST
path: "/charges/{chargeKey}/cancel"
tags: ["Charge Actions"]
---

# Cancel Charge

`POST /charges/{chargeKey}/cancel`

## Request

- Base URL: `https://eu-west-1.api.silverflow.com/v1`
- URL: `https://eu-west-1.api.silverflow.com/v1/charges/{chargeKey}/cancel`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/silverflow/apis/silverflow-api/docs/charges/:chargeKey/cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

This operation:
1. Tries to cancel the clearing of the referenced charge. If this is not possible due to the clearing already being submitted, this endpoint will return an HTTP 409 error.
2. If clearing has been cancelled, performs a reversal of the charge. This means that the authorization will be reversed.

This operation is only possible for charges with `clearingMode` set to `auto`.

Diners and ATM Charge support is <a class="experimental-tag-link" href="https://docs.silverflow.com/guides/api-lifecycle#tag/EXPERIMENTAL-Tag"><span class="tag experimental-tag">EXPERIMENTAL</span></a>.

Requires one of the following permissions:
* `charges:Cancel`
* `charges:CancelOrRefund`

## Path parameters

- `chargeKey` string, required: Uniquely identifies a charge.

## Headers

- `Idempotency-Key` string: This key is used to deduplicate requests that are retried. For more information see the section on [Idempotency](https://docs.silverflow.com/guides/idempotency).

## Request body

- ChargeCancel: Request to cancel the referenced charge.
  - `reference` string: Action reference assigned by the agent. Must not start with "act-".

## Response `201`

The resulting reversal action.

- ReversalAction: Action for reversing a charge
  - `type` 'reversal', required
  - `key` string, required: Uniquely identifies an action
  - `chargeKey` string, required: Uniquely identifies a charge.
  - `reference` string: Action reference assigned by the agent. Must not start with "act-".
  - `replacementAmount` CommonAmount, required: The amount encoded as an object with a `value` in minor units and a `currency` code.
    - `value` integer, required: The amount in minor units. For example `$12.34` should be encoded as `1234`. Note that not all currencies have 2 minor units. Some have three or zero.
    - `currency` 'AED' | 'AFN' | 'ALL' | 'AMD' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XCG' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL', required: An alphabetic ISO-4217 currency code.
  - `status` object, required
    - `authorization` 'approved' | 'declined', required
  - `authorizationResponse` union, required: Network-specific details from the authorization response. Actions created before 2023-10-07 will have the `network` property and other remaining properties as `unknown`.
    - object
      - `network` 'american-express', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'bancontact', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'diners', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'discover', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'mastercard', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'unionpay', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'visa', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - object
      - `network` 'unknown', required
      - `responseCode` 'unknown', required
      - `responseCodeDescription` 'unknown', required
  - `created` string, iso-8601-date-time, required: The date and time this object was created
  - `lastModified` string, iso-8601-date-time: The date and time this object was last modified
  - `version` integer, required: The version of this object

## Other responses

- `400`: The request body was malformed
- `401`: Authentication information is missing or invalid
- `403`: The authenticated client is forbidden to make the request for the resource identified.
- `404`: The requested resource was not found
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/silverflow/apis/silverflow-api.md) - [All operations](https://skmtc.dev/silverflow/apis/silverflow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/silverflow/apis/silverflow-api/revisions/43ecbe4fd6ea?raw)
