Skip to main content
This guide walks you through migrating your code from BookHub Publisher API v1 to v2. It covers the two breaking changes in v2: the hitCount field addition and the removal of title sorting. For the complete list of changes, see Breaking changes. For a complete overview, see Release notes.

Prerequisites

Before you begin, ensure you meet the following prerequisites:
  • Familiarity with BookHub Publisher API v1.
  • Access to your codebase that integrates with the BookHub Publisher API.
  • A valid JWT for authentication.

Step 1: Update base URLs

Start by updating all API URLs in your code from v1 to v2. For example:

Before (v1)

After (v2)

Step 2: Handle the hitCount field

Use the hitCount field on individual books to track views. Replace separate analytics API calls with this field in your existing code for retrieving book details. For details on hitCount data type, range, and availability, see Get a specific book.

Before (v1)

After (v2)

Step 3: Replace title sorting

v2 removes the sort=title parameter. Replace it with sort=createdDate:

Before (v1)

After (v2)

If your code still passes sort=title, v2 returns a 400 error. Handle it by falling back to sort=createdDate. See Migrate away from title sorting for the full error response and a retry pattern.

Step 4: Test your migration

After making these changes, test your code to ensure it works correctly with BookHub Publisher API v2. Verify that the hitCount field is accessible and that sorting behaves as expected. You should see 201, 200, and an integer hitCount.
  1. Send a Create book request and verify:
    • The responsereturns 201 Created with a bookId.
    • The Finalize book request returns 200 OK and updates the book status to ACTIVE.
    • The hitCount field is included and updates correctly for each retrieved book.
    • The date sorting functions as expected.
For example:

Next steps

Explore related topics:

Quickstart guide

  • Quickstart guide — Get up and running with the BookHub Publisher API v2 in minutes.

Conceptual guides

How-to guides

Reference


Last modified on July 25, 2026