Skip to content

Purchases and downloads

If your client only reads existing purchases, go directly to Owned publications and LCP. For clients that offer buying, ordinary browser links are sufficient. The enhanced handoff adds optional same-device checkout, QR codes, and status polling.

Ordinary purchases and downloads

This integration uses ordinary browser buy links and authenticated acquisition links. The full publication example shows an anonymous, unowned book and its buy link.

An available, unowned publication has a http://opds-spec.org/acquisition/buy link of type text/html. It includes properties.price (currency, value) and indirectAcquisition describing an LCP licence followed by EPUB (application/epub+zip). An anonymous link has properties.authenticate pointing to the Authentication Document. Readino retains this buy-link placement for compatibility alongside the feed and publication self hints described in Feeds, navigation, and search. The buy-link placement is a Readino convention, not defined by the OPDS buying recommendations. A client can still open the anonymous buy link and let the browser handle sign-in. An authenticated link instead has an RFC 3339 expiresAt, five minutes after issuance.

Open the returned URL in an external browser. It is opaque: do not parse or rewrite its signed purchase data. An authenticated link binds checkout to its catalogue account; the browser asks for sign-in or an account switch if needed. An anonymous ordinary link binds to the browser account after sign-in. It is not a general account-login credential.

Before opening an expired or nearly expired authenticated link, reload the publication through self and use its buy link. When returning from checkout, refresh the authenticated publication/shelf. A browser return alone does not establish ownership.

price and indirectAcquisition are OPDS link properties. Readino adds price.old_value and price.change_date for recent reductions; see Price history fields for their meaning and when they are included. Readino also adds expiresAt for the authenticated browser link's expiry. Purchases are for one publication at a time; Saved Books is not a batch-checkout API.

Owned publications and LCP

After authenticating as the owner, the publication has a direct acquisition link instead of a buy link. This separate owned-state excerpt shows the LCP licence media type and the EPUB it unlocks:

{
  "metadata": {"title": "Example Book"},
  "links": [
    {
      "rel": "self",
      "type": "application/opds-publication+json",
      "href": "https://readino.com/api/v2/opds2/book/example-book-9780000000001"
    },
    {
      "rel": "http://opds-spec.org/acquisition",
      "href": "https://readino.com/user/licence/EXAMPLE-ORDER/1.lcpl",
      "type": "application/vnd.readium.lcp.license.v1.0+json",
      "properties": {
        "indirectAcquisition": [{"type": "application/epub+zip"}],
        "lcp_hashed_passphrase": "PLACEHOLDER_BASE64_SHA256_PASSPHRASE"
      }
    }
  ]
}

GET the acquisition URL with the account's bearer token. An LCP implementation processes the licence and obtains the protected EPUB. Readino offers EPUB books. The lcp_hashed_passphrase property follows Readium LCP Automatic Key Retrieval: it is base64 of the SHA-256 digest bytes of the UTF-8 passphrase, not a hexadecimal string. Its value is a credential; supply it to LCP rather than displaying it.

Enhanced purchase handoff (optional)

Implement this optional flow when your application needs browser handoff, QR checkout, and purchase-status polling.

Prepare, then open browser or QR

If offered, a Readino-aware client can prefer https://readino.com/opds/rel/action/purchase-handoff (type application/opds-publication+json). This durable URL prepares a new operation; it is not itself a browser or QR ticket. GET it only after the user chooses Buy, using the bearer session, or no Authorization header for an anonymous purchase. Send the user's Accept-Language.

Optional query parameters are app_scheme and app_name. app_scheme identifies a supported custom scheme, such as fbreader or dinoreader; app_name is at most 100 characters without controls. Unknown schemes return 400. We can add schemes for third-party clients: contact us to have yours added. These parameters can be omitted.

The handoff relation is a Readino extension; its link looks like this:

{
  "links": [
    {
      "rel": "https://readino.com/opds/rel/action/purchase-handoff",
      "type": "application/opds-publication+json",
      "href": "https://readino.com/api/v2/opds2/purchase/9780000000001/6/partner"
    }
  ]
}

Preparation returns a fresh full publication with Date and Cache-Control: no-store. If buying remains possible, open the same-device link in this device's browser, encode the http://opds-spec.org/acquisition/buy URL in a QR code for another device, and poll the status link. The Readino relation strings and media types are shown below.

Prepared response excerpt for an authenticated purchase, distinct from an ordinary buy publication and from an owned publication. The two browser URLs are separate tickets; the original buy and handoff links are replaced. Example response date: Date: Fri, 30 Oct 2026 12:00:00 GMT.

{
  "metadata": {"title": "Example Book"},
  "links": [
    {
      "rel": "self",
      "type": "application/opds-publication+json",
      "href": "https://readino.com/api/v2/opds2/book/example-book-9780000000001"
    },
    {
      "rel": "https://readino.com/opds/rel/action/purchase-same-device",
      "href": "https://readino.com/checkout/p/PLACEHOLDER_SAME_DEVICE_TICKET/",
      "type": "text/html",
      "properties": {
        "price": {"currency": "GBP", "value": 9.99},
        "indirectAcquisition": [
          {
            "type": "application/vnd.readium.lcp.license.v1.0+json",
            "child": [{"type": "application/epub+zip"}]
          }
        ],
        "expiresAt": "2026-10-30T12:05:00Z"
      }
    },
    {
      "rel": "http://opds-spec.org/acquisition/buy",
      "href": "https://readino.com/checkout/p/PLACEHOLDER_QR_TICKET/",
      "type": "text/html",
      "properties": {
        "price": {"currency": "GBP", "value": 9.99},
        "indirectAcquisition": [
          {
            "type": "application/vnd.readium.lcp.license.v1.0+json",
            "child": [{"type": "application/epub+zip"}]
          }
        ],
        "expiresAt": "2026-10-30T12:05:00Z"
      }
    },
    {
      "rel": "https://readino.com/opds/rel/purchase-status",
      "href": "https://readino.com/api/v2/opds2/purchase-status/9d83a6d7-7348-4baa-a0eb-1f4ee2aac01e",
      "type": "application/vnd.readino.opds-purchase-status+json",
      "properties": {
        "https://readino.com/opds/properties/purchase-status-credential": "PLACEHOLDER_STATUS_SECRET"
      }
    }
  ]
}

The same-device/status relations, the status media type, expiresAt, and the status-credential property are Readino extensions. Both browser links have properties.expiresAt. Calculate their remaining lifetime against the response's HTTP Date, then use elapsed/monotonic time. Tickets last five minutes; refresh before displaying a nearly expired ticket. If Date or expiry is unusable, fetch a new prepared publication. This deadline controls entry to checkout, not the lifetime of an already-started payment.

The status link contains the property https://readino.com/opds/properties/purchase-status-credential. Its value is a secret for checking this purchase's status. Persist the status URL, credential, publication URL, catalogue/account or anonymous origin before leaving the app. Keep one record per operation, keyed by its status URL, and record which operation's browser or QR is being shown. Update that UI only from the matching operation's status response. The UUID at the end of the status URL is the non-secret purchaseId; status responses repeat it.

The QR contains only the browser buy URL, without the bearer token or status secret. If the returned publication has no fresh browser/status link set, update the UI from it: the book may be owned or unavailable. Do not reuse an old ticket. Preparation can return 401, 404, or 429 (Retry-After: 60).

Polling and completion

GET the status URL with:

Accept: application/vnd.readino.opds-purchase-status+json
Readino-Purchase-Status: <status-link credential>
Authorization: Bearer <token for the originating account>

Omit Authorization for anonymous-origin operations, including after a later catalogue sign-in. Authenticated-origin operations require both the status credential and the original account. An anonymous-origin credential can read its status after the browser account has been bound; it cannot download the book.

Example status response:

{
  "purchaseId": "9d83a6d7-7348-4baa-a0eb-1f4ee2aac01e",
  "status": "pending",
  "checkout": { "state": "opened", "mode": "qr" },
  "pollAfter": 5,
  "publication": {
    "href": "https://readino.com/api/v2/opds2/book/example-book-9780000000001",
    "type": "application/opds-publication+json"
  }
}

status is pending, processing, succeeded, failed, cancelled, or expired; the last four are terminal. checkout.state is not_opened, opened, or payment_started; checkout.mode is null, same_device, or qr.

Opening or scanning the URL alone leaves checkout at not_opened. After the user presses Continue purchase in the browser, checkout reports opened. payment_started means the server has accepted a payment attempt for this book; checkout.mode identifies the same-device or QR route used. Neither progress state means that payment succeeded. When the displayed QR's operation reports mode qr and state opened or payment_started, remove that QR and show checkout progress while polling. Do not let an older operation replace a newer operation's QR.

pollAfter is a number of seconds. Readino sends pollAfter: 5 and Retry-After: 5 on nonterminal status responses; terminal responses omit them. Wait for the longer delay. As a client fallback, use five seconds when pollAfter is missing or is not a positive finite number, and ignore an unusable Retry-After value. HTTP Retry-After can be delay-seconds or an HTTP date; respect a longer valid delay and never poll faster than once per second. Status throttling returns 429 with Retry-After: 5; use a five-second fallback if that header is missing. Preserve operations through network failures, process restarts, and foreground polling limits. On resume, poll again. Once payment has started or status is processing, keep tracking that operation instead of starting a new attempt.

On succeeded, fetch publication.href with account authentication and use its ordinary acquisition link. Status itself contains no download or LCP credential. Refresh affected shelves/profile too. For failed/cancelled/expired results, reload the publication before a new attempt.

Unknown operation, wrong credential/account, or expired retention can produce 404; this is not proof of payment failure. Reload the authenticated publication to check ownership. Terminal status records are retained for seven days.

Anonymous checkout and returning to the app

For anonymous handoffs, the browser handles sign-in/sign-up and chooses the purchasing account. Its account country determines availability, currency, and price; the browser asks the user to review changed offers. Successful status adds authenticationRequired: true, a masked purchaserHint, and an authentication link object pointing to the Authentication Document. The hint is display text, not an account identifier. Authenticate as the purchaser and reload the publication to establish ownership. An existing catalogue session may already be the right one; do not force logout. If it is the wrong account, retain the result and offer sign-in to the purchasing account.

For registered application schemes, authenticated-origin same-device checkout returns through <scheme>://return. Anonymous-origin success uses <scheme>://<readino-host>/catalogue/purchased/book/<slug>-<isbn>/; its other terminal outcomes use ://return. Without an application scheme, the fallback is an HTTPS book-sharing page. QR checkout does not send the scanning device back to the reading app.

The generic <scheme>://return callback contains no purchase ID or outcome. Treat it as a signal to resume checking stored operations, not as completion of the latest purchase. Resume due polls for unfinished records using each record's status URL, secret, and original authentication context. Match purchaseId consistently in responses; keep results associated with their own book and UI. The book-specific callback after an anonymous success identifies a book, not a unique operation; it also requires status/ownership checks when records overlap.