---
title: "Cancel an order"
method: POST
path: "/api/v1/customer/cancel/{orderId}"
tags: ["Customer API"]
---

# Cancel an order

`POST /api/v1/customer/cancel/{orderId}`

## Request

- Base URL: `https://virtualsms.io`
- URL: `https://virtualsms.io/api/v1/customer/cancel/{orderId}`
- Auth: API key in header `X-API-Key`

Cancel a pending order and receive a full refund.

**2-minute hold:** Orders cannot be cancelled within the first 2 minutes of purchase.
This is to prevent abuse. If you try to cancel too early, you'll get a 425 response
telling you how many seconds to wait.

Cancellation is only possible while the order is in `waiting` status (no SMS received).

## Path parameters

- `orderId` string, uuid, required

## Response `200`

Order cancelled and refunded

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

## Other responses

- `401`: Invalid or missing API key
- `404`: Order not found
- `425`: Too early to cancel - 2-minute hold period active

---

[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)
