KashierDevelopersKashier Developers

Void an order

curl -X PUT "https://test-api.kashier.io/v3/payment/void/string" \  -H "Content-Type: application/json" \  -d '{    "apiOperation": "VOID",    "transaction": {      "amount": 3,      "targetTransactionId": "TX-1902526801"    }  }'
{  "response": {},  "transactionId": "string",  "messages": {    "en": "string",    "ar": "string"  },  "status": "string",  "provider": {    "type": "string",    "version": "string"  }}

Cancels a transaction on the order before it settles — the clean undo while the money has not actually moved yet. Use it to cancel a pay, an authorization, a capture or a refund; pass the targetTransactionId you got back from the transaction you are cancelling. Once the transaction has settled, void no longer applies and you need a refund instead.

The same operation as PUT /v3/orders/{orderId} with apiOperation: VOID. The checkout host forwards to this exact route without applying any authentication of its own, so the two are interchangeable.

Send your secret key in the Authorization header. Like refund, this requires the refund permission on the key's role.

Authorization

secretKey
Authorization<token>

Merchant secret key used to identify the merchant, obtained from Kashier's dashboard. Pass the raw secret key value in the Authorization header (NOT a "Bearer" token).

In: header

Path Parameters

orderId*string

Kashier's order id.

Request Body

application/json

The same body the checkout host forwards for a void.

TypeScript Definitions

Use the request body type in TypeScript.

Void (cancel) a transaction of the order, fully or partially.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

PUT
/v3/payment/void/{orderId}