From product to first order
This tutorial connects the full Thor journey with a “Copenhagen Lamp” test fixture. Run Admin operations from a trusted service. Run payment steps only with a configured test gateway and test credentials; no live provider transaction is required by this documentation.
Prerequisites
- A project slug and Admin credential.
- A Storefront token if the project is protected.
- An active store with distribution, price, and supply channels.
- For custom checkout, a configured manual or provider test gateway and any required shipping/tax configuration.
If the store is not prepared, complete Configure a store first.
1. Create the draft product
Retain the returned product ID. Then follow Create and publish a product to add SKU LAMP-BLACK, its price and inventory, activate both product and variant, and publish both to the prepared distribution channel. Those dependent operations require IDs returned by earlier steps; do not replace them with invented values.
2. Verify the Storefront projection
Use copenhagen-lamp, the prepared IDs, EUR, and DK. Continue only when the variant has a price and availableForPurchase is true. Otherwise use the publication decision table.
3. Create the cart
Pass the store, price channel, EUR, DK, and the returned variant ID with quantity one. Persist the cart ID.
4. Complete checkout
The simplest verified path is to open checkoutUrl and complete with the project’s configured test payment method. For a custom experience, follow Build a cart and checkout: add address data, select a returned shipping rate when required, initialize a configured test payment session, then call cartComplete.
5. Verify the order
Request the order returned by completion and record its id and orderNumber. If the response is lost, repeat completion with the same cart ID: Thor returns the existing associated order for an already ordered cart. Confirm the order through the Admin order query before fulfillment.