Skip to content

Reserve a variant in a physical store (« Réservation en boutique »)​

POST
/store-reservations

Reserves ONE variant (e.g. a shoe size) in ONE store of ONE vendor; the shopper collects and pays in the store. No online payment, no stock decrement (ERP stock is read-only).

The server re-checks what the product page showed, via the same resolution as GET /public/variant-availability: the vendor offers the variant, the vendor shows store stock (showsStoreStock = per-depot feed AND the store_stock offer capability), the store is listed for that variant with a status other than out_of_stock, and the warehouse is active and belongs to the vendor. Otherwise 409 STORE_UNAVAILABLE. The seller's product must also be ACTIVELY listed on this marketplace (not paused, rejected or retired, vendor not suspended or terminated), otherwise 404 NOT_FOUND.

productId / variantId may be the seller's own pair (vendors[].productId / vendors[].variantId from variant-availability) or the page's canonical pair; the reservation always stores the seller's own variant. unitPrice is a snapshot of the seller's selling price (same pricer as checkout, never the raw price column).

Holds 48 h from creation; when the store marks it ready, 48 h from then. Overdue pending/confirmed/ready reservations become expired (15-minute sweep). At most 3 active reservations per phone number per vendor (429 RESERVATION_LIMIT). Phone: Tunisian, 8 digits; +216 / 00216 / 216 prefixes, spaces, dots and dashes accepted; stored as +216XXXXXXXX.

Guest-friendly: a customer Bearer links the reservation to that customer (never a body field). Per-IP rate limit. Optional Idempotency-Key header: a repeat returns the existing reservation with 200.

Notifies the vendor (bell + email, store_reservation_created) and emails the shopper when email is given.

Errors: { ok:false, error:{ code, message }, message }.

Auth: Bearer JWT optional (guest-friendly).

Authorizations​

bearerAuth

Jeton client obtenu par POST /auth/login (ou /auth/register), renouvelé par POST /auth/refresh.

Type
HTTP (bearer)
or

Parameters​

Header Parameters

Idempotency-Key

Replays the reservation already created for this marketplace/key (200) instead of creating a duplicate.

Type
string

Request Body​

application/json
JSON
{
  
"vendorId": "string",
  
"productId": "string",
  
"variantId": "string",
  
"storeId": "string",
  
"quantity": 1,
  
"firstName": "string",
  
"lastName": "string",
  
"phone": "string",
  
"email": "user@example.com",
  
"note": "string"
}

Responses​

Idempotent replay — the reservation already existed for this Idempotency-Key

application/json
JSON
{
  
"ok": true,
  
"data": {
  
  
"reservationId": "rsv_3f9a0c1b2d4e5f6a7b8c9d0e",
  
  
"reservationNumber": "R-7KQ2MX",
  
  
"status": "pending",
  
  
"quantity": 0,
  
  
"unitPrice": 0,
  
  
"compareAtPrice": 0,
  
  
"product": {
  
  
  
"productId": "string",
  
  
  
"variantId": "string",
  
  
  
"title": "string",
  
  
  
"variantLabel": "Noir / 42",
  
  
  
"imageUrl": "string"
  
  
},
  
  
"store": {
  
  
  
"storeId": "string",
  
  
  
"name": "string",
  
  
  
"city": "string",
  
  
  
"address": "string",
  
  
  
"phone": "string",
  
  
  
"openingHours": "string"
  
  
},
  
  
"vendor": {
  
  
  
"vendorId": "string",
  
  
  
"name": "string"
  
  
},
  
  
"customer": {
  
  
  
"firstName": "string",
  
  
  
"lastName": "string",
  
  
  
"phone": "+21622123456",
  
  
  
"email": "string"
  
  
},
  
  
"note": "string",
  
  
"expiresAt": "2024-01-01T00:00:00Z",
  
  
"createdAt": "2024-01-01T00:00:00Z",
  
  
"confirmedAt": "2024-01-01T00:00:00Z",
  
  
"readyAt": "2024-01-01T00:00:00Z",
  
  
"collectedAt": "2024-01-01T00:00:00Z",
  
  
"cancelledAt": "2024-01-01T00:00:00Z",
  
  
"accessToken": "string"
  
}
}

Playground​

Authorization
Headers
Body

Samples​

Powered by VitePress OpenAPI

Tarifs : contactez-nous — contact@marketkit.ai