Checkout and payment
Claim the guest cart, select shipping, create the order, take payment, and follow the order
All calls on this page need a customer token. Paths and shell variables are as in Before you start.
1. Claim the guest cart
Sign the customer in through the Auth API. Refer to Sign-in and Sign-up.
Then move the guest's parts and carts to the customer. Send the customer token as the Bearer token, and the guest token in the body:
curl -X PATCH "$API/cart/$CART_ID/claim" \
-H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN" -H "Content-Type: application/json" \
-d "{ \"anonymousSessionToken\": \"$GUEST_TOKEN\" }"Response 204. One call moves all parts and all open carts of that guest to the customer.
| Status | Meaning |
|---|---|
404 | The cart does not exist, or it is not a cart of this guest |
409 | The cart is already claimed, or it is not open. If your customer already owns the cart, continue. |
After the claim, discard the guest token. From this point, use the customer token for all calls.
2. Select an address and shipping
# Addresses of the customer's organisation
curl "$API/address" -H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN"
# Shipping methods of the store
curl "$API/operator/shipping-methods" -H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN"
# Rates for delivery to an address
curl -X POST "$API/shipping/rate" \
-H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN" -H "Content-Type: application/json" \
-d '{
"currency": "EUR",
"toAddressId": 123,
"parts": [
{ "partRevisionId": "…", "units": "MILLIMETERS", "quantity": 1, "processPricesId": "…", "materialId": 12 }
]
}'A shipping method has a shippingMode:
| Mode | What the customer selects | shipping object for the order |
|---|---|---|
SELF_COLLECTION | Collection from the manufacturer. No address. | { "shippingMode": "SELF_COLLECTION", "shippingMethodId": 3 } |
FIXED_PRICE | A rate from POST /shipping/rate | { "shippingMode": "FIXED_PRICE", "shippingMethodId": 7, "rateId": "…", "toAddressId": 123 } |
CUSTOMER_ACCOUNT | Delivery on the customer's own carrier account | { "shippingMode": "CUSTOMER_ACCOUNT", "shippingMethodId": 9, "toAddressId": 123, "accountNumber": "…" } |
To create an address, POST /address with all fields. Use an empty string for text fields that the customer leaves empty. There is no call to change an address: create a new one. country is the country value from GET /countries, and jurisdictionIsoCode is the iso value from GET /countries/{country}/jurisdictions. For all address and shipping fields, refer to the Customer API reference (EU) or the US reference.
3. Get the final price
Call POST /pre-order again. This time, include shipping and billingAddressId. The quote then includes shipping and the correct tax.
4. Create the order
POST /order uses the same body as POST /pre-order, plus cartId and intent.
curl -X POST "$API/order" \
-H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN" -H "Content-Type: application/json" \
-d '{ …the pre-order body…, "cartId": "…", "intent": "CHECKOUT" }'- The API calculates the price again. It does not trust a price from the client.
- The new order has
"state": "QUOTE"and"paymentStatus": "UNPAID". It becomes anORDERwhen the customer pays or accepts. - If you give a
cartId, the cart must be open. After the call, the cart status isCONVERTED. - Send
"intent": "CHECKOUT"when the customer continues to payment immediately. Without it, the customer gets a "your quote is ready" notification. Omit it for a "save as quote" button.
Response:
{
"order": { "id": 4711, "state": "QUOTE", "paymentStatus": "UNPAID", "quoteNumber": "Q-1042", "price": 54.2, "currency": "EUR", "threadId": 880 },
"requisitionMapping": { "7b0c1a52-0d1e-4b0c-8f5e-0c6a1c0f3e11": { "id": 9001, "orderId": 4711 } }
}5. Check that the order can be paid
curl "$API/order/$ORDER_ID/purchasability" -H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN"If canBePurchased is false, the manufacturer must review the quote first.
6. Choose the payment methods
There are three ways to pay. Which ones you show depends on the store settings and on the customer type (GET /customer, field customerType).
| Method | Show it when | Call |
|---|---|---|
| Online payment | paymentProvider is not NONE, and customerType is not INTERNAL | POST /order/{id}/payment |
| Pay by invoice | isPayByInvoiceEnabled is true, or customerType is ACCOUNT | PATCH /order/{id}/payment/invoice |
| Pay by purchase order | isPayByPurchaseOrderEnabled is true (and customerType is not INTERNAL), or customerType is ACCOUNT | PATCH /order/{id}/payment/purchase-order |
7. Take the payment
curl -X POST "$API/order/$ORDER_ID/payment" -H "X-Store-Name: $STORE" -H "Authorization: Bearer $CUSTOMER_TOKEN"The response contains the data for the payment provider of your store. For Stripe:
{
"id": "pi_…",
"provider": "STRIPE",
"clientSecret": "pi_…_secret_…",
"merchantAccount": "acct_…",
"finalPrice": 54.2,
"tax": 9.2,
"currency": "EUR",
"stripePaymentIntentStatus": "requires_payment_method"
}Complete the payment in the browser with the SDK of the provider. There is no "confirm" call to the Customer API. The provider tells Phasio about the result. Poll GET /order/{id} until paymentStatus is PROCESSING or PAID.
The provider fields depend on provider:
| Provider | id | clientSecret | paymentPrincipal | merchantAccount |
|---|---|---|---|---|
STRIPE | Payment intent ID | Payment intent client secret | - | Connected account ID of the store |
PAYPAL | PayPal order ID | - | PayPal order ID | Merchant ID of the store |
RAZORPAY_SINGLE_PARTY | Razorpay order ID | - | Razorpay order ID | Razorpay key ID |
FLYWIRE | - | - | - | - (open flywireGatewayUrl) |
Errors: 404 ORDER_NOT_FOUND; 400 INTERNAL_ORDER_NOT_PAYABLE; 400 ORDER_ERROR (also when the order cannot be paid).
To complete a Stripe or PayPal payment in your storefront, you need the Phasio platform key for the provider SDK. Contact Phasio support to get it.
8. Follow the order
There is no push channel. Poll GET /order/{id} with a customer token.
| Field | Meaning |
|---|---|
state | QUOTE or ORDER |
paymentStatus | UNPAID, PROCESSING, PAID, REFUNDED, EXTERNALLY_TRACKED |
isReviewRequired | The manufacturer must review the quote |
kanbanColumn.name | The production stage that the manufacturer shows |
shipping.expectedDispatchDate | Expected dispatch date |
shipments[].tracking | Carrier, tracking number, and tracking URL |
More calls
For the fields of these calls, refer to the Customer API reference (EU) or the US reference.
| Call | Returns |
|---|---|
GET /order | All quotes and orders of the customer's organisation |
GET /requisition?orderId={id} | The lines of an order |
GET /order/{id}/quote | The price breakdown |
GET /document/order/{id}/estimate, /confirmation, /invoice | PDF documents |
GET /activity/thread/{threadId}, POST /activity | The messages between the customer and the manufacturer |
Last updated on
Upload and price
Read the configuration options, upload a part, wait for the analysis, add the part to a cart, and get an instant price
API changes in the 31 October 2026 release
What scripts, automations and integrations that call the Phasio API need to update for the 31 October 2026 release, with a prompt for your AI coding agent