Discounts
Discounts and discount codes. 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 |
|---|---|---|
| Create a discount | POST | /discounts |
| List discounts | GET | /discounts |
| Find a discount by code | GET | /discounts/lookup |
| Get a discount | GET | /discounts/{id} |
| Update a discount | PUT | /discounts/{id} |
| Add codes to a discount | POST | /discounts/{id}/codes |
| Generate unique codes | POST | /discounts/{id}/codes/generate |
| List a discount’s codes | GET | /discounts/{id}/codes |
| Delete a code | DELETE | /discounts/{id}/codes/{code_id} |
| List a discount’s redemptions | GET | /discounts/{id}/redemptions |
| Duplicate a discount | POST | /discounts/{id}/duplicate |
| End a discount now | POST | /discounts/{id}/deactivate |
| Start a discount now | POST | /discounts/{id}/activate |
| Delete a discount | DELETE | /discounts/{id} |
Create a discount
Section titled “Create a discount”POST /discounts · Scope: write_discounts
method code or automatic; type order, product, shipping or bxgy; value_type percentage or fixed_amount.
curl -X POST "https://api.sooquna.com/admin/api/2026-10/discounts" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "min_requirement": {"type": "amount", "amount": "200.00"}, "combines_with": {"shipping": true}, "once_per_customer": true, "starts_at": "2026-03-18T00:00:00Z", "ends_at": "2026-03-23T23:59:59Z"}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts", { method: "POST", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "min_requirement": {"type": "amount", "amount": "200.00"}, "combines_with": {"shipping": true}, "once_per_customer": true, "starts_at": "2026-03-18T00:00:00Z", "ends_at": "2026-03-23T23:59:59Z" }),});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/discounts", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], }, json={ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "min_requirement": {"type": "amount", "amount": "200.00"}, "combines_with": {"shipping": True}, "once_per_customer": True, "starts_at": "2026-03-18T00:00:00Z", "ends_at": "2026-03-23T23:59:59Z", },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/discounts');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([ 'method' => 'code', 'type' => 'order', 'code' => 'EID10', 'title' => 'Eid 10% off', 'value_type' => 'percentage', 'value' => '10', 'min_requirement' => ['type' => 'amount', 'amount' => '200.00'], 'combines_with' => ['shipping' => true], 'once_per_customer' => true, 'starts_at' => '2026-03-18T00:00:00Z', 'ends_at' => '2026-03-23T23:59:59Z', ], 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 := `{ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "min_requirement": {"type": "amount", "amount": "200.00"}, "combines_with": {"shipping": true}, "once_per_customer": true, "starts_at": "2026-03-18T00:00:00Z", "ends_at": "2026-03-23T23:59:59Z"}` req, err := http.NewRequest("POST", "https://api.sooquna.com/admin/api/2026-10/discounts", 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/discounts");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Content = new StringContent("""{ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "min_requirement": {"type": "amount", "amount": "200.00"}, "combines_with": {"shipping": true}, "once_per_customer": true, "starts_at": "2026-03-18T00:00:00Z", "ends_at": "2026-03-23T23:59:59Z"}""", 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
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "EID10", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": true}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": "2026-10-18T09:30:00Z", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000010", "method": "code", "min_requirement": {"amount": "200.00", "type": "amount"}, "once_per_customer": true, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "expired", "title": "Eid 10% off", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": null, "value": "10", "value_type": "percentage", "version": 1}List discounts
Section titled “List discounts”GET /discounts · Scope: read_discounts
| Parameter | In | Description |
|---|---|---|
status |
query | For example scheduled. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts?status=scheduled" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts?status=scheduled", { 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/discounts?status=scheduled", 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/discounts?status=scheduled');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/discounts?status=scheduled", 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/discounts?status=scheduled");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": [], "page_info": {"has_next_page": false}}Find a discount by code
Section titled “Find a discount by code”GET /discounts/lookup · Scope: read_discounts
| Parameter | In | Description |
|---|---|---|
code |
query | For example EID10. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts/lookup?code=EID10" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/lookup?code=EID10", { 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/discounts/lookup?code=EID10", 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/discounts/lookup?code=EID10');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/discounts/lookup?code=EID10", 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/discounts/lookup?code=EID10");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
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "EID10", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": true}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": "2026-10-18T09:30:00Z", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000010", "method": "code", "min_requirement": {"amount": "200.00", "type": "amount"}, "once_per_customer": true, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "expired", "title": "Eid 10% off", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": null, "value": "10", "value_type": "percentage", "version": 1}Get a discount
Section titled “Get a discount”GET /discounts/{id} · Scope: read_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010", { 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010');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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010");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
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "EID10", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": true}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": "2026-10-18T09:30:00Z", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000010", "method": "code", "min_requirement": {"amount": "200.00", "type": "amount"}, "once_per_customer": true, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "expired", "title": "Eid 10% off", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": null, "value": "10", "value_type": "percentage", "version": 1}Update a discount
Section titled “Update a discount”PUT /discounts/{id} · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X PUT "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "usage_limit": 500, "version": 1}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010", { method: "PUT", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "usage_limit": 500, "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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], }, json={ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "usage_limit": 500, "version": 1, },)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010');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([ 'method' => 'code', 'type' => 'order', 'code' => 'EID10', 'title' => 'Eid 10% off', 'value_type' => 'percentage', 'value' => '10', 'usage_limit' => 500, '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 := `{ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "usage_limit": 500, "version": 1}` req, err := http.NewRequest("PUT", "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Content = new StringContent("""{ "method": "code", "type": "order", "code": "EID10", "title": "Eid 10% off", "value_type": "percentage", "value": "10", "usage_limit": 500, "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
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "EID10", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": false}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": null, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000010", "method": "code", "min_requirement": {"type": "none"}, "once_per_customer": false, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "active", "title": "Eid 10% off", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": 500, "value": "10", "value_type": "percentage", "version": 2}Add codes to a discount
Section titled “Add codes to a discount”POST /discounts/{id}/codes · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X POST "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Content-Type: application/json" \ -d '{"codes": ["EID10-VIP", "EID10-STAFF"]}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes", { method: "POST", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({"codes": ["EID10-VIP", "EID10-STAFF"]}),});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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], }, json={"codes": ["EID10-VIP", "EID10-STAFF"]},)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes');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(['codes' => ['EID10-VIP', 'EID10-STAFF']], 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 := `{"codes": ["EID10-VIP", "EID10-STAFF"]}` req, err := http.NewRequest("POST", "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Content = new StringContent("""{"codes": ["EID10-VIP", "EID10-STAFF"]}""", 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
{"added": 2}Generate unique codes
Section titled “Generate unique codes”POST /discounts/{id}/codes/generate · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X POST "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/generate" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \ -H "Content-Type: application/json" \ -d '{"count": 50, "prefix": "EID-", "length": 8}'const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/generate", { method: "POST", headers: { "X-Sooquna-Access-Token": process.env.SOOQUNA_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({"count": 50, "prefix": "EID-", "length": 8}),});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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/generate", headers={ "X-Sooquna-Access-Token": os.environ["SOOQUNA_TOKEN"], }, json={"count": 50, "prefix": "EID-", "length": 8},)res.raise_for_status()print(res.json())<?php$ch = curl_init('https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/generate');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(['count' => 50, 'prefix' => 'EID-', 'length' => 8], 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 := `{"count": 50, "prefix": "EID-", "length": 8}` req, err := http.NewRequest("POST", "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/generate", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/generate");req.Headers.Add("X-Sooquna-Access-Token", Environment.GetEnvironmentVariable("SOOQUNA_TOKEN"));req.Content = new StringContent("""{"count": 50, "prefix": "EID-", "length": 8}""", 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
{"added": 50}List a discount’s codes
Section titled “List a discount’s codes”GET /discounts/{id}/codes · Scope: read_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
q |
query | For example EID10. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes?q=EID10" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes?q=EID10", { 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes?q=EID10", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes?q=EID10');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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes?q=EID10", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes?q=EID10");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": [ { "code": "EID10", "created_at": "2026-10-18T09:30:00Z", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000011", "usage_count": 0 }, { "code": "EID10-STAFF", "created_at": "2026-10-18T09:30:00Z", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000012", "usage_count": 0 } ], "total": 53}Delete a code
Section titled “Delete a code”DELETE /discounts/{id}/codes/{code_id} · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
code_id |
path | The code ID. |
curl -X DELETE "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/0193a1b2-cca6-7dfb-8a6f-306035bfda1c" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/0193a1b2-cca6-7dfb-8a6f-306035bfda1c", { 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/0193a1b2-cca6-7dfb-8a6f-306035bfda1c", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/0193a1b2-cca6-7dfb-8a6f-306035bfda1c');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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/0193a1b2-cca6-7dfb-8a6f-306035bfda1c", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/codes/0193a1b2-cca6-7dfb-8a6f-306035bfda1c");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());List a discount’s redemptions
Section titled “List a discount’s redemptions”GET /discounts/{id}/redemptions · Scope: read_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/redemptions" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/redemptions", { 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/redemptions", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/redemptions');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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/redemptions", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/redemptions");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": []}Duplicate a discount
Section titled “Duplicate a discount”POST /discounts/{id}/duplicate · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X POST "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/duplicate" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/duplicate", { method: "POST", 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.post( "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/duplicate", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/duplicate');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', 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("POST", "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/duplicate", 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.Post, "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010/duplicate");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 201
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "NGT2NMQSV8", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": false}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": null, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000052", "method": "code", "min_requirement": {"type": "none"}, "once_per_customer": false, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "active", "title": "NGT2NMQSV8", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": 500, "value": "10", "value_type": "percentage", "version": 1}End a discount now
Section titled “End a discount now”POST /discounts/{id}/deactivate · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X POST "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/deactivate" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/deactivate", { method: "POST", 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.post( "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/deactivate", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/deactivate');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', 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("POST", "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/deactivate", 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.Post, "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/deactivate");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
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "NGT2NMQSV8", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": false}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": "2026-10-18T09:30:00Z", "id": "0193a1b2-c3d4-7e5f-8a6b-000000000052", "method": "code", "min_requirement": {"type": "none"}, "once_per_customer": false, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "expired", "title": "NGT2NMQSV8", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": 500, "value": "10", "value_type": "percentage", "version": 2}Start a discount now
Section titled “Start a discount now”POST /discounts/{id}/activate · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X POST "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/activate" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/activate", { method: "POST", 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.post( "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/activate", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/activate');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', 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("POST", "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/activate", 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.Post, "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052/activate");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
{ "applies_to": { "all": true, "collection_ids": [], "exclude_sale_items": false, "once_per_order": false, "product_ids": [], "variant_ids": [] }, "code": "NGT2NMQSV8", "codes_count": 1, "combines_with": {"order": false, "product": false, "shipping": false}, "created_at": "2026-10-18T09:30:00Z", "currency": "QAR", "customer_eligibility": {"all": true, "customer_ids": [], "segment_ids": []}, "ends_at": null, "id": "0193a1b2-c3d4-7e5f-8a6b-000000000052", "method": "code", "min_requirement": {"type": "none"}, "once_per_customer": false, "shipping": {"countries": [], "max_rate": null}, "starts_at": "2026-10-18T09:30:00Z", "status": "active", "title": "NGT2NMQSV8", "type": "order", "updated_at": "2026-10-18T09:30:00Z", "usage_count": 0, "usage_limit": 500, "value": "10", "value_type": "percentage", "version": 3}Delete a discount
Section titled “Delete a discount”DELETE /discounts/{id} · Scope: write_discounts
| Parameter | In | Description |
|---|---|---|
id |
path | The resource’s ID. |
curl -X DELETE "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052" \ -H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"const res = await fetch("https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052", { 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052');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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052", 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/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052");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 204
{}Was this page helpful?

