Set how a book prints
const url = 'https://digize.com/api/v1/books/example/print';const options = { method: 'PUT', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"spec":{"color":"BW","quality":"STD","binding":"PB","paper":"060UW444","finish":"M","linen":"N","foil":"G","shippingLevel":"MAIL"}}'};
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://digize.com/api/v1/books/example/print \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "spec": { "color": "BW", "quality": "STD", "binding": "PB", "paper": "060UW444", "finish": "M", "linen": "N", "foil": "G", "shippingLevel": "MAIL" } }'Sets a book’s print spec: colour, quality, binding, paper and cover finish (and a linen hardcover’s cloth and foil), joined with its trim into a Lulu SKU, and how author copies ship. spec: null goes back to Books › Settings › Printing’s defaults. Refused when Lulu doesn’t make that combination.
Needs the books:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
object
BW black and white, FC colour throughout.
STD standard, PRE premium ink and paper handling.
PB paperback, CW casewrap hardcover, LW linen hardcover, CO coil, SS saddle stitch.
060UW444 60# white, 060UC444 60# cream, 080CW444 80# coated white, 070CW460 70# coated white.
The cover: M matte, G gloss.
How author copies ship unless an order says otherwise.
Responses
Section titled “Responses”Done
object
BW black and white, FC colour throughout.
STD standard, PRE premium ink and paper handling.
PB paperback, CW casewrap hardcover, LW linen hardcover, CO coil, SS saddle stitch.
060UW444 60# white, 060UC444 60# cream, 080CW444 80# coated white, 070CW460 70# coated white.
The cover: M matte, G gloss.
How author copies ship unless an order says otherwise.
Lulu’s SKU: the book’s trim and this spec joined.
The SKU in words.
Why Lulu wouldn’t print it at the book’s pages, or null.
False while the book follows Books › Settings › Printing’s defaults.
object
True until a build counts the pages: estimated from the words the book’s shape plans.
The build that counted them.
Example
{ "color": "BW", "quality": "STD", "binding": "PB", "paper": "060UW444", "finish": "M", "linen": "N", "foil": "G", "shippingLevel": "MAIL"}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}