Skip to content

Books

The Books module’s operations are under /api/v1/books/, with the books permission: reading needs books:read, changing books:write. Books, their briefs and settings are on The Books module; this page covers printing and selling them (Printing and selling a book).

To Operations
Read a book’s publishing: its print spec, the SKU and pages, store details, listings, whether Lulu is connected GET /api/v1/books/{id}/publishing
Set how a book prints, or spec: null for Books › Settings › Printing’s PUT /api/v1/books/{id}/print
Price copies at Lulu, with shipping, the margin and suggested prices POST /api/v1/books/{id}/print/quote
Have Lulu check the latest build’s files, and read where the check is POST /api/v1/books/{id}/print/check, POST /api/v1/books/{id}/print/check/result
Order copies from the latest build, once the check passed POST /api/v1/books/{bookId}/orders

A spec is color (BW or FC), quality (STD or PRE), binding (PB paperback, CW casewrap, LW linen, CO coil, SS saddle stitch), paper (060UW444, 060UC444, 080CW444, 070CW460), finish (M or G), a linen hardcover’s linen and foil, and the shippingLevel author copies go by. With the book’s trim it makes podPackageId, Lulu’s SKU; a spec Lulu doesn’t make is refused with why.

print.pages is { count, estimated, words, buildId }: the latest real build’s pages, or, until there is one, an estimate from the words written (or planned). build is the latest ready build, printable says whether it can be printed and sold (a sample, another trim, or a spec changed since its cover was sized can’t), and check is Lulu’s check of its files.

POST /api/v1/books/{id}/print/check sends Lulu links to the build’s PDFs that last a month (Lulu downloads them itself, so the app’s address must be public https) and keeps both checks’ ids; POST /api/v1/books/{id}/print/check/result asks Lulu again until both are done. POST /api/v1/books/{bookId}/orders takes quantity, the shipping address (with a phone) and optionally shippingLevel and contactEmail, and answers the print order, queued until Lulu has it. It’s refused until the build’s check has passed, and charges the Lulu account.

POST /api/v1/books/{id}/print/quote takes place (street, city, state, postcode and country), quantity and, optionally, a shippingLevel (else the spec’s, when Lulu offers it there, or the cheapest). It answers Lulu’s shipping options, Lulu’s price in cents of its currency (lulu.unit is one copy’s printing), the same in the workspace’s currency at today’s ECB rate (workspace, null without a rate), the book’s printPrice, the margin a copy (the price less printing and Lulu’s fees), and suggestedPrintPrice and suggestedEbookPrice. It needs Lulu connected and costs nothing.

PATCH /api/v1/books/{id}/metadata changes some of description (4,000 characters), keywords (seven, 50 characters each), bisac (three codes such as BUS025000), series and seriesNumber, isbn and ebookIsbn (ISBN-13s, kept as 13 digits; an ISBN-10 is turned into one; the two must differ), and printPrice and ebookPrice in the workspace currency’s minor units. POST /api/v1/books/{id}/metadata/suggest has the writer suggest a description, keywords and subjects without saving them; it’s counted on the AI meter.

A listing is where a book sells: store (store, lulu, amazon, ingramspark or other with a label), kind (print or ebook), its url, externalId (an ASIN at Amazon, the ISBN at IngramSpark), price and currency, status (draft or live), and its store’s checklist as steps with checklist, the ids done.

To Operations
List one book’s listings, or every book’s GET /api/v1/books/listings
Add one, at a store without an API POST /api/v1/books/listings
Change one: its address, ID, price, steps done or status PATCH /api/v1/books/listings/{id}
Remove one DELETE /api/v1/books/listings/{id}

A book has one listing per store and format (any number under other, by name). A listing goes live only with its address. The first time one does, the book’s stage becomes published, automations get book.published and webhooks books.book.published; with no live listing left, the book goes back to ready.

POST /api/v1/books/{id}/store takes print and ebook and makes or updates the book’s store products from its latest build at the prices in its store details: the ebook a digital product with the EPUB and the interior PDF as its files, the print book a physical product whose stock isn’t counted (Lulu connected and the build’s check passed). Each becomes a live store listing. It needs commerce:write as well. A paid order’s printed books go to Lulu as a print order with the order’s id (Lulu’s lulu.orders.list filters by orderId); its tracking becomes the order’s shipment; a full refund before Lulu starts cancels it.

GET /api/v1/books/sales answers a range (30d, 90d, 365d, all): each store listing’s units, revenue after refunds, luluCost (converted to the workspace’s currency) and margin, the totals, and the live listings elsewhere.

POST /api/v1/books/{id}/exports takes a store (amazon, ingramspark, lulu or other) and zips the latest build’s files with metadata.txt and the store’s checklist.txt, kept with the book’s files; it answers a link for a day and records the package on the book’s listings at that store.

GET /api/v1/books/orders lists the print orders sent to Lulu with the workspace’s books in them, newest first, each with a stage (sending, printing, shipped, problem or cancelled) beside Lulu’s own status. Filter by bookId or stage; page with offset and limit. Cancelling, sending again and refreshing are Lulu’s operations. When one moves, automations get book.print_order.updated and webhooks books.print_order.updated.

A site shows the workspace’s published books with a secret API key with Books: read, on its server:

To Operations
List published books, newest first GET /api/v1/books/published
Read one by its slug, or null GET /api/v1/books/published/{slug}

Each has its slug, title, subtitle, language, author (name, bio, imageUrl), description (the store description, or the brief’s promise), keywords, bisac, series, the ISBNs, cover (url and thumbnailUrl), pageCount, trim, a sample chapter (title and web html), formats (print and ebook, each with its price and where to buy it) and buyLinks (every live listing’s store, format, address and price), and publishedAt.

Terminal window
curl "https://digize.com/api/v1/books/published/the-neighborhood-roaster" \
-H "Authorization: Bearer $DIGIZE_API_KEY"

The AI coding agent’s digize-books skill builds a books page and a page for each book from these.