API reference: Listings
Post a listing
POST
https://dev.siteswap.pro/api/v1/listingsPosts 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"requiredhave to offer something, need to ask for it. It cannot change latercategory_idstringrequiredThe category, from
GET /catalog/categoriesmaterial_idstring | "other"Materials: a material of the category, or
other with custom_materialcustom_materialstringThe name, with
material_id: "other"titlestringMade from the material when left out
descriptionstringquantitynumberHow much or how many
unitstringOne 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
pricenumberDollars per unit, with
fixed or pays_to_takezipstringrequiredWhere it is: the 5-digit ZIP. It is never shown; listings show the town
site_idstringTakes the ZIP from that site
deal"sale" | "trade" | "both"Marketplaces with trades: for sale, for trade or both
can_loadbooleancan_deliverbooleanpickup_onlybooleanavailable_fromstringYYYY-MM-DD
brand_idstring | "other"Materials with catalog brands
line_idstring | "other"color_idstring | "other"model_idstringFills 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 why429rate_limited or daily_quota: wait for Retry-After seconds
Response fields
idstringrequiredThe listing's id
urlstringrequiredThe listing on SiteSwap
marketplacestringrequiredThe marketplace key
kind"have" | "need"requiredhave for something offered, need for something wanteddeal"sale" | "trade" | "both"requiredMarketplaces with trades: for sale, for trade or either;
sale everywhere elsestatus"active" | "paused" | "closed"requiredOnly
active listings are found by search; your own can be paused or closedtitlestringrequireddescriptionstringrequiredcategoryobjectrequiredcategory.idstringrequiredcategory.slugstringrequiredcategory.namestringrequiredmaterialstring | nullrequiredThe material or type, or the name typed under Other
brandstring | nullrequiredThe brand or maker
product_linestring | nullrequiredThe product line
colorstring | nullrequiredThe color
modelstring | nullrequiredThe model
quantityobjectrequiredquantity.totalnumberrequiredListed in all
quantity.opennumberrequiredStill open: not promised to an accepted offer and not handed over
quantity.unitstringrequiredquantity.basisstringrequiredmeasured or estimatedpriceobjectrequiredprice.modelstringrequiredfixed, offers, free or pays_to_take (the poster pays to have it taken)price.centsinteger | nullrequiredPer unit, in US cents; null without a price
locationobjectrequiredlocation.citystringrequiredlocation.regionstringrequiredThe state
location.distance_minumber | nullrequiredStraight-line miles from the
zip you sent; null without onepickup_onlybooleanrequiredcan_deliverbooleanrequiredcan_loadbooleanrequiredavailable_fromstring | nullrequiredThe first day, YYYY-MM-DD
fieldsobject (by key)requiredThe category's questions and their answers, by key (see
GET /catalog/categories/{id})photostring | nullrequiredA small picture of the first photo
companyobjectrequiredcompany.slugstringrequiredThe company's address on SiteSwap,
/c/{slug}company.namestringrequiredcompany.kindstringrequiredWhat kind of company, for example
contractor or suppliercompany.urlstringrequiredIts public page
samplebooleanrequiredTrue for sample data on test servers
created_atstringrequiredWhen it was posted. ISO 8601 in UTC
SiteSwap API v1Support