Wocart
Wocart API

Storefront

Server

Track an abandoned checkout

POST
https://api.wocart.store
/store/abandoned
X-Store-API-Key (header)

Called silently by the storefront as the customer types contact details. Upserts the abandoned-checkout record keyed by sessionId and captures Meta attribution (_fbc/_fbp) plus client IP/User-Agent for CAPI recovery events.

Track an abandoned checkout › Request Body

sessionId
​string · uuid · required
customerName
​string · minLength: 2 · maxLength: 100 · required
phone
​string · minLength: 9 · maxLength: 20 · pattern: ^[0-9+\s-]+$ · required
wilayaId
​integer · min: 1 · max: 58
communeId
​string
wilayaName
​string · maxLength: 100
communeName
​string · maxLength: 100
productId
​string · maxLength: 200
productName
​string · maxLength: 200
variantId
​string · maxLength: 200
variantLabel
​string · maxLength: 200
price
​number
​object[] · minItems: 1 · maxItems: 20
deliveryType
​string · enum
Enum values:
home
stop_desk
fbc
​string · maxLength: 500
fbp
​string · maxLength: 500

Track an abandoned checkout › Responses

200

Record stored (new or updated)

success
​boolean · required
id
​string · required

Abandoned order record ID


Mark abandoned checkout as converted

PATCH
https://api.wocart.store
/store/abandoned/{sessionId}/convert
X-Store-API-Key (header)

Links a completed order back to the original abandoned session (recovery attribution). Intentionally returns 200 even if the session is unknown — conversion tracking is fire-and-forget and must never break checkout.

Mark abandoned checkout as converted › path Parameters

sessionId
​string · required

Storefront session ID from the upsert call

Storefront session ID from the upsert call

Mark abandoned checkout as converted › Request Body

orderId
​string · minLength: 1 · required
orderNumber
​string · minLength: 1 · required

Mark abandoned checkout as converted › Responses

200

Conversion recorded (fire-and-forget)

success
​boolean · required

Send a WhatsApp OTP to the customer's phone

POST
https://api.wocart.store
/store/otp/send
X-Store-API-Key (header)

Sends a 6-digit code over WhatsApp via dzverify. Requires the store's OTP verification to be enabled. When dzverify cannot serve the send (balance exhausted, provider down), returns status 'unavailable' with a server-signed bypassToken — checkout proceeds unverified (fail-open; orders are never blocked by quota). Rate limits return 429 with the wait window.

Send a WhatsApp OTP to the customer's phone › Request Body

phone
​string · minLength: 6 · maxLength: 20 · required

Algerian mobile; normalized server-side to E.164

Send a WhatsApp OTP to the customer's phone › Responses

OTP sent (or unavailable with a bypass token)

success
​boolean · required
​required

Verify the WhatsApp OTP code

POST
https://api.wocart.store
/store/otp/verify
X-Store-API-Key (header)

Verifies the code the customer typed. On success returns a signed otpToken (15-min TTL, bound to the phone) that the storefront submits with the order. Wrong-but-retryable codes return 422 with attemptsRemaining. Terminal states (expired, attempts exhausted, already verified) return 409 — send a new OTP.

Verify the WhatsApp OTP code › Request Body

phone
​string · minLength: 6 · maxLength: 20 · required
requestId
​string · minLength: 1 · maxLength: 64 · required
code
​string · pattern: ^\d{6}$ · required

Verify the WhatsApp OTP code › Responses

Verified — otpToken returned

success
​boolean · required
​object · required