Skip to main content
GET
Get a free preview

Request

Headers

Path parameters

Public, like /products: no sign-in is needed. Show a “Read a sample” button only when the item’s preview.available is true (see List products).

What the preview contains

  • The first N pages of the book, where N is the seller’s setting (default 3, between 1 and 20) but never more than half of the book and at least one. A book of fewer than two pages has no preview.
  • A footer on every page, for example Preview: first 3 of 120 pages.
  • Only the chosen pages: the rest of the book is not hidden inside the file, it is simply not there.
  • PDFs only, up to 60 MB. The result is cached for an hour.

Successful response

200 with Content-Type: application/pdf, Content-Disposition: inline; filename="the-lagos-cookbook-preview.pdf" and Cache-Control: public, max-age=300. The body is the PDF, so open it in a new tab or an embedded viewer.

Error responses

Errors are JSON. A 404 carries a code: Other statuses: 429 when one visitor makes more than 40 preview requests in 5 minutes (Retry-After tells them when to try again), and 503 with code: "busy" and Retry-After: 5 when previews are busy.

Headers

x-shop-id
string

Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.

Path Parameters

id
string
required

The digital product id.

Response

The preview PDF (Content-Disposition: inline, Cache-Control: public, max-age=300).

The response is of type file.