Call the API

Base URL, authentication, pagination, idempotency, errors and limits.

Embed
Preview of the card
<a href="https://linkyhub.net/docs/calling-the-api"><img src="https://linkyhub.net/docs/_api/public/orgs/2fd2a4b7-b627-4925-af1e-1c51bf890403/spaces/c4b920fb-a433-40b5-b354-ff84bf0c3eb1/pages/73d7a775-b124-4fed-b9c5-7956080d47a7/social-card.svg?v=3e7ae33eec8b" alt="Call the API" width="600" height="315"></a>

The API lives at https://linkyhub.net/api/v3. Every endpoint is listed in the API reference, which you can try in the browser, and the OpenAPI document is at /api/v3/openapi.json.

curl "$LINKHUB_URL/api/v3/products" -H "Authorization: Bearer $ACCESS_TOKEN"

Pagination

Every list returns { "data": [...], "nextCursor": "..." }. Pass ?cursor= with the last nextCursor to get the next page; a null cursor means you have everything.

Lists also repeat data under a key named after what they hold, such as products or orders. Those keys are deprecated and kept only so older integrations keep working, so read data.

GET /products also takes updatedSince (ISO 8601) to return only what changed since your last sync, and every product carries updatedAt.

Idempotency

Two writes take an Idempotency-Key header (up to 200 characters):

  • Refunds require one. Sending the same key again returns the first refund instead of making a second one, so a retry after a timeout is safe.

  • POST /products takes one optionally. Within 24 hours the same key returns the first product instead of creating another, and the same key with a different body is 409 conflict. After 24 hours the key is free again.

Keys are per app and creator, so two apps cannot collide.

Errors

{ "error": "insufficient_scope", "message": "This token was not granted products:write." }

Branch on error; show message.

Code

Status

Meaning

unauthorized

401

No bearer token

invalid_token

401

Expired or revoked: refresh

insufficient_scope

403

Names the scope you need

invalid_request

400

Malformed

not_found

404

No such thing, or not this creator's

conflict

409

The state does not allow it, or an Idempotency-Key or externalId was already used

rate_limited

429

Honour Retry-After

server_error

500

Ours

Limits

600 requests a minute per app and creator. Every authenticated response says where you stand:

Header

Meaning

RateLimit-Limit

Requests allowed in the window (600)

RateLimit-Remaining

Requests left in the window

RateLimit-Reset

Seconds until the window resets

Over the limit you get 429 rate_limited with Retry-After in seconds.

Orders

Every order carries updatedAt. GET /orders?updatedSince=<ISO 8601> returns only orders changed at or after that instant, for incremental sync.

Fees. Linky Hub takes no cut of any sale, on any plan: platformFeeCents is always 0. processingFeeCents (what Stripe or PayPal kept) is not recorded on the order, so it is null, and so is netCents (amountCents minus both fees). Both are known (0 and amountCents) on a test order. shippingCents and taxCents are 0, because checkout adds no separate shipping or tax line.

Shipping address. A product with isPhysical: true collects one at checkout, and its orders stay PAID until fulfilled. With orders:read_customer, buyer.shippingAddress is null for a digital order. For a physical one it is:

Field

name

string or null

line1

string or null

line2

string or null

city

string or null

state

string or null: state, province or region

postalCode

string or null

country

ISO 3166-1 alpha-2, such as US

phone

string or null; usually null

The shape is the same whether Stripe or PayPal took the payment.

Fulfilment. POST /orders/{orderId}/fulfil takes optional trackingNumber (up to 100 characters), carrier (up to 50), trackingUrl and notifyBuyer (email the buyer). A second call replaces the tracking. Orders return trackingNumber, carrier, trackingUrl and fulfilledAt.

Test mode. POST /test/orders (orders:write) takes { productId, variantId?, buyer? }. It makes a PAID order with test: true and fires order.paid. It works only for an app that is not yet approved, acting for its owner, or for a personal API key. Refund a test order with POST /test/orders/{orderId}/refunds (orders:write): no Stripe call and no orders:refund needed. Test orders are left out of earnings, analytics, payouts and salesCount, and their buyers are never emailed. Event payloads for them carry test: true.

Things worth knowing

  • A product can have variants (size, colour and so on). Each variant can carry its own price and stock; a variant with no price uses the product's.

  • A product's first image is its cover.

  • Refunds can be partial. An order becomes PARTIALLY_REFUNDED or REFUNDED, and you cannot refund more than was paid.

  • Money is in the smallest currency unit (cents).

  • To put an image on a page or product, upload it first: POST /media as multipart/form-data with a file part (media:write). Use the url it returns in block settings or product images. Uploading is REST only; MCP has no file parts.

  • Adding a custom domain and checking its DNS share a stricter limit than the rest of the API, as does submitting templates to the gallery.

Updated