Bitcall logoBitcall API
Add your Key ID and Secret to send test requests.

Cancel an order

POST
/v1/otp/cancel
*object

Releases a number before its code arrives and refunds the rental where the order is still cancellable. Repeating the call is safe. This operation is safe to repeat: repeating it returns the existing state and performs no further action.

Authorization

KeyId ApiSecret
x-key-id<token>

Your API key id.

In: header

x-api-secret<token>

Your API key secret.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/otp/cancel" \  -H "Content-Type: application/json" \  -d '{    "order_id": "ord_4bU09XIfH3288i45YgDtYhG__8iunOjWazOpXG7lzg"  }'
{
  "data": {
    "orderId": "string",
    "status": "waiting",
    "actions": {
      "canResend": true,
      "canReactivate": true,
      "canRefund": true
    },
    "serviceId": "string",
    "service": "string",
    "countryCode": "string",
    "phoneNumber": "string",
    "price": {
      "amount": 0,
      "currency": "string"
    },
    "code": "string",
    "expiresAt": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "resend": {
      "cooldownSeconds": 0,
      "price": {
        "amount": 0,
        "currency": "string"
      }
    }
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The request is not valid. See `fields` for what to correct.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "AUTHENTICATION_REQUIRED",
    "message": "This endpoint requires an API key.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "No such resource.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "message": "The resource is not in a state that allows this operation.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests. Retry after the interval in `Retry-After`.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Something went wrong on our side.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "SERVICE_RESPONSE_INVALID",
    "message": "The upstream service returned an unexpected response.",
    "requestId": "9f1c7b2e-…"
  }
}
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "The service is temporarily unavailable. Try again shortly.",
    "requestId": "9f1c7b2e-…"
  }
}