Admin API
Customers
Buyers who ordered or signed up, with their orders.
Customers, newest first
GET/admin/2026-11/customers
Query parameters
limitintegerItems per page, 1 to 250.
Default 50 · 1 to 250
afterstringCursor from a previous next_cursor.
Up to 512 characters
qstringName, email or phone.
At least 1 characters · Up to 100 characters
Response 200
dataarray of objectrequireddata[].idID (cus_...)requireddata[].namestringrequireddata[].emailstring or nullrequireddata[].phonestring or nullrequireddata[].accepts_emailbooleanrequireddata[].accepts_whatsappbooleanrequireddata[].orders_countintegerrequireddata[].total_spentintegerrequireddata[].notestringrequireddata[].addressesarray of objectrequireddata[].addresses[].idID (adr_...)requireddata[].addresses[].namestringrequireddata[].addresses[].line1stringrequireddata[].addresses[].line2stringrequireddata[].addresses[].citystringrequireddata[].addresses[].statestringrequireddata[].addresses[].pincodestringrequireddata[].addresses[].countrystringrequireddata[].addresses[].phonestring or nullrequireddata[].addresses[].is_defaultbooleanrequireddata[].created_attimestamprequireddata[].updated_attimestamprequiredhas_morebooleanrequirednext_cursorstring or nullrequired
Errors
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | missing_scope | The app token does not have the scope this endpoint needs. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl https://api.storelyne.com/admin/2026-11/customers \
-H "Authorization: Bearer pat_live_..."const res = await fetch('https://api.storelyne.com/admin/2026-11/customers', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.STORELYNE_TOKEN}`,
},
});
const data = await res.json();{
"data": [
{
"id": "cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210",
"accepts_email": false,
"accepts_whatsapp": false,
"orders_count": 1,
"total_spent": 49900,
"note": "Hand block printed cotton.",
"addresses": [
{
"id": "adr_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"line1": "string",
"line2": "string",
"city": "string",
"state": "string",
"pincode": "string",
"country": "IN",
"phone": "+919876543210",
"is_default": false
}
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}
],
"has_more": false,
"next_cursor": "eyJpZCI6Ii4uLiJ9"
}Add a customer (merged into an existing one with the same phone, then email)
POST/admin/2026-11/customers
scope write_customersIdempotency-Key required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
X-CSRF-TokenstringRequired with a seller session cookie: the value of the orb_csrf cookie.
Request body
namestringUp to 120 characters
emailstring or nullDefault null
phonestring or nullnotestringUp to 2000 characters
addressobjectaddress.namestringrequiredAt least 1 characters · Up to 120 characters
address.line1stringrequiredAt least 1 characters · Up to 200 characters
address.line2stringUp to 200 characters
address.citystringrequiredAt least 1 characters · Up to 100 characters
address.statestringrequiredAt least 1 characters · Up to 100 characters
address.pincodestringrequiredaddress.country"IN"Default "IN"
address.phonestring or nulladdress.is_defaultbooleanDefault false
Response 201
idID (cus_...)requirednamestringrequiredemailstring or nullrequiredphonestring or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredorders_countintegerrequiredtotal_spentintegerrequirednotestringrequiredaddressesarray of objectrequiredaddresses[].idID (adr_...)requiredaddresses[].namestringrequiredaddresses[].line1stringrequiredaddresses[].line2stringrequiredaddresses[].citystringrequiredaddresses[].statestringrequiredaddresses[].pincodestringrequiredaddresses[].countrystringrequiredaddresses[].phonestring or nullrequiredaddresses[].is_defaultbooleanrequiredcreated_attimestamprequiredupdated_attimestamprequired
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | missing_scope | The app token does not have the scope this endpoint needs. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/admin/2026-11/customers \
-H "Authorization: Bearer pat_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "",
"email": "buyer@example.com",
"phone": "+919876543210"
}'const res = await fetch('https://api.storelyne.com/admin/2026-11/customers', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.STORELYNE_TOKEN}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "",
"email": "buyer@example.com",
"phone": "+919876543210"
}),
});
const data = await res.json();{
"id": "cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210",
"accepts_email": false,
"accepts_whatsapp": false,
"orders_count": 1,
"total_spent": 49900,
"note": "Hand block printed cotton.",
"addresses": [
{
"id": "adr_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"line1": "string",
"line2": "string",
"city": "string",
"state": "string",
"pincode": "string",
"country": "IN",
"phone": "+919876543210",
"is_default": false
}
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}One customer with addresses
GET/admin/2026-11/customers/{id}
Path parameters
idID (cus_...)required
Response 200
idID (cus_...)requirednamestringrequiredemailstring or nullrequiredphonestring or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredorders_countintegerrequiredtotal_spentintegerrequirednotestringrequiredaddressesarray of objectrequiredaddresses[].idID (adr_...)requiredaddresses[].namestringrequiredaddresses[].line1stringrequiredaddresses[].line2stringrequiredaddresses[].citystringrequiredaddresses[].statestringrequiredaddresses[].pincodestringrequiredaddresses[].countrystringrequiredaddresses[].phonestring or nullrequiredaddresses[].is_defaultbooleanrequiredcreated_attimestamprequiredupdated_attimestamprequired
Errors
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | missing_scope | The app token does not have the scope this endpoint needs. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
-H "Authorization: Bearer pat_live_..."const res = await fetch('https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.STORELYNE_TOKEN}`,
},
});
const data = await res.json();{
"id": "cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210",
"accepts_email": false,
"accepts_whatsapp": false,
"orders_count": 1,
"total_spent": 49900,
"note": "Hand block printed cotton.",
"addresses": [
{
"id": "adr_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"line1": "string",
"line2": "string",
"city": "string",
"state": "string",
"pincode": "string",
"country": "IN",
"phone": "+919876543210",
"is_default": false
}
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}Update name, contact details or note
PATCH/admin/2026-11/customers/{id}
Path parameters
idID (cus_...)required
Headers
X-CSRF-TokenstringRequired with a seller session cookie: the value of the orb_csrf cookie.
Request body
namestringUp to 120 characters
emailstring or nullphonestring or nullnotestringUp to 2000 characters
Response 200
idID (cus_...)requirednamestringrequiredemailstring or nullrequiredphonestring or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredorders_countintegerrequiredtotal_spentintegerrequirednotestringrequiredaddressesarray of objectrequiredaddresses[].idID (adr_...)requiredaddresses[].namestringrequiredaddresses[].line1stringrequiredaddresses[].line2stringrequiredaddresses[].citystringrequiredaddresses[].statestringrequiredaddresses[].pincodestringrequiredaddresses[].countrystringrequiredaddresses[].phonestring or nullrequiredaddresses[].is_defaultbooleanrequiredcreated_attimestamprequiredupdated_attimestamprequired
Errors
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | missing_scope | The app token does not have the scope this endpoint needs. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | conflict | The request conflicts with the current state of the object. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X PATCH https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
-H "Authorization: Bearer pat_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
}'const res = await fetch('https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.STORELYNE_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
}),
});
const data = await res.json();{
"id": "cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210",
"accepts_email": false,
"accepts_whatsapp": false,
"orders_count": 1,
"total_spent": 49900,
"note": "Hand block printed cotton.",
"addresses": [
{
"id": "adr_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"line1": "string",
"line2": "string",
"city": "string",
"state": "string",
"pincode": "string",
"country": "IN",
"phone": "+919876543210",
"is_default": false
}
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}Add an address
POST/admin/2026-11/customers/{id}/addresses
scope write_customersIdempotency-Key required
Path parameters
idID (cus_...)required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
X-CSRF-TokenstringRequired with a seller session cookie: the value of the orb_csrf cookie.
Request body
namestringrequiredAt least 1 characters · Up to 120 characters
line1stringrequiredAt least 1 characters · Up to 200 characters
line2stringUp to 200 characters
citystringrequiredAt least 1 characters · Up to 100 characters
statestringrequiredAt least 1 characters · Up to 100 characters
pincodestringrequiredcountry"IN"Default "IN"
phonestring or nullis_defaultbooleanDefault false
Response 201
idID (cus_...)requirednamestringrequiredemailstring or nullrequiredphonestring or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredorders_countintegerrequiredtotal_spentintegerrequirednotestringrequiredaddressesarray of objectrequiredaddresses[].idID (adr_...)requiredaddresses[].namestringrequiredaddresses[].line1stringrequiredaddresses[].line2stringrequiredaddresses[].citystringrequiredaddresses[].statestringrequiredaddresses[].pincodestringrequiredaddresses[].countrystringrequiredaddresses[].phonestring or nullrequiredaddresses[].is_defaultbooleanrequiredcreated_attimestamprequiredupdated_attimestamprequired
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | missing_scope | The app token does not have the scope this endpoint needs. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R/addresses \
-H "Authorization: Bearer pat_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Festive saree",
"line1": "string",
"city": "string",
"state": "string",
"pincode": "string"
}'const res = await fetch('https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R/addresses', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.STORELYNE_TOKEN}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Festive saree",
"line1": "string",
"city": "string",
"state": "string",
"pincode": "string"
}),
});
const data = await res.json();{
"id": "cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210",
"accepts_email": false,
"accepts_whatsapp": false,
"orders_count": 1,
"total_spent": 49900,
"note": "Hand block printed cotton.",
"addresses": [
{
"id": "adr_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"line1": "string",
"line2": "string",
"city": "string",
"state": "string",
"pincode": "string",
"country": "IN",
"phone": "+919876543210",
"is_default": false
}
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}Record a marketing consent choice (kept forever, newest wins)
POST/admin/2026-11/customers/{id}/consents
scope write_customersIdempotency-Key required
Path parameters
idID (cus_...)required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
X-CSRF-TokenstringRequired with a seller session cookie: the value of the orb_csrf cookie.
Request body
channelenumrequiredOne of
emailwhatsappsmsgrantedbooleanrequiredsourceenumOne of
checkoutadminapiimportunsubscribe_linkDefault "admin"
text_versionstringrequiredWhich wording the buyer agreed to, for example checkout-2026-11.
At least 1 characters · Up to 50 characters
Response 201
idID (cus_...)requirednamestringrequiredemailstring or nullrequiredphonestring or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredorders_countintegerrequiredtotal_spentintegerrequirednotestringrequiredaddressesarray of objectrequiredaddresses[].idID (adr_...)requiredaddresses[].namestringrequiredaddresses[].line1stringrequiredaddresses[].line2stringrequiredaddresses[].citystringrequiredaddresses[].statestringrequiredaddresses[].pincodestringrequiredaddresses[].countrystringrequiredaddresses[].phonestring or nullrequiredaddresses[].is_defaultbooleanrequiredcreated_attimestamprequiredupdated_attimestamprequired
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | missing_scope | The app token does not have the scope this endpoint needs. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R/consents \
-H "Authorization: Bearer pat_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"channel": "email",
"granted": false,
"text_version": "Hand block printed cotton."
}'const res = await fetch('https://api.storelyne.com/admin/2026-11/customers/cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R/consents', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.STORELYNE_TOKEN}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"channel": "email",
"granted": false,
"text_version": "Hand block printed cotton."
}),
});
const data = await res.json();{
"id": "cus_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210",
"accepts_email": false,
"accepts_whatsapp": false,
"orders_count": 1,
"total_spent": 49900,
"note": "Hand block printed cotton.",
"addresses": [
{
"id": "adr_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"line1": "string",
"line2": "string",
"city": "string",
"state": "string",
"pincode": "string",
"country": "IN",
"phone": "+919876543210",
"is_default": false
}
],
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}