Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / CreateOrderInput

Interface: CreateOrderInput

The create-order body the server accepts.

An order is either a basket or a single product, never neither: items[] supersedes the flat productId/productName/pricePerUnit, and without items[] all three are required. The server re-checks every rule (bounds, sellability, OTP/Turnstile proof, checkout-form policy) — this type states what may travel, not what will be accepted.

phone may be any shape a shopper types; the server normalises it to the canonical local 05XXXXXXXX form before deduplicating customers.

Properties

address?

optional address?: string


checkoutKey?

optional checkoutKey?: string

The checkout attempt's key, a UUID (bindCheckoutKey). The same key again answers with the order it placed, exactly as the first time; for another phone it fails with CHECKOUT_KEY_IN_USE. Without it, every call places an order.


communeId

communeId: string


couponCode?

optional couponCode?: string

The code the shopper typed. An order whose code does not apply is refused whole (couponRefusalOf).


customerName

customerName: string


customFieldResponses?

optional customFieldResponses?: string | unknown[]

Answers to the merchant's custom checkout fields, keyed by field id.


deliveryType?

optional deliveryType?: "home" | "stop_desk"


email?

optional email?: string


fbc?

optional fbc?: string

Meta click/browser cookies captured at placement time.


fbp?

optional fbp?: string


items?

optional items?: CreateOrderItemInput[]


landingPageSlug?

optional landingPageSlug?: string

Landing-page attribution — best-effort; an unknown slug never blocks.


notes?

optional notes?: string


offerId?

optional offerId?: string


otpToken?

optional otpToken?: string

WhatsApp OTP proof — required only while the store has OTP enabled.


phone

phone: string


pricePerUnit?

optional pricePerUnit?: number

Display-only, like the basket line's.


productId?

optional productId?: string

The one product a direct order form was rendered for.


productName?

optional productName?: string


quantity?

optional quantity?: number


turnstileToken?

optional turnstileToken?: string

Cloudflare Turnstile proof — required only while Turnstile is enabled.


variantId?

optional variantId?: string


variantLabel?

optional variantLabel?: string


variantSelections?

optional variantSelections?: CreateOrderVariantSelection[]


wilayaId

wilayaId: number