← halfin journalMar 17, 2026 · 5 min read
Engineering

Your first hour in the halfin sandbox

A guided tour: create a key, fire an invoice, simulate a confirmation, replay a webhook. Everything you need to demo a flow before standup.

hd
halfin devrelDevRel
First hour in halfin sandbox tour cover
engineering · cover
photo · Florian Olivo on Unsplash

You signed up for a halfin sandbox key. You have 60 minutes before standup. Create an invoice, simulate confirmation, replay a webhook, and walk in with a working demo.

Minute 0–5: get the key

Hit the dashboard, click Sandbox, click New key. The key has the prefix sk_test_ and is scoped to your sandbox account only. It cannot, by construction, move real money.

dashboard · sandbox key
cover · placeholder
Dashboard sandbox key creation

Copy the key into an environment variable:

export HALFIN_KEY=sk_test_abc123…

Minute 5–15: fire your first invoice

The fastest way is curl. The fastest typed way is our SDK; let's do both.

curl https://stage.halfin.xyz/api/v1/invoices \
  -H "X-API-Key: $HALFIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "BTC",
    "amount": "0.01000000",
    "description": "Order #0001",
    "idempotency_key": "order-0001"
  }'

You get back an invoice with a hosted_url. Open it. You'll see the halfin checkout page rendered for your invoice.

Minute 15–25: simulate a confirmation

In the sandbox, you don't actually pay. You simulate. The dashboard has a "Simulate payment" button on every test invoice; clicking it walks the invoice through the full lifecycle:

draft → pending → detected → confirming → paid

Each transition fires a webhook. If you've registered a webhook endpoint, it'll receive five events. If you haven't, the events queue in the dashboard's "Deliveries" tab and you can replay them later.

simulate · lifecycle
cover · placeholder
Lifecycle simulation, dashboard view

Minute 25–40: register a webhook and replay

Set up a webhook endpoint with webhook.site or ngrok pointing at localhost. In the dashboard, paste the URL into Sandbox Webhooks.

Now click Replay on any of your queued events. The webhook lands at your endpoint with the full envelope:

{
  "event_id": "evt_019df1ec...",
  "type": "invoice.paid",
  "created_at": "2026-05-04T14:32:11Z",
  "data": { "invoice_id": "in_019df1ec...", ... }
}

Verify the signature (the dashboard shows you the verification cookbook in your language of choice). If the signature checks out, you're integrated.

Minute 40–55: your first payout

Same shape, opposite direction:

curl https://stage.halfin.xyz/api/v1/payouts \
  -H "X-API-Key: $HALFIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "BTC",
    "amount": "0.01000000",
    "destination": "bc1qexampleaddress000000000000000000000000",
    "idempotency_key": "payout-0001"
  }'

The sandbox doesn't actually move funds, but it walks the payout through the full state machine and fires webhooks at each step.

Minute 55–60: walk into standup

You have:

  • A live invoice
  • A simulated confirmation
  • A verified webhook delivery
  • A simulated payout

That's the loop. Everything we sell is built on that loop. The production version uses the same shape, SDK, and webhook contract, just a different key prefix.

The fastest demo is the one you actually shipped.

halfin devrel

↳ end of articlehalfin journal · Mar 17, 2026