Cancel Payout
Deprecated — Do Not Use
This endpoint is deprecated and will be removed in a future release. It is no longer maintained and may produce unexpected behavior.
Use Payout Intents instead.
Cancel a payout that is still in initiated status. The blocked wallet amount is released back to the merchant.
POST
https://api.zenpays.com/payment/api/v1/payouts/{payoutId}/cancelBearer · API key
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
payoutId REQUIRED | string | Payout ID to cancel |
Headers
| Header | Description |
|---|---|
Authorization REQUIRED | Bearer {api_key} |
X-Signature REQUIRED | HMAC-SHA256 signature |
X-Timestamp REQUIRED | ISO 8601 timestamp |
X-Secret-Salt REQUIRED | Secret salt for HMAC validation |
Content-Type REQUIRED | application/json |
Body Parameters
| Parameter | Type | Description |
|---|---|---|
reason OPTIONAL | string | Reason for cancellation |
Response
Success (200 OK)
{
"success": true,
"data": {
"payoutId": "payout_xxxxx",
"status": "cancelled",
"failureReason": "No longer needed",
"amount": 10000,
"currency": "INR"
},
"message": "Payout cancelled successfully"
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| PAYOUT_CANCEL_FAILED | 400 | Payout is not in initiated status |
| PAYOUT_NOT_FOUND | 404 | Payout doesn't exist |
| UNAUTHORIZED | 401 | Invalid API key |
Examples
- cURL
- SDK
curl -X POST "https://api.zenpays.com/payment/api/v1/payouts/payout_xxxxx/cancel" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-d '{"reason": "No longer needed"}'
const cancelled = await zenpays.payouts.cancel('payout_xxxxx', 'No longer needed')
console.log(cancelled.status) // 'cancelled'