Printing books with Lulu
Lulu prints books on demand: paperbacks, hardcovers, coil-bound workbooks and more, one at a time or by the box, shipped worldwide. Once a workspace connects its own Lulu account, Digize can price books there, have Lulu check the files, and send print orders, which Lulu prints, ships and charges to that account. Books uses it for author copies and printed books sold in the store; anything else can too, from two PDFs at public addresses.
Reading needs commerce:read, ordering commerce:write, and connecting settings:write. Every operation but the orders’ lists is held back while Lulu isn’t offered to the workspace.
Connecting
Section titled “Connecting”Lulu’s Print API has two accounts: the live one at developers.lulu.com, and a separate sandbox at developers.sandbox.lulu.com whose jobs are never printed and are paid with test cards. Each has a client key and client secret under your profile’s API Keys.
Connect in Settings › Integrations › Lulu with the key, the secret, which account they’re for, and the email Lulu writes to about print jobs (someone who runs the store). Lulu checks them by handing out a token; Digize keeps them sealed and asks for a fresh token each time it calls, since Lulu’s last minutes.
| To | Operations |
|---|---|
| Connect with the client key and secret | POST /api/v1/lulu/connect |
| See which account is connected | GET /api/v1/lulu/connection |
Connecting subscribes the account to Lulu’s PRINT_JOB_STATUS_CHANGED webhook at /api/hooks/lulu/<workspace>, and disconnecting takes it off. Lulu signs each delivery with the client secret in its Lulu-HMAC-SHA256 header; Digize takes only the print job’s id from it and reads the job again from Lulu, so a forged delivery can’t change anything.
Products
Section titled “Products”A Lulu product is a SKU (Lulu’s pod_package_id) made of six parts: trim size, ink, print quality, binding, paper and cover finish, as in 0600X0900.BW.STD.PB.060UW444.MXX, a 6 × 9 in black-and-white standard paperback on 60# white paper with a matte cover. Linen-wrap hardcovers end in their linen colour and foil, such as MNG for navy linen with gold foil. Lulu’s older SKUs without dots work until February 2027; Digize takes either and keeps the dotted form.
GET /api/v1/lulu/products lists the SKUs most books use, the parts a SKU is made of, and the pages each binding takes (a paperback 32 to 800, a hardcover 24 to 800, coil 2 to 470, saddle stitch 4 to 48). Lulu’s full list is a spreadsheet, so any SKU can be given; with podPackageId it checks one and spells it out.
Prices, shipping and files
Section titled “Prices, shipping and files”| To | Operations |
|---|---|
| Price books and their shipping to an address, with tax | POST /api/v1/lulu/cost |
| List the ways Lulu ships to a country, with costs and dates | POST /api/v1/lulu/shipping-options |
| Have Lulu check an interior PDF, or a cover PDF against its book | POST /api/v1/lulu/validations/interior POST /api/v1/lulu/validations/cover |
| Read a check’s result | GET /api/v1/lulu/validations/{kind}/{id} |
| Work out the size a cover PDF has to be | POST /api/v1/lulu/cover-dimensions |
These are free and order nothing. Amounts are in the minor unit of the currency Lulu answers in, the account’s. A file check runs at Lulu for a while: start it, then read its result until done; errors says what’s wrong with a file that isn’t ok. A cover’s size comes from its SKU and the interior’s page count, which sets the spine.
Shipping levels are MAIL (slowest, maybe untracked), PRIORITY_MAIL, GROUND_HD and GROUND_BUS (US ground to a home or a business), GROUND, EXPEDITED (second day) and EXPRESS (overnight). Lulu needs a state for the US, Canada, Australia, Mexico and a few other countries.
Print orders
Section titled “Print orders”| To | Operations |
|---|---|
| Send books to print | POST /api/v1/lulu/orders |
| List print orders, or one book’s or store order’s | GET /api/v1/lulu/orders |
| Read one | GET /api/v1/lulu/orders/{id} |
| Read one from Lulu now | POST /api/v1/lulu/orders/{id}/refresh |
| Cancel one | POST /api/v1/lulu/orders/{id}/cancel |
| Send a failed one again | POST /api/v1/lulu/orders/{id}/retry |
| Try the sandbox with one book | POST /api/v1/lulu/test-print |
An order is one Lulu print job: each book’s title, SKU, copies, and the public https addresses Lulu downloads its interior and cover PDFs from, and where to ship them. Lulu’s carriers need a phone number with the address. The order is queued at once and goes to Lulu in the background: sent with Lulu’s jobId and status, or failed with why. Each order carries its own id to Lulu as external_id, so a send that lost Lulu’s answer finds the job it made rather than making a second.
Lulu’s status then moves through CREATED (checking the files), UNPAID, PAYMENT_IN_PROGRESS, PRODUCTION_DELAYED (paid, held for the account’s production delay), PRODUCTION_READY, IN_PRODUCTION, SHIPPED and, for some carriers, DELIVERED; or REJECTED (a file or the address), CANCELED or ERROR. costs fills in once Lulu has priced the job, and each book’s tracking once it ships. A rejected order can be sent again once it’s fixed, as a new job.
Lulu cancels a job until it’s paid and its production delay is over: cancellable says whether it still can. Cancelling one Lulu has is asked of Lulu in the background, with cancelling true until it answers.
The lulu.order.updated event, with luluOrderId, jobId, status, state and orderId, goes to the workspace’s other modules whenever an order moves; Books follows its print orders with it.