Customer Auth & Addresses
Visibility
POST /auth/signup— PublicPOST /auth/login— PublicGET /auth/me— AuthenticatedGET /customers/me— Public storefront customer contextPOST /auth/me/addresses— AuthenticatedPATCH /auth/me/addresses/{address_id}/default— AuthenticatedDELETE /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
| Field | Type | Required |
|---|---|---|
email | string | Yes |
password | string | Yes |
full_name | string | Yes |
phone | string? | No |
Response
AuthResponse containing token and customer user object.
POST /auth/login
Request Body
| Field | Type | Required |
|---|---|---|
email | string | Yes |
password | string | Yes |
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
| Field | Type | Required |
|---|---|---|
line1 | string | Yes |
city | string | Yes |
state | string | Yes |
country | string | Yes |
postal_code | string | Yes |
phone | string | Yes |
label | string? | No |
is_default | boolean? | 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
| Status | Scenario |
|---|---|
401 | Invalid credentials or token |
404 | Customer or address not found |
409 | Email already registered in this store |
422 | Request validation failure |
500 | Auth service failure |