Wocart

@wocart/storefront v3.1.0


@wocart/storefront / astro / StorefrontRoutes

Interface: StorefrontRoutes<C>

Type Parameters

C

C extends AstroAPIContext

Properties

abandonedConvert

readonly abandonedConvert: StorefrontApiRoute<C>

POST { sessionId, orderId, orderNumber } → 204.


abandonedUpsert

readonly abandonedUpsert: StorefrontApiRoute<C>

POST an AbandonedCheckoutInput → 204.


cartValidate

readonly cartValidate: StorefrontApiRoute<C>

POST a basket { items } or one product { productId, productName, quantity, variantSelections, offerId, … }, each with an optional destination, couponCode and phone → { success: true, data: CartValidation }. With a destination, data.delivery is the fee and total the order will charge; with a code, data.coupon is what it does.


communes

readonly communes: StorefrontApiRoute<C>

GET, path param wilayaId → { data: Commune[] }.


orderStatus

readonly orderStatus: StorefrontApiRoute<C>

POST { orderNumber, phone } → { data: ShopperOrderStatus }. A wrong number or phone is refused with ORDER_NOT_FOUND; too many tries with ORDER_LOOKUP_RATE_LIMITED (429, windowSeconds).


otpSend

readonly otpSend: StorefrontApiRoute<C>

POST { phone } → { data: OtpSendResult }.


otpVerify

readonly otpVerify: StorefrontApiRoute<C>

POST { phone, requestId, code } → { data: OtpVerifyResult }.


reviewEligibility

readonly reviewEligibility: StorefrontApiRoute<C>

POST { orderNumber, phone, turnstileToken? } → { data: ReviewEligibility }.


reviewsList

readonly reviewsList: StorefrontApiRoute<C>

GET, path param productId, query limit/offset → { data: Review[], total }.


reviewSubmit

readonly reviewSubmit: StorefrontApiRoute<C>

POST a ReviewInput → 201 { success: true, data: { id, visibility } }.


reviewUpload

readonly reviewUpload: StorefrontApiRoute<C>

PUT one file as the body, the grant in X-Review-Grant (and a voice note's length in X-Media-Duration-Ms) → 201 { data: ReviewUpload }. The file streams on to the server unbuffered.