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

# Cancel Charge \[EXPERIMENTAL\]

`POST /pos/charges/{chargeKey}/cancel`

## Request

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

> **Notice:** This endpoint has different server URLs and authorization method than the rest of the API.
Cancel a previously created POS charge by reversing its authorization.

The cancel operation:

1. Attempts to cancel the clearing of the referenced charge
2. If clearing cannot be canceled (already submitted), returns HTTP 409
3. If clearing is canceled successfully, performs a reversal of the authorization

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

## 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

- CancelRequest
  - `reference` string: Action reference assigned by the agent. Must not start with "act-". This allows merchants to track actions with their own reference system.

## Response `201`

The reversal action representing the cancellation

- SchemasReversalAction: A reversal action represents a cancellation of a charge's authorization.
  - `key` string, required: Uniquely identifies an action
  - `chargeKey` string, required: Uniquely identifies a charge.
  - `type` 'reversal', required: The type of action (always "reversal" for cancel operations)
  - `reference` string: Action reference assigned by the agent. Must not start with "act-". This allows merchants to track actions with their own reference system.
  - `status` object, required
    - `authorization` 'approved' | 'declined', required: Authorization status of the reversal
  - `replacementAmount` SchemasResponseAmount, required: The amount encoded as an object with a `value` in minor units and a `currency` code. An optional `breakdown` can be provided to indicate specific sub-amounts.
    - `value` integer, required: An amount in minor units. For example `$12.34` should be encoded as `1234`.
    - `currency` 'AED' | 'AFN' | 'ALL' | 'AMD' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | '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.
    - `breakdown` SchemasResponseAmountBreakdown: A breakdown of the transaction `value`. All provided amounts must exactly add up to `value`. Providing a breakdown is only required if any other amounts besides the `baseAmount` are included.
      - `baseAmount` integer, required: An amount in minor units. For example `$12.34` should be encoded as `1234`.
      - `cashback` integer: An amount in minor units. For example `$12.34` should be encoded as `1234`.
      - `gratuity` integer: An amount in minor units. For example `$12.34` should be encoded as `1234`.
  - `authorizationResponse` union, required: Network-specific details from the authorization response. This is a discriminated union based on the network property.
    - AuthorizationIsoFieldsAmericanExpressWithDiscriminator
      - `network` 'american-express', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - SchemasAuthorizationIsoFieldsBancontactWithDiscriminator: Object containing the raw values from the ISO8583 response message received from the network.
      - `network` 'bancontact', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - AuthorizationIsoFieldsDiscoverWithDiscriminator
      - `network` 'discover', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - AuthorizationIsoFieldsMastercardWithDiscriminator
      - `network` 'mastercard', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - AuthorizationIsoFieldsVisaWithDiscriminator
      - `network` 'visa', required
      - `responseCode` string, required: Contents of field 39
      - `responseCodeDescription` string, required: The description of the `responseCode`
    - AuthorizationIsoFieldsUnknown
      - `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`: Bad Request
- `401`: Authentication information is missing or invalid
- `403`: The authenticated client is forbidden to make the request for the resource identified.
- `404`: Charge not found
- `409`: Conflict - charge already canceled, clearing already submitted, or other 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)
