KashierDevelopersKashier Developers
Accept payments

Void

Cancel a transaction amount fully or partially

The amount of the order's transaction is either canceled fully or partially, where you can cancel either a pay, refund, authorize, or capture operation.

Void and refund share one endpoint

Void and refund are the same endpoint — PUT /v3/orders/:orderId. Only apiOperation differs: send VOID to cancel, REFUND to refund.

Getting started

This is done by sending a PUT request with your order ID orderId in the URL as a parameter, and inserting a transactionId.

Headers

KeyDescription
AuthorizationThe Authorization is a secret key that is used to identify the merchant. You can obtain it from Kashier's dashboard. Learn more about Authorization.

Authentication

Send your Authorization secret key. The key needs the Transactions: Write permission.

curl -X 'PUT' 'https://test-fep.kashier.io/v3/orders/:orderId'
  -H 'Authorization: your_secretKey'
  -H 'accept: application/json'
  -H 'Content-Type: application/json'
  -d '{
      "apiOperation": "VOID",
      "transaction":{
              "amount": 3,
              "targetTransactionId":"TX-XXXXXXXXXX"
          }
  }'

Body structure

{
  "apiOperation": "VOID",
  "transaction":{
      "amount": 3,
      "targetTransactionId":"TX-XXXXXXXXXX"
  }
}

transaction.amount and transaction.targetTransactionId are optional. Omit the whole transaction object for a full void of the pay transaction; send targetTransactionId to void a specific prior transaction, and amount for a partial void.

Full parameter and response reference → Refund, void, or capture an order.

The same-day void window

Voiding a pay or capture transaction only works inside a same-day window. Past it Kashier rejects the void, and refund is the operation you need instead. In short:

  • Undoing a payment today — use VOID.
  • Undoing a payment from an earlier day — use REFUND.

This is the most common reason a void that worked in testing fails in production: the merchant is voiding yesterday's capture. There is no way to widen the window — reach for a refund.

To release an unused hold, see authorize and capture.

On this page