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.

This call takes your secret key, not a hash

Void, refund and capture authenticate with the Authorization secret key — the same credential the Dashboard API uses — and a void additionally needs the refund permission on that key's role. That differs from the pay call on the same host: creating a payment (POST /v3/orders) is gated by a Kashier-Hash header and takes no secret key. Kashier publishes no Kashier-Hash string-to-sign for PUT /v3/orders/:orderId, so there is nothing to compute here. Sending the header anyway is what some older integrations do and we have no report of it being rejected, but that is unconfirmed — if an update ever fails with INVALID_HASH_CHECK, raise it with Kashier support.

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-1902526801"
          }
  }'

Body structure

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

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.

The window is enforced only on PAY and CAPTURE targets. Voiding an authorize transaction — which is how you release an unused hold — is not subject to it. See authorize and capture.

On this page