Developers › Docs › API reference › Approve a draft
Approve a draft
Applies corrections to a draft and sends the listing. edits is keyed by the draft's field names; omit it to send the draft as it stands.
curl -X POST "https://fluf.io/wp-json/fc/api/v1/drafts/8812/approve" \
-H "Authorization: Bearer fluf_pat_your_token" \
-H "Content-Type: application/json" \
-d '{ "edits": { "size": "M" } }'const res = await fetch("https://fluf.io/wp-json/fc/api/v1/drafts/8812/approve", {
method: "POST",
headers: {
"Authorization": "Bearer fluf_pat_your_token",
"Content-Type": "application/json",
},
body: JSON.stringify({
"edits": {
"size": "M"
}
}),
});
const data = await res.json();import requests
res = requests.post(
"https://fluf.io/wp-json/fc/api/v1/drafts/8812/approve",
headers={
"Authorization": "Bearer fluf_pat_your_token",
},
json={"edits": {"size": "M"}},
)
data = res.json()<?php
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://fluf.io/wp-json/fc/api/v1/drafts/8812/approve', [
'headers' => [
'Authorization' => 'Bearer fluf_pat_your_token',
],
'json' => ['edits' => ['size' => 'M']],
]);
$data = json_decode((string) $res->getBody(), true);{ "id": 8812, "vid": "fluf_326428506_0", "channel": "ebay", "state": "listed", "listing_url": "https://www.ebay.co.uk/itm/2564..." }Returns
state is listed (live now), pending (the marketplace has it and it publishes shortly — don't resend) or failed (refused again — HTTP 422, message says why, and draft carries the refreshed draft when there is one to try again).
Errors
An edit naming a field the draft doesn't have, or one it can't change, is refused with 400 unknown_field / field_not_editable before anything is sent.
What FLUF remembers
A corrected category or brand is remembered for that product and, for brands, for the next product with the same brand.
Something missing? Email [email protected] — we prioritise by what people actually ask for.
