---
title: "Void a payment"
method: POST
path: "/payments/{id}/voids"
tags: ["Payments"]
---

# Void a payment

`POST /payments/{id}/voids`

## Request

- Base URL: `https://{prefix}.api.sandbox.checkout.com`
- URL: `https://{prefix}.api.sandbox.checkout.com/payments/{id}/voids`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `string` scopes: `gateway`, `gateway:payment-voids`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/checkout/apis/checkout-com-api-reference/docs/payments/:id/voids/post.ts> (a function with typed inputs; its response is checked against the schema)

Voids a payment if supported by the payment method.

For card payments, void requests are processed asynchronously. You can use [workflows](#tag/Workflows) to be notified if the void is successful.

## Path parameters

- `id` string, required

## Headers

- `Cko-Idempotency-Key` string

## Request body

- VoidRequest
  - `amount` integer: The amount to void. If not specified, the full payment amount will be voided.
  - `reference` string: A reference you can later use to identify this void request.<br>For Amex, the string limit is 30 characters.
  - `metadata` object: A set of key-value pairs to attach to the authorization request. You can use this to store additional information in a structured format. The `metadata` object only supports primitive data types. Objects and arrays are not supported.

## Response `200`

Payment is already voided

- object: The response received when you attempt a repeated payment action. For example, if you attempt to refund a payment that is already refunded.
  - `action_id` string, required: The action identifier
  - `_links` object: Links related to the payment.
    - `payment` Link, required
      - `href` string, required: The link URL

## Other responses

- `202`: Void accepted
- `401`: Unauthorized
- `403`: Void not allowed
- `404`: Payment not found
- `422`: Invalid data was sent
- `502`: Bad gateway

---

[API](https://skmtc.dev/checkout/apis/checkout-com-api-reference.md) - [All operations](https://skmtc.dev/checkout/apis/checkout-com-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/checkout/apis/checkout-com-api-reference/revisions/0f1abdb1c3e9?raw)
