Storefront rules
The store settings, security rules, and API behaviour that a custom storefront must handle, and the go-live checklist
Read this page before you build. It lists what the API does not do for you.
Security
- Keep the client secret on your server. Do not put it in browser code, mobile applications, or a repository.
- Call the Auth API from your server only.
- Verify an access token (signature, issuer, expiry) before you trust its claims. Refer to Access tokens.
- Access tokens are valid for 9 hours and cannot be revoked. Store them carefully.
Store settings that you must apply
Your storefront must apply the settings of the store. The API does not apply all of them for you. The settings come from GET /operator.
| Setting | What your storefront must do |
|---|---|
loginStage | If it is BEFORE_PRICE, ask for sign-in before uploads and prices. |
maximumFileSize | Reject larger part files before the upload. |
| Payment methods | Show only the methods that the store and the customer type permit. Refer to Choose the payment methods. |
purchasability.canBePurchased | If it is false, offer "request a quote", not payment. |
termsOfServiceLink | Show the link where customers upload files and sign in. |
Store settings
GET /operator (Public) returns the settings of your store:
| Field | Type | Meaning and what to do |
|---|---|---|
name | string | Your store name |
currency | string | Default currency |
acceptedCurrencies | string[] | Currencies that a customer can select. Send the selected one in price and order calls. |
country | string | Country of the store (ISO alpha-2) |
loginStage | BEFORE_PRICE | AFTER_PRICE | BEFORE_PRICE: ask for sign-in before the visitor uploads parts or sees prices. AFTER_PRICE: guests can upload and see prices; sign-in is necessary to order. Your storefront must apply this rule. |
loginMethod | EMAIL | PHONE | ANY | The sign-in identifier that the store prefers. New customers always sign up with an email address. |
paymentProvider | string | STRIPE, PAYPAL, PAYPAL_SINGLE_PARTY, RAZORPAY_SINGLE_PARTY, FLYWIRE, or NONE. NONE means no online payment. |
isPayByInvoiceEnabled | boolean | Offer "pay by invoice" |
isPayByPurchaseOrderEnabled | boolean | Offer "pay by purchase order" |
maximumFileSize | number | null | Maximum size of an uploaded part file, in megabytes. Check this in your storefront before the upload. |
termsOfServiceLink | string | null | Show this link where the customer uploads files and signs in |
landingPageMessage | string | null | A message from the manufacturer for the first page |
videoLink | string | null | A help video |
storefrontTheme | SYSTEM | LIGHT | DARK | The colour mode that the manufacturer prefers |
isTaxIDEnabled | boolean | Show a tax ID field on addresses |
isInvoiceDownloadEnabled | boolean | If false, the invoice PDF is not available (403) |
isCustomerLineItemDeletionEnabled | boolean | Customers can remove lines from a quote |
isOrientationConstraintEnabled | boolean | Offer "keep my part orientation" |
Store rules that are not in the settings
These rules reach you through the price calls and the Auth API:
| Store rule | Where you see it |
|---|---|
| Minimum order amount | quote.topUp (an added amount) |
| Maximum order amount | purchasability.withinMaximumOrderValue |
| Manual price review, quote-only materials | purchasability.canBePurchased, isPriceReviewRequired, isMaterialPurchasable, isPostProcessingPurchasable |
| Approval of new customers | WAIT_FOR_APPROVAL from the Auth API |
Processes and options
GET /operator/processes (Public) returns the processes of the store, each with its materials, colours, infills, precisions, and post-processings. If you send a customer token, the list can be specific to that customer's organisation.
- The
idof a process is theprocessPricesIdin later calls. - A material with
quoteOnly: true, or a post-processing withpurchasable: false, has no instant purchase. Offer "request a quote". - Do not offer a post-processing with the materials in its
incompatibleMaterialIds. - Offer one post-processing only from each
mutuallyExclusiveGroup.
Other store data
GET /operator/lead-times(Public): do not offer lead times that haveisDeleted: true.GET /operator/shipping-methods(Customer): the shipping methods. Refer to Select an address and shipping.GET /countries(Public) andGET /countries/{country}/jurisdictions(Customer): the values for addresses.GET /operator/logo(Public): the logo of the store as bytes.400if the store has no logo.
Differences from what you possibly expect
| Behaviour | Details |
|---|---|
| There is no OAuth redirect and no hosted login page. | You build the login screens. Refer to Authentication. |
| There is no refresh token and no sign-out endpoint. | Refer to Lifetime, refresh, and sign-out. |
| Part files must be compressed with gzip before the upload. | Refer to Upload parts. |
| The analysis result is MessagePack, and you can read it one time only. | Refer to Read the analysis result. |
| A guest cannot read a cart back. | Keep the cart ID and the items in your storefront. |
| A cart contains no prices. | Prices come from POST /pre-order. Refer to Get a price. |
| A quote and an order are one resource. | state changes from QUOTE to ORDER. |
| There are no webhooks or push channels for customers. | Poll for status. Refer to Order tracking. |
Go-live checklist
Credentials and tokens
- Separate storefront credentials for each environment.
- The client secret is in a secret store, not in the code.
- The client secret is only in server-side environment variables.
- All Auth API calls come from your server.
- You verify tokens (signature, issuer, expiry) before you trust claims.
- Session cookies are
HttpOnlyandSecure.
Sign-in
- Sign-up and sign-in handle
WAIT_FOR_APPROVAL. - Sign-in handles
["PASSWORD", "OTP"](two factors). - You handle
429responses. - The guest cart is claimed after sign-in and after sign-up.
- An expired token (
401) sends the customer to sign-in, or gets a new guest token. - You sign the customer out when the token expires.
Store settings and checkout
- The storefront applies
loginStageandmaximumFileSize. - Checkout handles
canBePurchased: falseand lines with no instant price. - Error handling reads the HTTP status and the
errorcode.
Last updated on