Place an order
Places an order from the caller's active cart and closes the cart. A guest sends `X-Lynkow-Cart-Token` and an `email`. When the site requires accounts, a guest gets 403 `ACCOUNT_REQUIRED`. A card payment returns `payment.checkoutUrl`. With `paymentFlow: 'embedded'` it returns what mounts the payment form in your page instead. A retry with the same `paymentFlow` while the payment is open returns the same response. Fires the `order.placed` webhook and sends a confirmation email. Errors (422): `TERMS_PAGE_NOT_CONFIGURED`, `TERMS_NOT_ACCEPTED`, `CART_EMPTY`, `OUT_OF_STOCK`, `DELIVERY_COUNTRY_REQUIRED`, `MARKET_COUNTRY_NOT_SERVED`, `PRODUCT_NOT_SOLD_IN_MARKET`, `SHIPPING_OPTION_INVALID`, `SHIPPING_UNAVAILABLE`, `TOTAL_CHANGED`, `DESTINATION_NOT_TAXABLE`, `TAX_RATE_UNAVAILABLE`, `CHECKOUT_TAX_DISABLED`, `PAYMENT_METHOD_UNAVAILABLE`, `PAYMENT_FLOW_UNAVAILABLE`. A refused checkout leaves the cart open. No cart returns 404 `CART_NOT_FOUND`, a completed cart 409 `CART_ALREADY_COMPLETED`, and a payment page that cannot open 503 `PAYMENT_CHECKOUT_UNAVAILABLE`. > **Note:** Available only on sites with e-commerce enabled.
/checkouthttps://api.lynkow.com/storefront/{siteId}Header parameters
X-Lynkow-Cart-TokenstringGuest cart secret returned when the cart was created. Omit for an authenticated customer checkout.
Request body
_hpstringSpam-trap field that must remain empty when the site uses honeypot protection.
_tsintegerForm-load Unix timestamp in milliseconds when the site uses honeypot protection.
acceptsTermsbooleanMust be `true`, else 422 `TERMS_NOT_ACCEPTED`. A site without a terms page refuses every request with 422 `TERMS_PAGE_NOT_CONFIGURED`
addressobjectOptional delivery or collection address snapshot.
address1stringPrimary street address.
address2stringAdditional street address details.
addressNamestringBuyer label for the address.
citystringCity or locality.
companystringRecipient company name.
countryCodestringISO 3166-1 alpha-2 country code, normalized to uppercase.
firstNamestringRecipient given name.
lastNamestringRecipient family name.
phonestringRecipient phone number.
postalCodestringPostal or ZIP code.
provincestringProvince, state, or region.
contactobjectOptional buyer contact snapshot for this order.
namestringBuyer contact name.
phonestringBuyer contact phone number.
emailstringGuest receipt email. Optional for an authenticated customer.
expectedTotalCentsintegerThe total shown to the buyer, in minor units. Any other total returns 422 `TOTAL_CHANGED`. Optional.
fulfillmentModeenumHow the order is fulfilled: `delivery`, the default, or `pickup`, collected at the merchant's premises with no shipping charge.
One of:
deliverypickuplocalestringBuyer language, never rejected. It becomes the order language when the cart has none, which sets the emails, terms and payment page. Unsupported email languages fall back to the base language (`pt-BR` to `pt`), then English.
paymentFlowenumHow a card order is paid: `hosted`, the default, returns `payment.checkoutUrl`; `embedded` returns what the in-page payment form needs. Ignored for other methods.
One of:
hostedembeddedpaymentMethodenumPayment method selected by the buyer. One of: on_site, cash_on_delivery, click_and_collect, card. Card requires online payment availability.
One of:
on_sitecash_on_deliveryclick_and_collectcardrecaptchaTokenstringVerification token when the site uses reCAPTCHA spam protection. For v3 checkout, mint it with the `checkout` action.
shippingOptionIdstringA shipping option (prefixed `shp_`) from `GET /shipping-options` for the delivery country. Omit it to use the cart option.