Skip to content

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.

  1. POST /customer/auth/code with { email }. Sevigram emails a one-time code. The answer is 202 whether or not the email has orders, so it doesn’t reveal who’s a customer.
  2. POST /customer/auth/verify with { email, code }. The answer is 200 with session_token, expires_at and customer. A wrong or expired code is 401 customer_code_invalid.

Both are limited to 5 a minute per shopper IP and per email.

Send the session on every other customer route:

Authorization: Bearer sfprv_…
X-Sevigram-Customer-Session: <session_token>
X-Sevigram-Buyer-IP: 203.0.113.7

A 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.

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.

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.

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.