Products

Register Demand

Register "I need this" against a tentative listing.

Open to anonymous visitors on purpose: the whole value of a demand probe is the count, and putting a signup in front of the button would measure willingness to register rather than willingness to buy. An anonymous caller is identified by the session_id their client sends.

Pressing twice is not an error — the second press returns the same count with already_registered: true, so a retry or a double click cannot inflate the number. Optional coordinates say where the demand is, which is what tells a seller whether it is within their delivery range.

post/v1/products/{product_id}/demand

Request

  • Base URL: http://localhost:8000
  • URL: http://localhost:8000/v1/products/{product_id}/demand
  • Auth: HTTP bearer

Path parameters

product_idinteger required

Headers

X-API-Keystring nullable

Request body

session_idstring nullable

Opaque per-browser id, required when nobody is signed in. It only exists to count one anonymous visitor once; send a random string you keep in localStorage, not anything identifying.

latnumber nullable

Optional latitude of the interested buyer, so the seller can see whether demand is within reach.

lonnumber nullable

Optional longitude, paired with lat.

Response

Successful Response

product_idinteger required
demand_countinteger required

Total people who have registered interest, including this caller.

already_registeredboolean required

True when this caller had already registered — the count is unchanged, and this is not an error.

Changes

No recorded changes to this operation across all 2 revisions of this API.