Trading
POST /v1/orders/:id/cancel — Cancel an Undelivered Order
Cancel an order nobody has shipped yet and get the money back on your balance. Opens 31 minutes after purchase for manual delivery, 15 minutes otherwise.
POST
/
orders
/
{id}
/
cancel
Cancel an undelivered order
curl --request POST \
--url https://csboard.com/v1/orders/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://csboard.com/v1/orders/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://csboard.com/v1/orders/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://csboard.com/v1/orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://csboard.com/v1/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://csboard.com/v1/orders/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"order_id": "ord_01J9Z3K8Q2",
"cancelled": true,
"refunded": true
}
Some orders are delivered by hand: a person (or a slow desk) sends the Steam trade, and that can take up to 12 hours. Such an order shows
delivery_type: "manual" in GET /v1/orders and GET /v1/orders/{id}, and it may sit in delivering with no trade offer for a long time. delivery_deadline_at tells you when the seller’s time runs out. If the seller misses it, the order is cancelled and refunded automatically.
If you no longer want to wait, cancel the order yourself. No request body. Cancel is open for:
- A manual-delivery order whose seller has sent nothing 31 minutes after purchase.
- A held order before its unban, where the source allows it.
- Any other order still undelivered 15 minutes after purchase, with no trade offer and nothing in flight upstream.
delivery_deadline_at.
Recommended flow
- Place a buy with
POST /v1/ordersorPOST /v1/market/buy. - Poll
GET /v1/orders/{id}(or listen for theorder.updatedwebhook). Readdelivery_typeanddelivery_deadline_at. - If a
manualorder still has no trade offer and you no longer want it,POST /v1/orders/{id}/cancelonce 31 minutes have passed. - On
425 too_early, retry afterretry_after_sec. On200, the money is back on your balance. On202, it lands within minutes, with the order’s next update.
Responses at a glance
| Status | Meaning |
|---|---|
200 refunded: true | Cancelled and refunded to your balance. An already cancelled order returns the same answer. |
202 refunded: false | Cancel placed. The refund lands within minutes, with the order’s next update (webhook or GET /v1/orders/{id}). |
425 too_early | Cancel is not open yet (31 min for manual delivery, 15 min otherwise). Retry after the returned retry_after_sec. |
409 offer_sent | The Steam trade offer is already out. Accept or decline it in Steam. |
409 in_progress | Delivery or a cancel is already running. If delivery fails, the order is refunded automatically. |
409 not_cancellable | The order can no longer be cancelled: delivered, finished, a P2P lot, or not eligible. |
429 cancel_limit_reached | Too many cancels for now. Try again later. |
503 cancel_unavailable | We could not check the order upstream right now. Nothing was changed; retry shortly. |
404 order_not_found | No such order on this account. |
Cancel is idempotent: calling it again on a cancelled order returns the same
200, never a second refund. Retrying after a network timeout or a 503 is safe.Authorizations
Send your key as a Bearer token on every request: Authorization: Bearer csb_pub_.... Generate keys in your CSBoard profile.
Path Parameters
CSBoard order id of the order to cancel.
Response
Cancelled and refunded to your balance. Also the answer for an order that was already cancelled.
⌘I
Cancel an undelivered order
curl --request POST \
--url https://csboard.com/v1/orders/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://csboard.com/v1/orders/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://csboard.com/v1/orders/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://csboard.com/v1/orders/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://csboard.com/v1/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://csboard.com/v1/orders/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"order_id": "ord_01J9Z3K8Q2",
"cancelled": true,
"refunded": true
}