@wocart/storefront / astro / StorefrontRoutes
Interface: StorefrontRoutes<C>
Type Parameters
C
C extends AstroAPIContext
Properties
abandonedConvert
readonlyabandonedConvert:StorefrontApiRoute<C>
POST { sessionId, orderId, orderNumber } → 204.
abandonedUpsert
readonlyabandonedUpsert:StorefrontApiRoute<C>
POST an AbandonedCheckoutInput → 204.
cartValidate
readonlycartValidate: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
readonlycommunes:StorefrontApiRoute<C>
GET, path param wilayaId → { data: Commune[] }.
orderStatus
readonlyorderStatus: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
readonlyotpSend:StorefrontApiRoute<C>
POST { phone } → { data: OtpSendResult }.
otpVerify
readonlyotpVerify:StorefrontApiRoute<C>
POST { phone, requestId, code } → { data: OtpVerifyResult }.
reviewEligibility
readonlyreviewEligibility:StorefrontApiRoute<C>
POST { orderNumber, phone, turnstileToken? } → { data: ReviewEligibility }.
reviewsList
readonlyreviewsList:StorefrontApiRoute<C>
GET, path param productId, query limit/offset → { data: Review[], total }.
reviewSubmit
readonlyreviewSubmit:StorefrontApiRoute<C>
POST a ReviewInput → 201 { success: true, data: { id, visibility } }.
reviewUpload
readonlyreviewUpload: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.