Public developer API
POST /v1/virtual-numbers/orders/:reference/cancel
Cancels an active number and refunds only after provider cancellation is confirmed and no SMS has arrived.
Access
A project-specific API key (Authorization: Bearer dapi_live_...) and its Business ID (X-Business-Id). Rate limited per business (120 calls a minute by default).
Requires an Idempotency-Key header.
Send an Idempotency-Key header. A 202 response means the refund needs reconciliation; do not retry with a new key.
Example request
curl --request POST \
--url 'https://production.dutchapi.co/v1/virtual-numbers/orders/:reference/cancel' \
--header 'X-Business-Id: YOUR_BUSINESS_ID' \
--header 'Authorization: Bearer bsk_live_YOUR_BUSINESS_SECRET' \
--header 'Idempotency-Key: virtual-numbers-0001' \
--header 'Content-Type: application/json' \
--data '{}'
Response 200
{
"data": {
"transactionId": "vnm_8f2c1a",
"status": "refunded"
}
}
Errors
| Status | error | Meaning |
|---|---|---|
| 403 | insufficient_scope | This project key is not allowed to do that. |
| 400 | idempotency_key_required | Send an Idempotency-Key header. |
| 409 | virtual_number_order_not_cancellable | This number order cannot be cancelled. |
| 409 | virtual_number_sms_received | An SMS has arrived; the order cannot be refunded. |
| 502 | virtual_number_cancel_unconfirmed | The provider did not confirm cancellation. |