cimplify

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/request

Request OTP

Sends a one-time password to the customer's email or phone.

Request Body

FieldTypeDescription
contactstringEmail address or phone number (required)
contact_typestring"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/verify

Verify OTP

Verifies the OTP code. On success, creates a session and auto-creates the customer if they don't exist.

Request Body

FieldTypeDescription
contactstringSame email/phone used in request (required)
contact_typestring"email" or "phone" (required)
otp_codestringThe 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/status

Get Auth Status

Check if the current session is authenticated.

GET/api/v1/auth/user

Get Current User

Example Response

JSON
{
  "success": true,
  "data": {
    "id": "cust_abc123",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "phone": "+1234567890"
  }
}
PATCH/api/v1/auth/profile

Update Profile

Request Body

FieldTypeDescription
namestringCustomer name
emailstringEmail address
phonestringPhone 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/logout

Logout

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"