/ Docs

Integrate in 5 minutes

Accept Bitcoin on your site. We host the checkout, derive a fresh address from your xpub, and watch the chain. Funds land in your wallet directly — we never touch the money.

  1. 01 — Grab your API key

    Create a merchant account, then copy your sandbox key from Settings. It looks like sk_sandbox_…

  2. 02 — Add a payout wallet

    In Settings, paste your BIP84 xpub (zpub…). We derive a fresh address per checkout — the private keys never leave your wallet.

  3. 03 — Create a checkout session

    From your server, POST to /api/public/sessions. We return a checkout_url — redirect the customer there.

    JavaScript
    // On your server (Node, Bun, Deno, edge — anywhere)
    const res = await fetch("https://www.bitsettle.co/api/public/sessions", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.BITSETTLE_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        amount: 4999,            // pence / cents
        currency: "GBP",
        customer_email: customer.email,
        success_url: "https://yourstore.com/thanks",
        cancel_url: "https://yourstore.com/cart",
        metadata: { order_id: order.id },
      }),
    });
    
    const { checkout_url } = await res.json();
    // Redirect the customer:
    return Response.redirect(checkout_url, 303);
    curl
    curl -X POST https://www.bitsettle.co/api/public/sessions \
      -H "Authorization: Bearer sk_sandbox_..." \
      -H "Content-Type: application/json" \
      -d '{
        "amount": 4999,
        "currency": "GBP",
        "customer_email": "buyer@example.com",
        "success_url": "https://yourstore.com/thanks",
        "cancel_url": "https://yourstore.com/cart"
      }'

    Response

    JSON
    {
      "id": "cs_8fK2pQrLmN4vXz9aBdC1eF",
      "object": "checkout.session",
      "amount": 4999,
      "currency": "GBP",
      "status": "open",
      "checkout_url": "https://www.bitsettle.co/c/cs_8fK2pQrLmN4vXz9aBdC1eF",
      "expires_at": "2026-06-09T23:00:00.000Z"
    }
  4. 04 — Handle the redirect

    After payment, the customer is sent to your success_url with?session_id=cs_… appended. Cancellations go to cancel_url.

Request reference

POST /api/public/sessions

FieldTypeRequired
amountinteger (minor units)yes
currencyGBP | USD | EURno (GBP)
success_urlstring (https)yes
cancel_urlstring (https)yes
customer_emailstringno
metadataobject<string,string>no

Testing on another project

  1. Drop a "Pay with BitSettle" button on any site.
  2. On click, hit your own server which POSTs to /api/public/sessions.
  3. Redirect the user to the returned checkout_url.
  4. Watch the session land in your Transactions dashboard and BTC arrive in your wallet.

Sandbox keys simulate sessions · live keys move real BTC on mainnet