Booklinker integration guide

Create book links for your customers. They own the links and can manage them directly in Booklinker.

  1. 01 · Arrange access

    Agree the customer contract

    Confirm validated emails, stable customer IDs, scope, and request limits with Booklinker. Receive a test credential through the agreed secure channel.

  2. 02 · Build on your server

    Create your first link

    Send a validated customer email and book URL. Keep the returned link key and short URL, and reuse the same idempotency key on retries.

  3. 03 · Verify the experience

    Test with a customer

    Check email delivery, normal Booklinker sign-in, updates, and disconnection. Confirm the customer can still edit their link after your access ends.

API reference

Open the topic you need. Examples use placeholders; Booklinker supplies your environment’s API base URL and credential.

Access and authenticationCustomer identity, credentials, and environments
  • Use a stable, non-reassignable customer identifier. Agree how account merge, deletion, restore, and email changes work.
  • Verify that the customer controls their email before sending emailValidated: true.
  • Agree customer disclosure, data sharing, supported operations, incident contacts, and request limits before rollout.

Booklinker administrators issue credentials. Complete non-production testing with a dedicated customer and controlled inbox before receiving a separate production credential. Agree your authorization model and complete identity, disclosure, and rollout checks before using production credentials.

Authenticate from your server over HTTPS with this header:

Authorization: BooklinkerPartner <credentialId>.<secret>

Keep the complete value in your server’s secret manager, away from browser code, URLs, analytics, tickets, and logs. Development, stage, and production credentials are environment-bound. Do not send user cookies, impersonation headers, workspace IDs, or per-customer API keys.

For planned rotation, deploy a second credential, verify it, then ask Booklinker to revoke the old one. In-place rotation invalidates the previous secret immediately. Stop using a revoked or exposed credential and contact Booklinker.

Create a linkPOST · Customer provisioning and safe retries

POST /v1/partners/customers/{customerId}/links resolves or provisions the customer and creates an ordinary Booklinker link. An existing account is reused when its validated email matches; no separate signup or connection redirect is needed.

customerId
URL-encoded stable customer ID, 1–160 characters.
email
Validated customer email, at most 320 characters.
emailValidated
Must be true after your service has validated email control.
url
Supported retailer book URL. HTTP or HTTPS, at most 2,048 characters.
Idempotency-Key
Required header, 1–128 characters. Persist a unique key for each intended create across your partner account.

Reuse the exact same customer, normalized email, source URL, and idempotency key on retries. A timeout does not prove creation failed; a new key may create a second link.

POST /v1/partners/customers/{urlEncodedCustomerId}/links?format=json HTTP/1.1
Host: <Booklinker API host for your environment>
Authorization: BooklinkerPartner <credentialId>.<secret>
Content-Type: application/json
Accept: application/json
Idempotency-Key: <persisted unique operation key>

{
  "email": "validated-author@example.com",
  "emailValidated": true,
  "url": "https://retailer.example/book"
}

Check the HTTP status and response body, then save data.key and data.url for later operations. Do not construct the short URL from the key. destinationUrl is omitted when unavailable.

{
  "success": true,
  "statusCode": 200,
  "data": {
    "key": "canonical-link-key",
    "type": "link",
    "url": "https://mybook.to/example",
    "destinationUrl": "https://retailer.example/book"
  },
  "meta": {}
}

The API does not provide a standalone provision-only endpoint, partner link deletion, custom-domain selection, or vanity-code selection.

Read and update a linkGET / PUT · Saved links and pending updates

Use the opaque linkKey returned by create. URL-encode route values, request JSON with Accept: application/json and ?format=json, and send JSON bodies with Content-Type: application/json.

Read
GET /v1/partners/customers/{customerId}/links/{linkKey}
Update
PUT /v1/partners/customers/{customerId}/links/{linkKey} with { "url": "https://retailer.example/book" }.

You can manage only links your integration created for an actively associated customer. You cannot access their first-party links or another partner’s links.

200 · Complete
The update was applied synchronously. Retailers may normalize URLs; use the returned data.destinationUrl as the canonical destination.
202 · Pending
meta.updateState: "pending" means accepted, but not yet observed at the requested destination. data.destinationUrl may still be the old value. Use bounded GET polling with backoff and show an updating state until the requested destination is visible.
Errors and retriesStatus codes, conflicts, and backoff

Errors return success: false, statusCode, and responseStatus.errorCode/message, without data. Inspect both the HTTP status and body.

400
Invalid input or missing idempotency key. Correct the request before retrying.
401
Missing, invalid, revoked, or wrong-environment credential. Check the configured credential with Booklinker.
404
Link or association unavailable to your integration. This response does not reveal whether another customer or partner owns it.
409
Request already in progress, changed idempotency payload, identity conflict, or disconnected association. Retry an in-flight create with its original body and key after a delay; other conflicts need investigation. Do not invent a new customer ID to bypass disconnection.
422
Booklinker could not create or update the link. Check the supported book URL and contact support if it persists.
429
An integration limit was reached. Back off and retry with the same create body and idempotency key; honor Retry-After when supplied.
503
A dependency is temporarily unavailable. Use a bounded retry policy with backoff. For create, keep the same body and idempotency key so Booklinker can recover an interrupted result.

With X-Suppress-Errors: true, some handled errors use HTTP 200 while retaining the real error in statusCode. Authentication, rate-limit, and service-availability failures can still return HTTP errors.

Customer ownership and disconnectionDirect access, ending a connection, and launch checks

Your customer owns their account, personal workspace, and every created link. Explain that the feature may create or associate a free Booklinker account and that Booklinker sends ownership, association, security, and disconnection emails. Routine creates and updates do not send email by default.

Customers can sign in normally and disconnect your service under Account → Connections → Connected services. Your service can also disconnect its own customer association:

DELETE /v1/partners/customers/{customerId}/association

Either action stops partner create, read, and update access. The customer keeps their account, short URLs, and ability to edit their links directly.

Customer disconnection is permanent; automatic reconnection is not supported. Stop synchronization and direct the customer to Booklinker support; neither your service nor an operator can automatically reconnect them. An email change cannot silently move an established association to another user. Investigate identity conflicts rather than changing identifiers to bypass them.

Revoking a service credential is separate: it blocks that key without deleting customer associations or links.

  • Before rollout, test create, replay, read, update, disconnection, and denial after disconnection with a dedicated customer.
  • Open the ownership email, sign in normally, and verify author editing before and after disconnection.
  • Confirm inbox delivery, short-link availability, and the agreed support and incident contacts with Booklinker.