SiteSwapDevelopers
API reference: Listings

Post a listing

POSThttps://dev.siteswap.pro/api/v1/listings

Posts a listing for your company with the same checks as the posting form: the category, its questions, the units, the soil statement, the brand and model lists, the daily limit. Photos given by address are downloaded and stored like uploaded ones.

Needs the listings:write scope.

Needs an API key or sign-in token in Authorization: Bearer or X-API-Key. Authentication

Body

marketplacestringdefault "materials"
Where it is posted. It cannot change later
kind"have" | "need"required
have to offer something, need to ask for it. It cannot change later
category_idstringrequired
The category, from GET /catalog/categories
material_idstring | "other"
Materials: a material of the category, or other with custom_material
custom_materialstring
The name, with material_id: "other"
titlestring
Made from the material when left out
descriptionstring
quantitynumber
How much or how many
unitstring
One of the category's units
quantity_basis"measured" | "estimated"
Materials: whether the quantity was measured
price_model"fixed" | "offers" | "free" | "pays_to_take"
How it is priced. Each marketplace takes some of these
pricenumber
Dollars per unit, with fixed or pays_to_take
zipstringrequired
Where it is: the 5-digit ZIP. It is never shown; listings show the town
site_idstring
Takes the ZIP from that site
deal"sale" | "trade" | "both"
Marketplaces with trades: for sale, for trade or both
can_loadboolean
can_deliverboolean
pickup_onlyboolean
available_fromstring
YYYY-MM-DD
brand_idstring | "other"
Materials with catalog brands
line_idstring | "other"
color_idstring | "other"
model_idstring
Fills the maker and the maker's figures
fieldsobject (by key)
Answers to the category's questions by key, and any other field of this marketplace's posting form by its name
photo_urlsstring[]
Up to 8 photos by https address; each is downloaded once and stored by SiteSwap

Responses

201Created
400bad_request, key_in_url or invalid_json: the request could not be read
401missing_key or invalid_key: no key, or a key that is not valid or was revoked
403key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors
404not_found: nothing here that you may see
409marketplace_closed: the marketplace is not open
413too_large: the body is over 256 KB
422invalid: a field was refused; message says which and why
429rate_limited or daily_quota: wait for Retry-After seconds

Response fields

idstringrequired
The listing's id
urlstringrequired
The listing on SiteSwap
marketplacestringrequired
The marketplace key
kind"have" | "need"required
have for something offered, need for something wanted
deal"sale" | "trade" | "both"required
Marketplaces with trades: for sale, for trade or either; sale everywhere else
status"active" | "paused" | "closed"required
Only active listings are found by search; your own can be paused or closed
titlestringrequired
descriptionstringrequired
categoryobjectrequired
category.idstringrequired
category.slugstringrequired
category.namestringrequired
materialstring | nullrequired
The material or type, or the name typed under Other
brandstring | nullrequired
The brand or maker
product_linestring | nullrequired
The product line
colorstring | nullrequired
The color
modelstring | nullrequired
The model
quantityobjectrequired
quantity.totalnumberrequired
Listed in all
quantity.opennumberrequired
Still open: not promised to an accepted offer and not handed over
quantity.unitstringrequired
quantity.basisstringrequired
measured or estimated
priceobjectrequired
price.modelstringrequired
fixed, offers, free or pays_to_take (the poster pays to have it taken)
price.centsinteger | nullrequired
Per unit, in US cents; null without a price
locationobjectrequired
location.citystringrequired
location.regionstringrequired
The state
location.distance_minumber | nullrequired
Straight-line miles from the zip you sent; null without one
pickup_onlybooleanrequired
can_deliverbooleanrequired
can_loadbooleanrequired
available_fromstring | nullrequired
The first day, YYYY-MM-DD
fieldsobject (by key)required
The category's questions and their answers, by key (see GET /catalog/categories/{id})
photostring | nullrequired
A small picture of the first photo
companyobjectrequired
company.slugstringrequired
The company's address on SiteSwap, /c/{slug}
company.namestringrequired
company.kindstringrequired
What kind of company, for example contractor or supplier
company.urlstringrequired
Its public page
samplebooleanrequired
True for sample data on test servers
created_atstringrequired
When it was posted. ISO 8601 in UTC
SiteSwap API v1Support