Update one of your listings
const url = 'https://acme.mykreezalid.com/front_api/v1/listings/4242/edit';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"Blue city bike","description":"example","category_id":31,"order_type_url_token":"example","price":120,"sku":"SKU-4242","quantity":12,"external_id":"REF-4242","location":"10 Main Street, Springfield","city":"Springfield","country":"US","status":"draft","visibility":"both","attributes":{},"tags":["summer","bikes"],"medias":["https://cdn.example.com/bike-front.jpg"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://acme.mykreezalid.com/front_api/v1/listings/4242/edit \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "Blue city bike", "description": "example", "category_id": 31, "order_type_url_token": "example", "price": 120, "sku": "SKU-4242", "quantity": 12, "external_id": "REF-4242", "location": "10 Main Street, Springfield", "city": "Springfield", "country": "US", "status": "draft", "visibility": "both", "attributes": {}, "tags": [ "summer", "bikes" ], "medias": [ "https://cdn.example.com/bike-front.jpg" ] }'Updates a listing of the signed-in member. Only the fields you send change. id and user_id are ignored. PATCH and POST on the same path do exactly the same. The response has status 200 whether or not the update was saved: check success.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Listing ID.
Example
4242Request Bodyrequired
Section titled “Request Bodyrequired”The fields to change. Other listing fields are stored as sent.
object
Title of the listing.
Example
Blue city bikeDescription. HTML is converted to plain text.
Example
31URL key of the order type to move the listing to.
Example
120Example
SKU-4242Example
12Example
REF-4242Example
10 Main Street, SpringfieldExample
SpringfieldExample
USAttribute values keyed by attribute alias.
object
Tags of the listing, as tag IDs or tag terms.
Example
[ "summer", "bikes"]Image URLs. When the array is not empty, it replaces all the images of the listing, in this order. The URLs are stored as sent, not copied.
Example
[ "https://cdn.example.com/bike-front.jpg"]Responses
Section titled “Responses”Outcome of the update. success is false (message Error. No updates were made.) when the listing could not be saved.
object
Example
{ "message": "Listing has been updated", "success": true}No valid access token was sent.
Error body returned by the Front API when it refuses a request.
object
HTTP status code, repeated in the body.
Human-readable reason.
Example
{ "code": 403, "status": "error", "message": "Token not found in request"}No listing with this ID among your listings.