Purchase flow
The sequence of Customer API calls from part upload to a paid order
This page shows every API call of a storefront, in order, from the first visit to a paid order. The store settings and configuration options need no token. Uploads, carts, and prices need a guest or customer token. Checkout, payment, and order tracking need a customer token. For examples, refer to Upload and price and Checkout and payment.
Before you start
All paths in the purchase flow are relative to:
<API_BASE>/api/customer/v1All examples use these shell variables:
API="$API_BASE/api/customer/v1"
STORE="your-store-name"
TOKEN="<access token from the Auth API>"If your store setting loginStage is BEFORE_PRICE, ask the visitor to sign in before the upload and skip the guest steps.
API flow
Each step lists its calls. Select a call to open its reference.
Read the store settings
curl "$API/operator" -H "X-Store-Name: $STORE"The response tells you how your store is configured: currencies, payment provider, login rules, maximum file size, and more. Your storefront must obey these settings. Refer to Store settings and Storefront rules.
Get a guest token
Your server calls the Auth API, so the visitor can upload before sign-in. Refer to Guest sessions.
Upload a part
Upload the file, wait for the analysis, and read the result once. Guide: Upload and price.
Add the part to a cart
Keep the configured part in a cart. Guide: Create a cart and add the part.
Get a price
Call again each time the configuration changes. Guide: Get a price.
Sign in and claim the guest cart
Sign the customer in, then move the guest's parts and carts to the customer. Guide: Sign-up and sign-in and Claim the guest cart.
Get the final price and create the order
Price again with shipping and the billing address, then create the order. Guide: Create the order.
Pay
Check that the order can be paid, then use one of the permitted methods. Guide: Choose the payment methods.
Follow the order
There is no push channel. Poll the order. Guide: Follow the order.
/order/{orderId}State, payment status, production stage, trackingCustomerGET/document/order/{orderId}/estimateQuote PDFCustomerGET/document/order/{orderId}/confirmationOrder confirmation PDFCustomerGET/document/order/{orderId}/invoiceInvoice PDFCustomerGET/activity/thread/{threadId}Messages with the manufacturerCustomerLast updated on