POST/v1/sms/orders/:id/cancel
Cancel an order
Cancels a pending order before a code arrives and refunds it in full.
Required scope:
sms.purchaseRate limit: 10 rpsParameters
idstringrequiredThe order ID.
Code samples
curl -X POST "https://samaprime.com/api/v1/sms/orders/smsord_01J8X9AABBCCDD/cancel" \ -H "Authorization: Bearer sk_test_..." \ -H "Content-Type: application/json"Response
→ 200{ "data": { "id": "ord_01J8X9AABBCCDD", "status": "cancelled", "refunded_usd": "0.8000" }, "meta": { "request_id": "req_abc123", "timestamp": "2026-08-06T12:00:00Z" }}Errors
| Status | Code |
|---|---|
| 404 | not_foundNo order with this ID belongs to this user. |
| 409 | already_finalizedThe order already has a code, or is already in a terminal state. |