---
title: "Manually Clear Charge"
method: POST
path: "/charges/{chargeKey}/clear"
tags: ["Charge Actions"]
---

# Manually Clear Charge

`POST /charges/{chargeKey}/clear`

## Request

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

Manually clear the charge after its creation. This endpoint also allows for (multiple) partial
clearing, by providing an amount that is different from the original amount. 

Please note that there are currently no restrictions on the amount or the number of times you
can clear a charge; this is the responsibility of the client.

This endpoint supports clearing charges for up to 6 months after their creation. When trying to clear a charge older than that, it will return an HTTP 409 error with type `/silverflow/problems/charge/too-old`.

Requires `charges:Clear` permission.

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

- ManualClearing
  - `amount` integer: The amount to clear. If omitted, the full amount of the charge will be cleared. The amount should be 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.
  - `closeCharge` boolean: Indicates if the series of clearings for this transaction ends after the current clearing. Only relevant when doing partial clearing.
  - `clearAfter` string, iso-8601-date-time: If provided, clearing will not occur before this point in time. If no timezone is included, it is assumed to be UTC. The value may be at most 6 months in the future from when the charge was created.
  - `reference` string: Action reference assigned by the agent. Must not start with "act-".
  - `enhancedData` EnhancedDataInput: An optional object for submitting Level 2 (tax and order references) and Level 3 (granular line-item details) payment data. Providing this data can qualify transactions for reduced interchange rates. <span class="tag network-tag visa-tag">VISA</span> <span class="tag network-tag mastercard-tag">MASTERCARD</span> <a class="experimental-tag-link" href="https://docs.silverflow.com/guides/api-lifecycle#tag/EXPERIMENTAL-Tag"><span class="tag experimental-tag">EXPERIMENTAL</span></a>
    - `taxAmount` integer, required: Total amount of Sales Tax or Value Added Tax (VAT) collected in minor units. Enter 0 if no tax is collected.
    - `customerCode` string: A code used to identify the customer or consumer.
    - `customerTaxId` string: Customer's tax registration or VAT number.
    - `destinationAddress` EnhancedDataDestinationAddressInput: Must be provided if shipment is involved and captured on the invoice
      - `countryCode` union
        - ComponentsSchemasCountryCodeAlpha3
          - `alpha3` string, required
        - ComponentsSchemasCountryCodeAlpha2
          - `alpha2` string, required
        - ComponentsSchemasCountryCodeNumeric
          - `numeric` string, required
      - `postalCode` string: The postal code of the address, allowing a single separating space.
    - `discountAmount` integer: Total amount of discount at invoice level in minor units. Excludes any discount amounts defined at line item level.
    - `invoiceNumber` string: Invoice number for the transaction.
    - `orderDate` string, date: Date the order was placed.
    - `purchaseOrderNumber` string: Purchase order number for the transaction.
    - `shippingAddress` EnhancedDataShippingAddress: Must be provided if shipment is involved and captured on the invoice
      - `postalCode` string: The postal code of the address, allowing a single separating space.
    - `timeOfPurchase` string: Local transaction time in HHMM format.
    - `lineItems` EnhancedDataLineItem[]: Array of line items.
      - `commodityCode` string, required: Commodity classification code (e.g. UNSPSC, NAICS). Required for Visa Fleet transactions.
      - `description` string, required: Product or service description.
      - `discountAmount` integer, required: Discount applied to this line item in minor currency units.
      - `productCode` string, required: Product code for the item.
      - `quantity` integer, required: Quantity of items purchased. Includes 4 implied decimal places (e.g. 1.23 kg = 12300)
      - `unitOfMeasure` string, required: The unit of measurement for an item.
      - `unitPrice` integer, required: Price per unit. Includes 4 implied decimal places (e.g. 1.23$ = 12300).
      - `taxAmount` integer, required: Tax amount for the line item in minor currency units.
      - `taxRate` integer, required: Tax rate percentage for the line item. Includes 2 implied decimal places (e.g. 1.23% = 123)
      - `totalAmount` integer, required: Total amount for the line item in minor currency units.

## Response `201`

The resulting clearing action.

- ClearingAction: Action for clearing a charge
  - `type` 'clearing', 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-".
  - `amount` object, 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.
  - `enhancedData` EnhancedData: An optional object for submitting Level 2 (tax and order references) and Level 3 (granular line-item details) payment data. Providing this data can qualify transactions for reduced interchange rates. <span class="tag network-tag visa-tag">VISA</span> <span class="tag network-tag mastercard-tag">MASTERCARD</span> <a class="experimental-tag-link" href="https://docs.silverflow.com/guides/api-lifecycle#tag/EXPERIMENTAL-Tag"><span class="tag experimental-tag">EXPERIMENTAL</span></a>
    - `taxAmount` integer, required: Total amount of Sales Tax or Value Added Tax (VAT) collected in minor units. It is set to 0 if no tax is collected.
    - `customerCode` string: A code used to identify the customer or consumer.
    - `customerTaxId` string: Customer's tax registration or VAT number.
    - `destinationAddress` EnhancedDataDestinationAddress: Must be provided if shipment is involved and captured on the invoice
      - `countryCode` object: Destination country code.
        - `alpha3` string, required
        - `alpha2` string, required
        - `numeric` string, required
      - `postalCode` string: The postal code of the address, allowing a single separating space.
    - `discountAmount` integer: Total amount of discount at invoice level in minor units. Excludes any discount amounts defined at line item level.
    - `invoiceNumber` string: Invoice number for the transaction.
    - `orderDate` string, date: Date the order was placed.
    - `purchaseOrderNumber` string: Purchase order number for the transaction.
    - `shippingAddress` EnhancedDataShippingAddress: Must be provided if shipment is involved and captured on the invoice
      - `postalCode` string: The postal code of the address, allowing a single separating space.
    - `timeOfPurchase` string: Local transaction time in HHMM format.
    - `lineItems` EnhancedDataLineItem[]: Array of line items.
      - `commodityCode` string, required: Commodity classification code (e.g. UNSPSC, NAICS). Required for Visa Fleet transactions.
      - `description` string, required: Product or service description.
      - `discountAmount` integer, required: Discount applied to this line item in minor currency units.
      - `productCode` string, required: Product code for the item.
      - `quantity` integer, required: Quantity of items purchased. Includes 4 implied decimal places (e.g. 1.23 kg = 12300)
      - `unitOfMeasure` string, required: The unit of measurement for an item.
      - `unitPrice` integer, required: Price per unit. Includes 4 implied decimal places (e.g. 1.23$ = 12300).
      - `taxAmount` integer, required: Tax amount for the line item in minor currency units.
      - `taxRate` integer, required: Tax rate percentage for the line item. Includes 2 implied decimal places (e.g. 1.23% = 123)
      - `totalAmount` integer, required: Total amount for the line item in minor currency units.
  - `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)
