Skip to content

Customers

Customers, their addresses and segments (contact details need read_customer_pii). 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 customer POST /customers
List customers GET /customers
Count customers GET /customers/count
List customer tags GET /customers/tags
Get a customer GET /customers/{id}
Update a customer PATCH /customers/{id}
Add an address POST /customers/{id}/addresses
Update an address PATCH /customers/{id}/addresses/{address_id}
Make an address the default POST /customers/{id}/addresses/{address_id}/default
Delete an address DELETE /customers/{id}/addresses/{address_id}
Change marketing consent PUT /customers/{id}/marketing
List a customer’s consent history GET /customers/{id}/consents
List a customer’s orders GET /customers/{id}/orders
Invite a customer to create an account POST /customers/{id}/send-invite
Tag or delete many customers POST /customers/bulk
Create a customer segment POST /segments
List customer segments GET /segments
List the fields segment queries can use GET /segments/fields
Get a segment GET /segments/{id}
Update a segment PUT /segments/{id}
Delete a segment DELETE /segments/{id}
Delete a customer DELETE /customers/{id}

POST /customers · Scope: write_customers · Needs an Idempotency-Key header

Terminal window
curl -X POST "https://api.sooquna.com/admin/api/2026-10/customers" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Noora",
"last_name": "Al-Kuwari",
"email": "[email protected]",
"phone": "+97455123456",
"locale": "ar",
"tags": ["vip"],
"email_marketing": {"state": "subscribed", "opt_in_level": "single_opt_in"},
"addresses": [
{
"first_name": "Noora",
"last_name": "Al-Kuwari",
"address1": "Zone 66, Street 801, Building 12",
"city": "Doha",
"country_code": "QA",
"phone": "+97455123456",
"default": true
}
]
}'
Response 201
{
"accepts_email_marketing": true,
"accepts_sms_marketing": false,
"addresses": [
{
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
}
],
"amount_spent": "0.00",
"average_order_value": "0.00",
"created_at": "2026-10-18T09:30:00Z",
"currency": "QAR",
"default_address": {
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
},
"display_name": "Noora Al-Kuwari",
"email": "[email protected]",
"email_marketing": {
"opt_in_level": "single_opt_in",
"state": "subscribed",
"updated_at": "2026-10-18T09:30:00Z"
},
"first_name": "Noora",
"first_order_at": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000007",
"last_name": "Al-Kuwari",
"last_order_at": null,
"locale": "ar",
"note": "",
"orders_count": 0,
"phone": "+97455123456",
"pii_masked": false,
"sms_marketing": {
"opt_in_level": "single_opt_in",
"state": "not_subscribed",
"updated_at": null
},
"state": "enabled",
"tags": ["vip"],
"tax_exempt": false,
"tax_exemptions": [],
"updated_at": "2026-10-18T09:30:00Z",
"version": 2
}

GET /customers · Scope: read_customers

Parameter In Description
q query For example noora.
limit query For example 10.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/customers?q=noora&limit=10" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{
"data": [
{
"accepts_email_marketing": true,
"accepts_sms_marketing": false,
"amount_spent": "0.00",
"average_order_value": "0.00",
"created_at": "2026-10-18T09:30:00Z",
"currency": "QAR",
"default_address": {
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
},
"display_name": "Noora Al-Kuwari",
"email": "[email protected]",
"email_marketing": {
"opt_in_level": "single_opt_in",
"state": "subscribed",
"updated_at": "2026-10-18T09:30:00Z"
},
"first_name": "Noora",
"first_order_at": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000007",
"last_name": "Al-Kuwari",
"last_order_at": null,
"locale": "ar",
"note": "",
"orders_count": 0,
"phone": "+97455123456",
"pii_masked": false,
"sms_marketing": {
"opt_in_level": "single_opt_in",
"state": "not_subscribed",
"updated_at": null
},
"state": "enabled",
"tags": ["vip"],
"tax_exempt": false,
"tax_exemptions": [],
"updated_at": "2026-10-18T09:30:00Z",
"version": 2
}
],
"page_info": {"has_next_page": false}
}

GET /customers/count · Scope: read_customers

Parameter In Description
tag query For example vip.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/customers/count?tag=vip" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{"count": 1}

GET /customers/tags · Scope: read_customers

Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/customers/tags" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{"data": [{"customers": 1, "tag": "vip"}]}

GET /customers/{id} · Scope: read_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{
"accepts_email_marketing": true,
"accepts_sms_marketing": false,
"addresses": [
{
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
}
],
"amount_spent": "0.00",
"average_order_value": "0.00",
"created_at": "2026-10-18T09:30:00Z",
"currency": "QAR",
"default_address": {
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
},
"display_name": "Noora Al-Kuwari",
"email": "[email protected]",
"email_marketing": {
"opt_in_level": "single_opt_in",
"state": "subscribed",
"updated_at": "2026-10-18T09:30:00Z"
},
"first_name": "Noora",
"first_order_at": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000007",
"last_name": "Al-Kuwari",
"last_order_at": null,
"locale": "ar",
"note": "",
"orders_count": 0,
"phone": "+97455123456",
"pii_masked": false,
"sms_marketing": {
"opt_in_level": "single_opt_in",
"state": "not_subscribed",
"updated_at": null
},
"state": "enabled",
"tags": ["vip"],
"tax_exempt": false,
"tax_exemptions": [],
"updated_at": "2026-10-18T09:30:00Z",
"version": 2
}

PATCH /customers/{id} · Scope: write_customers

Fields you leave out stay as they are.

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X PATCH "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"note": "Prefers delivery after Maghrib",
"tags": ["vip", "abaya"],
"version": 2
}'
Response 200
{
"accepts_email_marketing": true,
"accepts_sms_marketing": false,
"addresses": [
{
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
}
],
"amount_spent": "0.00",
"average_order_value": "0.00",
"created_at": "2026-10-18T09:30:00Z",
"currency": "QAR",
"default_address": {
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
},
"display_name": "Noora Al-Kuwari",
"email": "[email protected]",
"email_marketing": {
"opt_in_level": "single_opt_in",
"state": "subscribed",
"updated_at": "2026-10-18T09:30:00Z"
},
"first_name": "Noora",
"first_order_at": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000007",
"last_name": "Al-Kuwari",
"last_order_at": null,
"locale": "ar",
"note": "Prefers delivery after Maghrib",
"orders_count": 0,
"phone": "+97455123456",
"pii_masked": false,
"sms_marketing": {
"opt_in_level": "single_opt_in",
"state": "not_subscribed",
"updated_at": null
},
"state": "enabled",
"tags": ["abaya", "vip"],
"tax_exempt": false,
"tax_exemptions": [],
"updated_at": "2026-10-18T09:30:00Z",
"version": 3
}

POST /customers/{id}/addresses · Scope: write_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X POST "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/addresses" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Noora",
"last_name": "Al-Kuwari",
"address1": "Lusail Marina, Tower 3, Apt 1204",
"city": "Lusail",
"country_code": "QA",
"phone": "+97455123456"
}'
Response 201
{
"address1": "Lusail Marina, Tower 3, Apt 1204",
"address2": "",
"city": "Lusail",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000049",
"is_default": false,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
}

PATCH /customers/{id}/addresses/{address_id} · Scope: write_customers

Parameter In Description
id path The resource’s ID.
address_id path The address ID.
Terminal window
curl -X PATCH "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/addresses/0193a1b2-c3d4-7e5f-8a6b-000000000049" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Noora",
"last_name": "Al-Kuwari",
"address1": "Lusail Marina, Tower 3, Apt 1205",
"city": "Lusail",
"country_code": "QA"
}'
Response 200
{
"address1": "Lusail Marina, Tower 3, Apt 1205",
"address2": "",
"city": "Lusail",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000049",
"is_default": false,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "",
"province_code": "",
"zip": ""
}

POST /customers/{id}/addresses/{address_id}/default · Scope: write_customers

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

DELETE /customers/{id}/addresses/{address_id} · Scope: write_customers

Parameter In Description
id path The resource’s ID.
address_id path The address ID.
Terminal window
curl -X DELETE "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/addresses/0193a1b2-c3d4-7e5f-8a6b-000000000049" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"

PUT /customers/{id}/marketing · Scope: write_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X PUT "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/marketing" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": {"state": "subscribed", "opt_in_level": "confirmed_opt_in"},
"sms": {"state": "unsubscribed"}
}'
Response 200
{
"accepts_email_marketing": true,
"accepts_sms_marketing": false,
"addresses": [
{
"address1": "Lusail Marina, Tower 3, Apt 1205",
"address2": "",
"city": "Lusail",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000049",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "",
"province_code": "",
"zip": ""
},
{
"address1": "Zone 66, Street 801, Building 12",
"address2": "",
"city": "Doha",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000006",
"is_default": false,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "+97455123456",
"province_code": "",
"zip": ""
}
],
"amount_spent": "0.00",
"average_order_value": "0.00",
"created_at": "2026-10-18T09:30:00Z",
"currency": "QAR",
"default_address": {
"address1": "Lusail Marina, Tower 3, Apt 1205",
"address2": "",
"city": "Lusail",
"company": "",
"country_code": "QA",
"extra": {},
"first_name": "Noora",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000049",
"is_default": true,
"last_name": "Al-Kuwari",
"latitude": null,
"longitude": null,
"phone": "",
"province_code": "",
"zip": ""
},
"display_name": "Noora Al-Kuwari",
"email": "[email protected]",
"email_marketing": {
"opt_in_level": "confirmed_opt_in",
"state": "subscribed",
"updated_at": "2026-10-18T09:30:00Z"
},
"first_name": "Noora",
"first_order_at": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000007",
"last_name": "Al-Kuwari",
"last_order_at": null,
"locale": "ar",
"note": "Prefers delivery after Maghrib",
"orders_count": 0,
"phone": "+97455123456",
"pii_masked": false,
"sms_marketing": {
"opt_in_level": "single_opt_in",
"state": "unsubscribed",
"updated_at": "2026-10-18T09:30:00Z"
},
"state": "enabled",
"tags": ["abaya", "vip"],
"tax_exempt": false,
"tax_exemptions": [],
"updated_at": "2026-10-18T09:30:00Z",
"version": 6
}

GET /customers/{id}/consents · Scope: read_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/consents" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{
"data": [
{
"actor": "Docs",
"channel": "email",
"created_at": "2026-10-18T09:30:00Z",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000008",
"opt_in_level": "confirmed_opt_in",
"source": "admin",
"state": "subscribed"
},
{
"actor": "Docs",
"channel": "sms",
"created_at": "2026-10-18T09:30:00Z",
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000009",
"opt_in_level": "single_opt_in",
"source": "admin",
"state": "unsubscribed"
}
]
}

GET /customers/{id}/orders · Scope: read_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/orders" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"

POST /customers/{id}/send-invite · Scope: write_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X POST "https://api.sooquna.com/admin/api/2026-10/customers/0193a1b2-c3d4-7e5f-8a6b-000000000007/send-invite" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"

POST /customers/bulk · Scope: write_customers

Actions: add_tags, remove_tags, delete.

Terminal window
curl -X POST "https://api.sooquna.com/admin/api/2026-10/customers/bulk" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "add_tags",
"ids": ["0193a1b2-c3d4-7e5f-8a6b-000000000007"],
"tags": ["ramadan-2026"]
}'
Response 200
{"skipped": 0, "updated": 1}

POST /segments · Scope: write_customers

Terminal window
curl -X POST "https://api.sooquna.com/admin/api/2026-10/segments" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Big spenders", "query": "amount_spent > 500"}'
Response 201
{
"count": 0,
"counted_at": "2026-10-18T09:30:00Z",
"created_at": "2026-10-18T09:30:00Z",
"default_key": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000044",
"materialized_at": null,
"name": "Big spenders",
"query": "amount_spent > 500",
"updated_at": "2026-10-18T09:30:00Z",
"version": 1
}

GET /segments · Scope: read_customers

Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/segments" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{
"data": [
{
"count": 0,
"counted_at": "2026-10-18T09:30:00Z",
"created_at": "2026-10-18T09:30:00Z",
"default_key": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000044",
"materialized_at": null,
"name": "Big spenders",
"query": "amount_spent > 500",
"updated_at": "2026-10-18T09:30:00Z",
"version": 1
}
]
}

GET /segments/fields · Scope: read_customers

Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/segments/fields" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{
"data": [
{
"available": false,
"description": {
"ar": "تتوفر البيانات عند إطلاق الدفع.",
"en": "Fills in once checkout launches."
},
"example": "abandoned_checkout_date > -30d",
"label": {"ar": "تاريخ السلة المتروكة", "en": "Abandoned checkout date"},
"name": "abandoned_checkout_date",
"operators": ["=", ">"],
"type": "date"
},
{
"available": true,
"description": {
"ar": "إجمالي الإنفاق بعملة المتجر.",
"en": "Total spent, in the store currency."
},
"example": "amount_spent > 500",
"label": {"ar": "المبلغ المنفق", "en": "Amount spent"},
"name": "amount_spent",
"operators": ["=", "!="],
"type": "money"
}
]
}

GET /segments/{id} · Scope: read_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X GET "https://api.sooquna.com/admin/api/2026-10/segments/0193a1b2-c3d4-7e5f-8a6b-000000000044" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN"
Response 200
{
"count": 0,
"counted_at": "2026-10-18T09:30:00Z",
"created_at": "2026-10-18T09:30:00Z",
"default_key": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000044",
"materialized_at": null,
"name": "Big spenders",
"query": "amount_spent > 500",
"updated_at": "2026-10-18T09:30:00Z",
"version": 1
}

PUT /segments/{id} · Scope: write_customers

Parameter In Description
id path The resource’s ID.
Terminal window
curl -X PUT "https://api.sooquna.com/admin/api/2026-10/segments/0193a1b2-c3d4-7e5f-8a6b-000000000044" \
-H "X-Sooquna-Access-Token: $SOOQUNA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Big spenders", "query": "amount_spent > 1000", "version": 1}'
Response 200
{
"count": 0,
"counted_at": "2026-10-18T09:30:00Z",
"created_at": "2026-10-18T09:30:00Z",
"default_key": null,
"id": "0193a1b2-c3d4-7e5f-8a6b-000000000044",
"materialized_at": null,
"name": "Big spenders",
"query": "amount_spent > 1000",
"updated_at": "2026-10-18T09:30:00Z",
"version": 2
}

DELETE /segments/{id} · Scope: write_customers

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

DELETE /customers/{id} · Scope: write_customers

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

Was this page helpful?