Wocart

@wocart/storefront v3.1.0


@wocart/storefront / astro / executePlaceOrder

Function: executePlaceOrder()

executePlaceOrder(input, request, client): Promise<PlaceOrderResult>

Execute the placeOrder action's handler body: enforce the basket-or-product rule, forward attribution headers, and submit the order.

The parsed input IS the wire body: placeOrderInput is a whitelist whose keys match the server's create-order body 1:1, so a second hand-written field list would be one more thing to drift.

Parameters

input

address?

string

checkoutKey?

string

communeId

string

couponCode?

string

customerName

string

customFieldResponses?

string | unknown[]

deliveryType

"home" | "stop_desk"

email?

string

fbc?

string

fbp?

string

items?

object[]

landingPageSlug?

string

notes?

string

offerId?

string

otpToken?

string

phone?

string

pricePerUnit?

number

productId?

string

productName?

string

quantity

number

turnstileToken?

string

variantId?

string

variantLabel?

string

variantSelections?

object[]

wilayaId

number

request

Request

client

cart

CartNamespace

categories

CategoriesNamespace

collections

CollectionsNamespace

config

ConfigNamespace

geo

GeoNamespace

MenusNamespace

orders

OrdersNamespace

pageData

PageDataNamespace

pages

PagesNamespace

products

ProductsNamespace

shipping

ShippingNamespace

Returns

Promise<PlaceOrderResult>