Skip to content

Get a customer

GET
/stores/{storeRef}/customers/{customerId}
curl --request GET \
--url https://apibase.ecomweb.app/api/v1/stores/example/customers/1 \
--header 'x-api-key: <x-api-key>'

Returns one customer with their order figures, sign-in account state, saved addresses and counts, in one response. A deleted customer can still be read; deleted_at is set, and merged_into_id names the customer they were merged into, if any. account.sessions lists the active sessions with their IP address and user agent. It is returned to API keys and to owners and admins, and left out for other staff.

Required scopes: read:customers

customerId
required
integer

The customer ID.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
status
required

Account status set by the store.

string
Allowed values: active inactive
activity_state
required

Ordering activity: active, inactive or never_ordered.

string
Allowed values: active inactive never_ordered
id
required

Customer ID.

number
name
required

Full name.

string
email
required

Email address.

string
phone
required

Phone number, or null.

string
nullable
avatar_url
required

Avatar image URL, or null.

string
nullable
notes
required

Internal notes, or null.

string
nullable
created_at
required

When the customer was created, as an ISO 8601 timestamp.

string
deleted_at
required

When the customer was deleted, or null while the customer is live.

string
nullable
merged_into_id
required

For a customer merged into another, the ID of the customer that absorbed them. Null otherwise, including for a customer who was simply deleted.

number
nullable
kpis
required

Order figures.

object
total_orders
required

Orders placed.

number
cancelled_orders
required

Cancelled orders.

number
refunded_orders
required

Refunded orders.

number
revenue_orders
required

Orders that count towards revenue.

number
total_spent
required

Total spent across revenue orders, in the store currency.

number
avg_order_value
required

Average value of a revenue order, in the store currency.

number
first_order_date
required

Date of the first order, or null.

string
nullable
last_order_date
required

Date of the latest order, or null.

string
nullable
days_since_last_order
required

Days since the latest order, or null.

number
nullable
linked_guest_orders
required

Guest orders linked to the customer by email.

number
account
required

The sign-in account.

object
has_account
required

Whether the customer has a sign-in account.

boolean
email_verified
required

Whether the account’s email is verified.

boolean
providers
required

Sign-in methods linked to the account, such as password or google.

Array<string>
last_login_at
required

When the customer last signed in, or null.

string
nullable
failed_login_attempts
required

Failed sign-in attempts since the last success.

number
locked_until
required

When the account is locked until, or null when it is not locked.

string
nullable
active_session_count
required

Number of active sessions.

number
sessions

The active sessions, with IP address and user agent. Returned to API keys and to owners and admins; left out for other staff.

Array<object>
object
id
required

Session ID.

number
created_at
required

When the session started, as an ISO 8601 timestamp.

string
last_used_at
required

When the session was last used, or null.

string
nullable
expires_at
required

When the session expires, as an ISO 8601 timestamp.

string
ip_address
required

IP address the session was opened from, or null.

string
nullable
user_agent
required

Browser or app that opened the session, or null.

string
nullable
addresses
required

Saved addresses.

Array<object>
object
id
required

Address ID.

number
customer_id
required

ID of the customer the address belongs to.

number
label

A short label such as Home or Office, or null.

string
nullable
recipient_name
required

Name of the person receiving deliveries.

string
phone_number
required

Contact phone number.

string
address_line1
required

First address line.

string
address_line2

Second address line, or null.

string
nullable
ward
required

Ward code.

string
ward_name

Ward name, when it can be resolved from the code.

string
district

District, or null.

string
nullable
city

City, or null.

string
nullable
province
required

Province code.

string
province_name

Province name, when it can be resolved from the code.

string
postal_code

Postal code, or null.

string
nullable
country
required

Country code.

string
is_default
required

Whether this is the customer’s default address.

boolean
created_at
required

When the address was created, as an ISO 8601 timestamp.

string
updated_at
required

When the address was last updated, as an ISO 8601 timestamp.

string
counts
required

Totals for the lists above.

object
orders
required

Orders placed.

number
addresses
required

Saved addresses.

number

Example

{
"status": "active",
"activity_state": "active"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}