# Developer docs

Your customers pay through the payment providers you connect, into your own accounts, and ShipBill tells your server what was paid. Put it on your site in whichever of these ways suits you, from no code at all to your own payment form.

## Choose how to integrate

| Option | Effort | How it works |
| --- | --- | --- |
| [Payment link](https://shipbill.io/docs/payment-links) | None | Create a link for a product in the dashboard and share it anywhere. |
| [Buy button](https://shipbill.io/docs/buy-button) | A snippet | A button on your page opens the checkout over it, for one product. No server needed. |
| [Hosted checkout](https://shipbill.io/docs/hosted-checkout) | One API call | Your server creates a checkout; you send the buyer to its page. |
| [Embedded checkout](https://shipbill.io/docs/embedded-checkout) | An API call and a script | Your server creates a checkout; your page opens it in a window over itself. |
| [Custom checkout](https://shipbill.io/docs/custom-checkout) | Full build | Your own payment page on ShipBill's API; the buyer pays on the provider's page. |

**When it matters who is paying** — a signed-in user upgrading their account — create the checkout on your server (hosted or embedded), so you set who it's for. The buy button and payment links suit selling to anyone. All of them end in the same webhook, `payment.succeeded`.

> **Fulfil on the webhook, not on the redirect**
>
> The buyer coming back to your page, or the checkout's `onComplete`, only says they were there. Deliver the order when your server receives a verified [webhook](https://shipbill.io/docs/webhooks), or after your server asks ShipBill for the checkout and finds it paid.

## Five ideas every integration shares

### Products carry the price

You create products in the dashboard or the API. A checkout names a product by its ID (`prod_…`), and ShipBill looks up its title and price itself, so nothing in a browser can change what is charged. A server can also charge a [custom amount](https://shipbill.io/docs/hosted-checkout#custom-amount), with a secret key.

### Two kinds of key

A **secret key** (`sk_live_…`) stays on your server and can do everything. A **publishable key** (`pk_live_…`) is safe in a web page: it can only open a checkout for one of your active products at its stored price, and only from the websites you allow. Both are in the dashboard under Payments → Website integration → API keys.

### Test mode and live mode

Every profile has a test mode with its own keys (`sk_test_…`, `pk_test_…`), data, and webhook endpoints, and no real money. A test key never sees live data, and a live key never sees test data. See [Testing](https://shipbill.io/docs/testing).

### Your reference

Give each checkout your own ID in `reference` — an order number, or your user's ID. It comes back on every event about that purchase, renewals included, so you never have to map ShipBill's IDs to yours.

### Webhooks are the proof

ShipBill calls your server with signed events when something happens. Your server checks the signature and acts. See [Webhooks](https://shipbill.io/docs/webhooks).

## Your first call

First connect the Test provider in **Settings → Payment providers**: a checkout needs a provider to take its payment, and this one takes test payments without an account. Then, with a test secret key from the dashboard:

```bash
curl https://api.shipbill.io/v1/checkout/sessions \
  -H "Authorization: Bearer $SHIPBILL_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_1001-checkout" \
  -d '{
    "line_items": [{ "product": "prod_…", "quantity": 1 }],
    "reference": "order_1001",
    "success_url": "https://example.com/thanks"
  }'
```

The answer is the checkout session, with its `url` to send the buyer to and the `client_token` for the embedded checkout. Every request and answer is in the [API reference](https://shipbill.io/docs/api).

> **Libraries**
>
> `@shipbill/node` wraps the API for Node, with types and the signature check; `shipbill.js` runs the checkout in your pages. See [Libraries](https://shipbill.io/docs/libraries). Any language can use the HTTP API directly.

Last checked against the product on 12 October 2026.
