Skip to content

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}

POST /discounts · Scope: write_discounts

method code or automatic; type order, product, shipping or bxgy; value_type percentage or fixed_amount.

Terminal window
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"
}'
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
}

GET /discounts · Scope: read_discounts

Parameter In Description
status query For example scheduled.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts?status=scheduled" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{"data": [], "page_info": {"has_next_page": false}}

GET /discounts/lookup · Scope: read_discounts

Parameter In Description
code query For example EID10.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts/lookup?code=EID10" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
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 /discounts/{id} · Scope: read_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000010" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
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
}

PUT /discounts/{id} · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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
}'
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
}

POST /discounts/{id}/codes · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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"]}'
Response 201
{"added": 2}

POST /discounts/{id}/codes/generate · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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}'
Response 201
{"added": 50}

GET /discounts/{id}/codes · Scope: read_discounts

Parameter In Description
id path The resource’s ID.
q query For example EID10.
Terminal window
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"
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 /discounts/{id}/codes/{code_id} · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
code_id path The code ID.
Terminal window
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"

GET /discounts/{id}/redemptions · Scope: read_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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"
Response 200
{"data": []}

POST /discounts/{id}/duplicate · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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"
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
}

POST /discounts/{id}/deactivate · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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"
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
}

POST /discounts/{id}/activate · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
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"
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 /discounts/{id} · Scope: write_discounts

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X DELETE "https://api.sooquna.com/admin/api/2026-10/discounts/0193a1b2-c3d4-7e5f-8a6b-000000000052" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 204
{}

Was this page helpful?