---
title: "Cancel an order and refund it"
method: POST
path: "/api/v1/orders/{id}/cancel"
tags: ["Orders"]
---

# Cancel an order and refund it

`POST /api/v1/orders/{id}/cancel`

## Request

- Base URL: `https://virtualsms.io`
- URL: `https://virtualsms.io/api/v1/orders/{id}/cancel`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`

Refunds the full price to your balance. Only valid while the order is
still cancellable — an order that already received a code is not.

Also served as `POST /api/v1/order/{id}/cancel`.

## Path parameters

- `id` string, uuid, required

## Response `200`

Cancelled and refunded

- object
  - `success` boolean
  - `order_id` string, uuid
  - `status` string
  - `refunded` number, float

## Other responses

- `400`: This order cannot be cancelled in its current state
- `404`: Order not found, or not yours

---

[API](https://skmtc.dev/virtualsms/apis/virtualsms-account-verification-platform-for-developers-and.md) · [All operations](https://skmtc.dev/virtualsms/apis/virtualsms-account-verification-platform-for-developers-and/llms.txt) · [OpenAPI document](https://skmtc.dev/virtualsms/apis/virtualsms-account-verification-platform-for-developers-and/revisions/be89af981be1?raw)
