Customer accounts
Customers can sign in to your storefront with their email and a one-time code. Once signed in, they can see their orders and bookings, quotes and invoices, and deliverables, accept or decline quotes, and check out as themselves.
Sign in
Section titled “Sign in”POST /customer/auth/codewith{ email }. Sevigram emails a one-time code. The answer is202whether or not the email has orders, so it doesn’t reveal who’s a customer.POST /customer/auth/verifywith{ email, code }. The answer is200withsession_token,expires_atandcustomer. A wrong or expired code is401 customer_code_invalid.
Both are limited to 5 a minute per shopper IP and per email.
Use the session
Section titled “Use the session”Send the session on every other customer route:
Authorization: Bearer sfprv_…X-Sevigram-Customer-Session: <session_token>X-Sevigram-Buyer-IP: 203.0.113.7A missing, expired or other-shop session is 401 customer_session_invalid. Treat the shopper as signed out.
The session token is a credential:
- keep it only in an HttpOnly, Secure cookie;
- never put it in a URL, browser storage or page data;
- never log it.
POST /customer/auth/logout ends the session and returns 204.
Routes
Section titled “Routes”| Route | Returns |
|---|---|
GET /customer/session |
The signed-in customer’s first name and email. |
GET /customer/profile |
Name, email, phone and last address. |
GET /customer/orders |
Orders and bookings, newest first, paged. |
GET /customer/orders/{id} |
One order with its deliverables and booking progress. |
GET /customer/documents |
Issued quotes and invoices, newest first, at most 100. Filter with ?type=quote or ?type=invoice. |
GET /customer/documents/{id} |
One quote or invoice with its lines. |
GET /customer/documents/{id}/pdf |
The document as a PDF. |
POST /customer/documents/{id}/response |
Accept or decline a quote: { action: "accept" | "decline", note? }. A quote that can’t be answered any more is 409 quote_not_respondable. |
GET /customer/deliverables |
Shared deliverables, newest first, at most 100. |
Another customer’s or another shop’s records are 404. Customer responses are never cached.
Checkout as the customer
Section titled “Checkout as the customer”Send X-Sevigram-Customer-Session on POST /checkouts, with the private token, to attribute the order to the signed-in customer. See Checkout and orders.
Demo shop
Section titled “Demo shop”The read-only demo shop serves sample data. Sign in as [email protected] and use the demo_code returned by POST /customer/auth/code. The demo also accepts its public token on customer routes.