Api reference
Create a void
Void a payment that has not yet settled. Voids are always for the full amount. If the payment has already settled, use a refund instead.
Related endpoints
GET /voids— List voidsGET /voids/{id}— Get void by ID
Common errors
400 invalid_request— malformed payload or failed validation.401 unauthenticated— missing, malformed, or revoked API key.
Idempotency
Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.
x-api-key<token>
Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.revkeen.com/v2/voids" \ -H "x-api-key: $REVKEEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "payment_id": "660e8400-e29b-41d4-a716-446655440000", "reason": "Customer requested cancellation before shipment", "reason_code": "customer_request" }'{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"public_id": "void_abc123xyz",
"payment_id": "660e8400-e29b-41d4-a716-446655440000",
"parent_transaction_id": "660e8400-e29b-41d4-a716-446655440000",
"order_id": null,
"gateway": "string",
"gateway_void_id": "txn_void_12345",
"amount_minor": 10000,
"currency": "USD",
"reason": "Customer requested cancellation",
"reason_code": "customer_request",
"status": "succeeded",
"failure_reason": null,
"failure_code": null,
"voided_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-14T08:00:00Z"
}
}Empty
Empty
Empty