Skip to content
Browse documentation

API reference

Customers

Register and log in project-scoped storefront customers, manage their addresses, and read their order history. Customer accounts are per project and are never the same as Webtools dashboard accounts.

Feature requirement: the project must have the commerce feature enabled, or these endpoints return 404.

  • POST …/customers/login and …/customers/register return a customer access token.
  • Send that token as Authorization: Bearer on every /customers/me/* route.
POST/api/v1/storefront/projects/{project_slug}/customers/login

Login Customer

Parameters
NameTypeInDescription
project_slugstringpathRequired.
Request body · CustomerLogin
FieldTypeDescription
emailstring<email>required—
passwordstringrequired—
Response 200 · CustomerAuthResponse
FieldTypeDescription
access_tokenstringrequired—
token_typestringoptional—
customerCustomerReadrequired—
Example request
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/your-project/customers/login" \
  -H "X-Project-Key: wt_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "email": "…", "password": "…" }'
POST/api/v1/storefront/projects/{project_slug}/customers/me/addresses

Create Address

Parameters
NameTypeInDescription
project_slugstringpathRequired.
Request body · AddressCreate
FieldTypeDescription
labelstring (nullable)optional—
first_namestringrequired—
last_namestringrequired—
phone_numberstringrequired—
address_line_1stringrequired—
address_line_2string (nullable)optional—
citystringrequired—
statestring (nullable)optional—
postal_codestring (nullable)optional—
country_codestringoptional—
is_defaultbooleanoptional—
Response 201 · AddressRead
FieldTypeDescription
labelstring (nullable)optional—
first_namestringrequired—
last_namestringrequired—
phone_numberstringrequired—
address_line_1stringrequired—
address_line_2string (nullable)optional—
citystringrequired—
statestring (nullable)optional—
postal_codestring (nullable)optional—
country_codestringoptional—
is_defaultbooleanoptional—
idstringrequired—
project_idstringrequired—
customer_idstringrequired—
created_atstring<date-time>required—
updated_atstring<date-time>required—
Example request
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/your-project/customers/me/addresses" \
  -H "X-Project-Key: wt_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "first_name": "…", "last_name": "…", "phone_number": "…", "address_line_1": "…", "city": "…" }'
GET/api/v1/storefront/projects/{project_slug}/customers/me/orders

Customer Orders

Parameters
NameTypeInDescription
project_slugstringpathRequired.
Response 200 (list) · OrderRead[]
FieldTypeDescription
idstringrequired—
project_idstringrequired—
customer_idstring (nullable)required—
emailstringrequired—
statusOrderStatusrequired—
payment_statusPaymentStatusrequired—
currencystringrequired—
subtotal_minorintegerrequired—
discount_minorintegerrequired—
shipping_minorintegerrequired—
tax_minorintegerrequired—
total_minorintegerrequired—
discount_codestring (nullable)required—
shipping_method_namestring (nullable)required—
shipping_addressobjectrequired—
billing_addressobjectrequired—
notesstring (nullable)required—
itemsOrderItemRead[]required—
created_atstring<date-time>required—
updated_atstring<date-time>required—
Example request
curl "https://api.webtools.ng/api/v1/storefront/projects/your-project/customers/me/orders" \
  -H "X-Project-Key: wt_pk_your_key"
POST/api/v1/storefront/projects/{project_slug}/customers/register

Register Customer

Parameters
NameTypeInDescription
project_slugstringpathRequired.
Request body · CustomerRegister
FieldTypeDescription
emailstring<email>required—
passwordstringrequired—
first_namestring (nullable)optional—
last_namestring (nullable)optional—
phone_numberstring (nullable)optional—
accepts_marketingbooleanoptional—
Response 201 · CustomerAuthResponse
FieldTypeDescription
access_tokenstringrequired—
token_typestringoptional—
customerCustomerReadrequired—
Example request
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/your-project/customers/register" \
  -H "X-Project-Key: wt_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "email": "…", "password": "…" }'

← All resource groups