Platitun · API · Listings · Switch on, switch off, auto-delivery

Switch on, switch off, auto-delivery

POST /api/v1/listings/{number}/state

Key scope: listings · changes data, the Idempotency-Key header is required

One action for two switches: appearing on the storefront and delivery by stock. Switching the first on turns the price into a public offer; switching auto-delivery on promises delivery in seconds.

Auto-delivery cannot be switched on with an empty stock: promising instant delivery without stock is a lie to the buyer, and it costs a lot in the auto-delivery rating. The refusal code is auto_needs_stock.

Request fields

FieldTypeWhat it is
activebooleanPublish or withdraw.
autoIssuebooleanDeliver from stock or by hand.

Response fields

FieldTypeWhat it is
numberintegerThe public number.
isActivebooleanThe publication state after the action.
autoIssuebooleanThe auto-delivery state after the action.

Refusal reasons

A rule refusal arrives as {"error":"rejected","refusal":{"kind":"…"}} with status 409. Refusals common to all endpoints are in the rules section.

CodeWhat happened and what to do
not_foundThe record does not exist or is not yours. The ownership condition is in the database query itself, so someone else’s record looks like a missing one.
auto_needs_stockAuto-delivery cannot be switched on with an empty stock: promising instant delivery without stock is a lie to the buyer. Refill the stock first.
bad_requestThe request is malformed: a required field is missing or a value is of the wrong kind. The specifics are in the detail field.

Nearby in this section