Customers
Customer authentication via OTP and profile management. Customers are auto-created on first authentication.
There is no separate customer creation endpoint. Customers are created automatically when they first authenticate via OTP.
POST
/api/v1/auth/otp/requestRequest OTP
Sends a one-time password to the customer's email or phone.
Request Body
| Field | Type | Description |
|---|---|---|
contact | string | Email address or phone number (required) |
contact_type | string | "email" or "phone" (required) |
Example Request
curl
curl -X POST https://storefront.cimplify.io/api/v1/auth/otp/request \
-H "X-API-Key: pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"contact": "jane@example.com",
"contact_type": "email"
}'POST
/api/v1/auth/otp/verifyVerify OTP
Verifies the OTP code. On success, creates a session and auto-creates the customer if they don't exist.
Request Body
| Field | Type | Description |
|---|---|---|
contact | string | Same email/phone used in request (required) |
contact_type | string | "email" or "phone" (required) |
otp_code | string | The OTP code (required) |
Example Request
curl
curl -X POST https://storefront.cimplify.io/api/v1/auth/otp/verify \
-H "X-API-Key: pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"contact": "jane@example.com",
"contact_type": "email",
"otp_code": "123456"
}'GET
/api/v1/auth/statusGet Auth Status
Check if the current session is authenticated.
GET
/api/v1/auth/userGet Current User
Example Response
JSON
{
"success": true,
"data": {
"id": "cust_abc123",
"name": "Jane Smith",
"email": "jane@example.com",
"phone": "+1234567890"
}
}PATCH
/api/v1/auth/profileUpdate Profile
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Customer name |
email | string | Email address |
phone | string | Phone number |
Example Request
curl
curl -X PATCH https://storefront.cimplify.io/api/v1/auth/profile \
-H "X-API-Key: pk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe"
}'POST
/api/v1/auth/logoutLogout
Ends the current session.
Example Request
curl
curl -X POST https://storefront.cimplify.io/api/v1/auth/logout \
-H "X-API-Key: pk_test_your_api_key"