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.

Required access
Send
  • Publishable keyX-Lynkow-Pk
Optional: customer session tokenSite access
POST/checkout
Base URLhttps://api.lynkow.com/storefront/{siteId}

Header parameters

X-Lynkow-Cart-Token
string

Guest cart secret returned when the cart was created. Omit for an authenticated customer checkout.

Request body

  • _hp
    string

    Spam-trap field that must remain empty when the site uses honeypot protection.

  • _ts
    integer

    Form-load Unix timestamp in milliseconds when the site uses honeypot protection.

  • acceptsTerms
    boolean

    Must be `true`, else 422 `TERMS_NOT_ACCEPTED`. A site without a terms page refuses every request with 422 `TERMS_PAGE_NOT_CONFIGURED`

  • address
    object

    Optional delivery or collection address snapshot.

    • address1
      string

      Primary street address.

    • address2
      string

      Additional street address details.

    • addressName
      string

      Buyer label for the address.

    • city
      string

      City or locality.

    • company
      string

      Recipient company name.

    • countryCode
      string

      ISO 3166-1 alpha-2 country code, normalized to uppercase.

    • firstName
      string

      Recipient given name.

    • lastName
      string

      Recipient family name.

    • phone
      string

      Recipient phone number.

    • postalCode
      string

      Postal or ZIP code.

    • province
      string

      Province, state, or region.

  • contact
    object

    Optional buyer contact snapshot for this order.

    • name
      string

      Buyer contact name.

    • phone
      string

      Buyer contact phone number.

  • email
    string

    Guest receipt email. Optional for an authenticated customer.

  • expectedTotalCents
    integer

    The total shown to the buyer, in minor units. Any other total returns 422 `TOTAL_CHANGED`. Optional.

  • fulfillmentMode
    enum

    How the order is fulfilled: `delivery`, the default, or `pickup`, collected at the merchant's premises with no shipping charge.

    One of: deliverypickup

  • locale
    string

    Buyer 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.

  • paymentFlow
    enum

    How 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: hostedembedded

  • paymentMethod
    enum

    Payment 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_collectcard

  • recaptchaToken
    string

    Verification token when the site uses reCAPTCHA spam protection. For v3 checkout, mint it with the `checkout` action.

  • shippingOptionId
    string

    A shipping option (prefixed `shp_`) from `GET /shipping-options` for the delivery country. Omit it to use the cart option.

Feedback

Was this page helpful?