Draft orders
Draft orders. Every example sets SOOQUNA_TOKEN from the environment; see authentication. Responses are from a test store, cut to two items per list.
| Endpoint | Method | Path |
|---|---|---|
| Price a draft order without saving it | POST | /draft-orders/calculate |
| Create a draft order | POST | /draft-orders |
| List draft orders | GET | /draft-orders |
| Get a draft order | GET | /draft-orders/{id} |
| Update a draft order | PUT | /draft-orders/{id} |
| Turn a draft into an order | POST | /draft-orders/{id}/complete |
| Delete a draft order | DELETE | /draft-orders/{id} |
Price a draft order without saving it
Section titled “Price a draft order without saving it”POST /draft-orders/calculate · Scope: write_draft_orders
curl -X POST "https://api.sooquna.com/admin/api/2026-10/draft-orders/calculate" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders/calculate", { method: "POST", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"} }),});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import osimport requests
res = requests.post( "https://api.sooquna.com/admin/api/2026-10/draft-orders/calculate", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], }, json={ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1, }, ], "shipping": {"title": "Doha delivery", "price": "15.00"}, },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders/calculate');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => json_encode([ 'customer_id' => '0193a1b2-c3d4-7e5f-8a6b-000000000007', 'lines' => [ [ 'variant_id' => '0193a1b2-c3d4-7e5f-8a6b-000000000014', 'quantity' => 1, ], ], 'shipping' => ['title' => 'Doha delivery', 'price' => '15.00'], ], JSON_UNESCAPED_UNICODE),]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os" "strings")
func main() { body := `{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}}` req, err := http.NewRequest("POST", "https://api.sooquna.com/admin/api/2026-10/draft-orders/calculate", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Post, "https://api.sooquna.com/admin/api/2026-10/draft-orders/calculate");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Content = new StringContent("""{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}}""", Encoding.UTF8, "application/json");var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Response 200
{ "billing_address": null, "completed_at": null, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "name": "Noora Al-Kuwari", "orders_count": 0, "phone": "+97455123456" }, "discount": null, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000018", "item_count": 1, "lines": [ { "available": 5, "custom": false, "discount": null, "discount_amount": "0.00", "image": "", "missing": false, "price": "450.00", "product_id": "0193a1b2-c3d4-7e5f-8a6b-000000000005", "quantity": 1, "requires_shipping": true, "sku": "ABY-LIN-M", "taxable": true, "title": "Embroidered linen abaya", "total": "450.00", "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "variant_title": "M" } ], "name": "#D0", "note": "", "order_discount": "0.00", "order_id": null, "order_name": "", "phone": "+97455123456", "shipping": {"price": "15.00", "title": "Doha delivery"}, "shipping_address": null, "shipping_total": "15.00", "status": "open", "subtotal": "450.00", "tags": [], "tax": "0.00", "tax_exempt": false, "tax_lines": [], "taxes_included": true, "total": "465.00", "updated_at": "2026-10-18T09:30:00Z", "version": 0}Create a draft order
Section titled “Create a draft order”POST /draft-orders · Scope: write_draft_orders · Needs an Idempotency-Key header
curl -X POST "https://api.sooquna.com/admin/api/2026-10/draft-orders" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "email": "[email protected]", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 2 }, { "custom": { "title": "Gift wrapping", "price": "20.00", "taxable": false, "requires_shipping": false }, "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "shipping_address": { "first_name": "Noora", "last_name": "Al-Kuwari", "address1": "Zone 66, Street 801, Building 12", "city": "Doha", "country_code": "QA", "phone": "+97455123456" }, "note": "Phone order", "tags": ["phone"]}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders", { method: "POST", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 2 }, { "custom": { "title": "Gift wrapping", "price": "20.00", "taxable": false, "requires_shipping": false }, "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "shipping_address": { "first_name": "Noora", "last_name": "Al-Kuwari", "address1": "Zone 66, Street 801, Building 12", "city": "Doha", "country_code": "QA", "phone": "+97455123456" }, "note": "Phone order", "tags": ["phone"] }),});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import os, uuidimport requests
res = requests.post( "https://api.sooquna.com/admin/api/2026-10/draft-orders", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], "Idempotency-Key": str(uuid.uuid4()), }, json={ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 2, }, { "custom": { "title": "Gift wrapping", "price": "20.00", "taxable": False, "requires_shipping": False, }, "quantity": 1, }, ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "shipping_address": { "first_name": "Noora", "last_name": "Al-Kuwari", "address1": "Zone 66, Street 801, Building 12", "city": "Doha", "country_code": "QA", "phone": "+97455123456", }, "note": "Phone order", "tags": ["phone"], },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), 'Idempotency-Key: ' . bin2hex(random_bytes(16)), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => json_encode([ 'customer_id' => '0193a1b2-c3d4-7e5f-8a6b-000000000007', 'lines' => [ [ 'variant_id' => '0193a1b2-c3d4-7e5f-8a6b-000000000014', 'quantity' => 2, ], [ 'custom' => [ 'title' => 'Gift wrapping', 'price' => '20.00', 'taxable' => false, 'requires_shipping' => false, ], 'quantity' => 1, ], ], 'shipping' => ['title' => 'Doha delivery', 'price' => '15.00'], 'shipping_address' => [ 'first_name' => 'Noora', 'last_name' => 'Al-Kuwari', 'address1' => 'Zone 66, Street 801, Building 12', 'city' => 'Doha', 'country_code' => 'QA', 'phone' => '+97455123456', ], 'note' => 'Phone order', 'tags' => ['phone'], ], JSON_UNESCAPED_UNICODE),]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os" "strings"
"github.com/google/uuid")
func main() { body := `{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "email": "[email protected]", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 2 }, { "custom": { "title": "Gift wrapping", "price": "20.00", "taxable": false, "requires_shipping": false }, "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "shipping_address": { "first_name": "Noora", "last_name": "Al-Kuwari", "address1": "Zone 66, Street 801, Building 12", "city": "Doha", "country_code": "QA", "phone": "+97455123456" }, "note": "Phone order", "tags": ["phone"]}` req, err := http.NewRequest("POST", "https://api.sooquna.com/admin/api/2026-10/draft-orders", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) req.Header.Set("Idempotency-Key", uuid.NewString()) req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Post, "https://api.sooquna.com/admin/api/2026-10/draft-orders");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());req.Content = new StringContent("""{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "email": "[email protected]", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 2 }, { "custom": { "title": "Gift wrapping", "price": "20.00", "taxable": false, "requires_shipping": false }, "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "shipping_address": { "first_name": "Noora", "last_name": "Al-Kuwari", "address1": "Zone 66, Street 801, Building 12", "city": "Doha", "country_code": "QA", "phone": "+97455123456" }, "note": "Phone order", "tags": ["phone"]}""", Encoding.UTF8, "application/json");var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Response 201
{ "billing_address": null, "completed_at": null, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "name": "Noora Al-Kuwari", "orders_count": 0, "phone": "+97455123456" }, "discount": null, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000013", "item_count": 3, "lines": [ { "available": 5, "custom": false, "discount": null, "discount_amount": "0.00", "image": "", "missing": false, "price": "450.00", "product_id": "0193a1b2-c3d4-7e5f-8a6b-000000000005", "quantity": 2, "requires_shipping": true, "sku": "ABY-LIN-M", "taxable": true, "title": "Embroidered linen abaya", "total": "900.00", "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "variant_title": "M" }, { "available": null, "custom": true, "discount": null, "discount_amount": "0.00", "image": "", "missing": false, "price": "20.00", "product_id": null, "quantity": 1, "requires_shipping": false, "sku": "", "taxable": false, "title": "Gift wrapping", "total": "20.00", "variant_id": null, "variant_title": "" } ], "name": "#D1", "note": "Phone order", "order_discount": "0.00", "order_id": null, "order_name": "", "phone": "+97455123456", "shipping": {"price": "15.00", "title": "Doha delivery"}, "shipping_address": { "address1": "Zone 66, Street 801, Building 12", "address2": "", "city": "Doha", "company": "", "country_code": "QA", "extra": null, "first_name": "Noora", "last_name": "Al-Kuwari", "latitude": null, "longitude": null, "phone": "+97455123456", "province_code": "", "zip": "" }, "shipping_total": "15.00", "status": "open", "subtotal": "920.00", "tags": ["phone"], "tax": "0.00", "tax_exempt": false, "tax_lines": [], "taxes_included": true, "total": "935.00", "updated_at": "2026-10-18T09:30:00Z", "version": 1}List draft orders
Section titled “List draft orders”GET /draft-orders · Scope: read_draft_orders
| Parameter | In | Description |
|---|---|---|
status |
query | For example open. |
limit |
query | For example 10. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/draft-orders?status=open&limit=10" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders?status=open&limit=10", { method: "GET", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, },});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import osimport requests
res = requests.get( "https://api.sooquna.com/admin/api/2026-10/draft-orders?status=open&limit=10", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders?status=open&limit=10');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), ], CURLOPT_RETURNTRANSFER => true,]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os")
func main() { req, err := http.NewRequest("GET", "https://api.sooquna.com/admin/api/2026-10/draft-orders?status=open&limit=10", nil) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Get, "https://api.sooquna.com/admin/api/2026-10/draft-orders?status=open&limit=10");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Response 200
{ "data": [ { "currency": "QAR", "customer": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "name": "Noora Al-Kuwari", "orders_count": 0, "phone": "+97455123456" }, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000013", "item_count": 3, "name": "#D1", "order_id": null, "order_name": "", "status": "open", "total": "935.00", "updated_at": "2026-10-18T09:30:00Z" } ], "total": 1}Get a draft order
Section titled “Get a draft order”GET /draft-orders/{id} · Scope: read_draft_orders
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", { method: "GET", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, },});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import osimport requests
res = requests.get( "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), ], CURLOPT_RETURNTRANSFER => true,]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os")
func main() { req, err := http.NewRequest("GET", "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", nil) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Get, "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Response 200
{ "billing_address": null, "completed_at": null, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "name": "Noora Al-Kuwari", "orders_count": 0, "phone": "+97455123456" }, "discount": null, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000013", "item_count": 3, "lines": [ { "available": 5, "custom": false, "discount": null, "discount_amount": "0.00", "image": "", "missing": false, "price": "450.00", "product_id": "0193a1b2-c3d4-7e5f-8a6b-000000000005", "quantity": 2, "requires_shipping": true, "sku": "ABY-LIN-M", "taxable": true, "title": "Embroidered linen abaya", "total": "900.00", "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "variant_title": "M" }, { "available": null, "custom": true, "discount": null, "discount_amount": "0.00", "image": "", "missing": false, "price": "20.00", "product_id": null, "quantity": 1, "requires_shipping": false, "sku": "", "taxable": false, "title": "Gift wrapping", "total": "20.00", "variant_id": null, "variant_title": "" } ], "name": "#D1", "note": "Phone order", "order_discount": "0.00", "order_id": null, "order_name": "", "phone": "+97455123456", "shipping": {"price": "15.00", "title": "Doha delivery"}, "shipping_address": { "address1": "Zone 66, Street 801, Building 12", "address2": "", "city": "Doha", "company": "", "country_code": "QA", "extra": null, "first_name": "Noora", "last_name": "Al-Kuwari", "latitude": null, "longitude": null, "phone": "+97455123456", "province_code": "", "zip": "" }, "shipping_total": "15.00", "status": "open", "subtotal": "920.00", "tags": ["phone"], "tax": "0.00", "tax_exempt": false, "tax_lines": [], "taxes_included": true, "total": "935.00", "updated_at": "2026-10-18T09:30:00Z", "version": 1}Update a draft order
Section titled “Update a draft order”PUT /draft-orders/{id} · Scope: write_draft_orders
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X PUT "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "email": "[email protected]", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "discount": {"type": "percentage", "value": "10", "title": "Loyal customer"}, "version": 1}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", { method: "PUT", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "discount": {"type": "percentage", "value": "10", "title": "Loyal customer"}, "version": 1 }),});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import osimport requests
res = requests.put( "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], }, json={ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1, }, ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "discount": {"type": "percentage", "value": "10", "title": "Loyal customer"}, "version": 1, },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => json_encode([ 'customer_id' => '0193a1b2-c3d4-7e5f-8a6b-000000000007', 'lines' => [ [ 'variant_id' => '0193a1b2-c3d4-7e5f-8a6b-000000000014', 'quantity' => 1, ], ], 'shipping' => ['title' => 'Doha delivery', 'price' => '15.00'], 'discount' => [ 'type' => 'percentage', 'value' => '10', 'title' => 'Loyal customer', ], 'version' => 1, ], JSON_UNESCAPED_UNICODE),]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os" "strings")
func main() { body := `{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "email": "[email protected]", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "discount": {"type": "percentage", "value": "10", "title": "Loyal customer"}, "version": 1}` req, err := http.NewRequest("PUT", "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Put, "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Content = new StringContent("""{ "customer_id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "email": "[email protected]", "lines": [ { "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "quantity": 1 } ], "shipping": {"title": "Doha delivery", "price": "15.00"}, "discount": {"type": "percentage", "value": "10", "title": "Loyal customer"}, "version": 1}""", Encoding.UTF8, "application/json");var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Response 200
{ "billing_address": null, "completed_at": null, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "name": "Noora Al-Kuwari", "orders_count": 0, "phone": "+97455123456" }, "discount": {"title": "Loyal customer", "type": "percentage", "value": "10"}, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000013", "item_count": 1, "lines": [ { "available": 5, "custom": false, "discount": null, "discount_amount": "0.00", "image": "", "missing": false, "price": "450.00", "product_id": "0193a1b2-c3d4-7e5f-8a6b-000000000005", "quantity": 1, "requires_shipping": true, "sku": "ABY-LIN-M", "taxable": true, "title": "Embroidered linen abaya", "total": "450.00", "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "variant_title": "M" } ], "name": "#D1", "note": "", "order_discount": "45.00", "order_id": null, "order_name": "", "phone": "+97455123456", "shipping": {"price": "15.00", "title": "Doha delivery"}, "shipping_address": null, "shipping_total": "15.00", "status": "open", "subtotal": "450.00", "tags": [], "tax": "0.00", "tax_exempt": false, "tax_lines": [], "taxes_included": true, "total": "420.00", "updated_at": "2026-10-18T09:30:00Z", "version": 2}Turn a draft into an order
Section titled “Turn a draft into an order”POST /draft-orders/{id}/complete · Scope: write_draft_orders · Needs an Idempotency-Key header
payment_pending true creates an unpaid order (cash on delivery, bank transfer).
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X POST "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013/complete" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"payment_pending": true}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013/complete", { method: "POST", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({"payment_pending": true}),});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import os, uuidimport requests
res = requests.post( "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013/complete", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], "Idempotency-Key": str(uuid.uuid4()), }, json={"payment_pending": True},)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013/complete');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), 'Idempotency-Key: ' . bin2hex(random_bytes(16)), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => json_encode(['payment_pending' => true], JSON_UNESCAPED_UNICODE),]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os" "strings"
"github.com/google/uuid")
func main() { body := `{"payment_pending": true}` req, err := http.NewRequest("POST", "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013/complete", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) req.Header.Set("Idempotency-Key", uuid.NewString()) req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Post, "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013/complete");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());req.Content = new StringContent("""{"payment_pending": true}""", Encoding.UTF8, "application/json");var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Response 200
{ "attributes": {}, "billing_address": null, "buyer_accepts_marketing": false, "cancel_reason": "", "cancelled_at": null, "checkout_id": null, "closed_at": null, "cod_status": "", "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000007", "name": "Noora Al-Kuwari", "orders_count": 1, "phone": "+97455123456" }, "delivery_method": "shipping", "delivery_title": "Doha delivery", "discount_applications": [], "discount_codes": [], "draft_order_id": "0193a1b2-c3d4-7e5f-8a6b-000000000013", "financial_status": "pending", "fulfillment_orders": [ { "delivery_method": "shipping", "hold_reason": "", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000036", "lines": [ { "line_id": "0193a1b2-c3d4-7e5f-8a6b-000000000037", "quantity": 1, "remaining": 1 } ], "location": { "id": "0193a1b2-c3d4-7e5f-8a6b-000000000023", "name": "West Bay shop" }, "status": "open" } ], "fulfillment_status": "unfulfilled", "fulfillments": [], "gift": false, "gift_message": "", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000035", "item_count": 1, "lines": [ { "discount_allocations": [{"amount": 4500, "class": "order", "title": "Loyal customer"}], "fulfilled_quantity": 0, "gift_card": false, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000037", "image": "", "location_id": "0193a1b2-c3d4-7e5f-8a6b-000000000023", "original_price": "520.00", "price": "450.00", "product_id": "0193a1b2-c3d4-7e5f-8a6b-000000000005", "properties": {}, "quantity": 1, "refunded_quantity": 0, "requires_shipping": true, "sku": "ABY-LIN-M", "tax": "0.00", "tax_lines": [], "taxable": true, "title": "Embroidered linen abaya", "total": "405.00", "total_discount": "45.00", "variant_id": "0193a1b2-c3d4-7e5f-8a6b-000000000014", "variant_title": "M", "vendor": "Layla", "weight_grams": 0 } ], "locale": "en", "name": "#1001", "net_payment": "0.00", "note": "", "number": 1001, "order_discount": "45.00", "payment_fee": "0.00", "payment_method": "manual", "phone": "+97455123456", "processed_at": "2026-10-18T09:30:00Z", "refunds": [], "sample": false, "shipping_address": null, "shipping_line": { "final": 1500, "kind": "shipping", "price": 1500, "title": "Doha delivery" }, "source": "draft", "state": "open", "status_url": "https://shop.sooquna.test/orders/01a14f9f314a7de682d35010a325f162", "subtotal": "450.00", "tags": [], "tax_lines": [], "taxes_included": true, "tip": "0.00", "token": "01a14f9f314a7de682d35010a325f162", "total": "420.00", "total_discounts": "45.00", "total_outstanding": "420.00", "total_received": "0.00", "total_refunded": "0.00", "total_shipping": "15.00", "total_tax": "0.00", "transactions": [], "updated_at": "2026-10-18T09:30:00Z", "version": 2}Delete a draft order
Section titled “Delete a draft order”DELETE /draft-orders/{id} · Scope: write_draft_orders
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X DELETE "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", { method: "DELETE", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, },});if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const data = await res.json();console.log(data);import osimport requests
res = requests.delete( "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_HTTPHEADER => [ 'X-Sooquna-Access-Token: ' . getenv('SOOQUNA_TOKEN'), ], CURLOPT_RETURNTRANSFER => true,]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);if ($status >= 300) { throw new RuntimeException("$status: $response");}$data = json_decode($response, true);print_r($data);package main
import ( "fmt" "io" "net/http" "os")
func main() { req, err := http.NewRequest("DELETE", "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013", nil) if err != nil { panic(err) } req.Header.Set("X-Sooquna-Access-Token", os.Getenv("SOOQUNA_TOKEN")) res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() if res.StatusCode >= 300 { data, _ := io.ReadAll(res.Body) panic(fmt.Sprintf("%d: %s", res.StatusCode, data)) } data, _ := io.ReadAll(res.Body) fmt.Println(string(data))}using System.Text;
using var client = new HttpClient();var req = new HttpRequestMessage(HttpMethod.Delete, "https://api.sooquna.com/admin/api/2026-10/draft-orders/0193a1b2-c3d4-7e5f-8a6b-000000000013");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));var res = await client.SendAsync(req);if (!res.IsSuccessStatusCode) throw new Exception($"{(int)res.StatusCode}: {await res.Content.ReadAsStringAsync()}");Console.WriteLine(await res.Content.ReadAsStringAsync());Was this page helpful?

