@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?
optionaladdress?:string
checkoutKey?
optionalcheckoutKey?: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?
optionalcouponCode?:string
The code the shopper typed. An order whose code does not apply is refused whole (couponRefusalOf).
customerName
customerName:
string
customFieldResponses?
optionalcustomFieldResponses?:string|unknown[]
Answers to the merchant's custom checkout fields, keyed by field id.
deliveryType?
optionaldeliveryType?:"home"|"stop_desk"
email?
optionalemail?:string
fbc?
optionalfbc?:string
Meta click/browser cookies captured at placement time.
fbp?
optionalfbp?:string
items?
optionalitems?:CreateOrderItemInput[]
landingPageSlug?
optionallandingPageSlug?:string
Landing-page attribution — best-effort; an unknown slug never blocks.
notes?
optionalnotes?:string
offerId?
optionalofferId?:string
otpToken?
optionalotpToken?:string
WhatsApp OTP proof — required only while the store has OTP enabled.
phone
phone:
string
pricePerUnit?
optionalpricePerUnit?:number
Display-only, like the basket line's.
productId?
optionalproductId?:string
The one product a direct order form was rendered for.
productName?
optionalproductName?:string
quantity?
optionalquantity?:number
turnstileToken?
optionalturnstileToken?:string
Cloudflare Turnstile proof — required only while Turnstile is enabled.
variantId?
optionalvariantId?:string
variantLabel?
optionalvariantLabel?:string
variantSelections?
optionalvariantSelections?:CreateOrderVariantSelection[]
wilayaId
wilayaId:
number