Skip to content
Coritan Docs

Organization API: Customers: Store

The 7 Organization API operations for store.

View as Markdown

Part of Customers.

Method Path Summary
GET /api/v1/orgs/{org_slug}/store/customers/me Get me
PATCH /api/v1/orgs/{org_slug}/store/customers/me Name, phone, marketing consent (the shopper alone turns it on) and VAT id
GET /api/v1/orgs/{org_slug}/store/customers/me/addresses The signed-in shopper's saved addresses, oldest first
POST /api/v1/orgs/{org_slug}/store/customers/me/addresses Add my address
PATCH /api/v1/orgs/{org_slug}/store/customers/me/addresses/{address_id} Update my address
DELETE /api/v1/orgs/{org_slug}/store/customers/me/addresses/{address_id} Delete my address
GET /api/v1/orgs/{org_slug}/store/customers/me/orders List my orders

GET /api/v1/orgs/{org_slug}/store/customers/me

The signed-in shopper's account: id, email, first_name, last_name, phone, accepts_marketing, marketing_consent_at, vat_id and created_at.

marketing_blocked is null, or the reason the store cannot email this address: bounced (mail to it bounced), complained (it was reported as spam) or manual (the store turned it off). The shopper cannot undo any of these. While it is set, accepts_marketing reads false and PATCH .../customers/me with accepts_marketing true answers 409 marketing_blocked, so a storefront can hide the opt-in and tell the shopper to ask the store's support instead. A shopper who unsubscribed on their own has it null and can opt in again.

Name In Type Required
org_slug path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Name, phone, marketing consent (the shopper alone turns it on) and VAT id

Section titled Name, phone, marketing consent (the shopper alone turns it on) and VAT id

PATCH /api/v1/orgs/{org_slug}/store/customers/me

Name, phone, marketing consent (the shopper alone turns it on) and VAT id. Answers the account as GET .../customers/me does.

accepts_marketing true also lifts the shopper's own unsubscribe from the store's list. When the store cannot email the address for a reason the shopper cannot lift (marketing_blocked is set: mail to it bounced, it was reported as spam, or the store turned it off), the whole request answers 409 marketing_blocked with the reason and a message that says to ask the store's support. Nothing in the request is applied, so a name sent in the same request is not saved either. accepts_marketing false always works.

Name In Type Required
org_slug path string yes

application/json (required)

Field Type Required
first_name string or null no
last_name string or null no
phone string or null no
accepts_marketing boolean or null no
vat_id string or null no
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

The signed-in shopper's saved addresses, oldest first

Section titled The signed-in shopper's saved addresses, oldest first

GET /api/v1/orgs/{org_slug}/store/customers/me/addresses

The signed-in shopper's saved addresses, oldest first.

An account keeps at most 50 addresses, so the first page holds them all. count is how many the shopper has saved.

Name In Type Required Description
org_slug path string yes
limit query integer no How many addresses to return, 1–200. The default is 200. Default: 200.
offset query integer no How many addresses to skip, for the next page. count in the answer says how many there are in all. Default: 0.
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

POST /api/v1/orgs/{org_slug}/store/customers/me/addresses

An address needs address_1, city and country_code; the first one saved is the default for shipping and billing.

Name In Type Required
org_slug path string yes

application/json (required)

Field Type Required
first_name string or null no
last_name string or null no
company string or null no
address_1 string or null no
address_2 string or null no
city string or null no
province string or null no
postal_code string or null no
country_code string or null no
phone string or null no
is_default_shipping boolean or null no
is_default_billing boolean or null no
metadata object or null no
Status Meaning
201 Success.
422 The request is not valid. detail lists each problem.

PATCH /api/v1/orgs/{org_slug}/store/customers/me/addresses/{address_id}

Name In Type Required
address_id path integer yes
org_slug path string yes

application/json (required)

Field Type Required
first_name string or null no
last_name string or null no
company string or null no
address_1 string or null no
address_2 string or null no
city string or null no
province string or null no
postal_code string or null no
country_code string or null no
phone string or null no
is_default_shipping boolean or null no
is_default_billing boolean or null no
metadata object or null no
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

DELETE /api/v1/orgs/{org_slug}/store/customers/me/addresses/{address_id}

Name In Type Required
address_id path integer yes
org_slug path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

GET /api/v1/orgs/{org_slug}/store/customers/me/orders

The signed-in shopper's orders in the key's mode, newest first, with count across every page.

view=summary, the default, answers a short row for each order. view=detail answers each order in full, exactly as GET .../store/orders/{order_id} does, so an order history page that shows items, shipping and refunds needs one call for up to 100 orders. display_id finds one order by its number. The filter, the order, count and the paging are the same in both views. An unknown view answers 422 invalid_view with the words it takes in allowed.

Each order's display_status is canceled, refunded, on_hold, completed or processing.

Name In Type Required Description
org_slug path string yes
limit query integer no How many orders to return, 1–100. The default is 20. Default: 20.
offset query integer no How many orders to skip, for the next page. count in the answer says how many there are in all. Default: 0.
display_id query integer or null no An order number, such as 1042: only the shopper's own order with exactly that number, in the same list shape; an empty list when they have none.
view query string no summary (the default) answers a short row for each order. detail answers each order in full, exactly as GET .../store/orders/{order_id} does, so one call fetches a page of orders with their items, shipping, refunds and timeline. Any other word answers 422 invalid_view. Default: summary.
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.