API Reference
Storefront API (Public)
Customer Auth & Addresses

Customer Auth & Addresses

Visibility

  • POST /auth/signupPublic
  • POST /auth/loginPublic
  • GET /auth/meAuthenticated
  • GET /customers/mePublic storefront customer context
  • POST /auth/me/addressesAuthenticated
  • PATCH /auth/me/addresses/{address_id}/defaultAuthenticated
  • DELETE /auth/me/addresses/{address_id}Authenticated

Authentication Modes

Public auth entrypoints

x-api-key: sk_eco_...

Authenticated customer endpoints

Authorization: Bearer <jwt>

POST /auth/signup

Request Body

FieldTypeRequired
emailstringYes
passwordstringYes
full_namestringYes
phonestring?No

Response

AuthResponse containing token and customer user object.

POST /auth/login

Request Body

FieldTypeRequired
emailstringYes
passwordstringYes

Response

AuthResponse containing token and customer user object.

GET /auth/me

Returns current authenticated customer profile.

GET /customers/me

Returns current customer context from storefront flow where customer identity is already resolved by storefront session logic.

Address Book Operations

POST /auth/me/addresses

FieldTypeRequired
line1stringYes
citystringYes
statestringYes
countrystringYes
postal_codestringYes
phonestringYes
labelstring?No
is_defaultboolean?No

PATCH /auth/me/addresses/{address_id}/default

Sets one address as default.

DELETE /auth/me/addresses/{address_id}

Deletes one address.

cURL

curl -X POST "https://api.ecommaps.com/api/v1/storefront/auth/signup" \
  -H "x-api-key: sk_eco_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"customer@example.com","password":"StrongPass123","full_name":"Customer"}'
 
curl -X GET "https://api.ecommaps.com/api/v1/storefront/auth/me" \
  -H "Authorization: Bearer <jwt>"

SDK Example

const auth = await ecommapsClient.auth.login({
  email: "customer@example.com",
  password: "StrongPass123",
});
 
await ecommapsClient.auth.addAddress(
  {
    line1: "Address line",
    city: "Algiers",
    state: "Algiers",
    country: "DZ",
    postal_code: "16000",
    phone: "0555000000",
  },
  { headers: { Authorization: `Bearer ${auth.token}` } },
);

Error Matrix

StatusScenario
401Invalid credentials or token
404Customer or address not found
409Email already registered in this store
422Request validation failure
500Auth service failure