# Customer walkthrough

Five steps from a test key to a live integration, the same checklist as Developers → Walkthrough in the web app.

This guide is the readable twin of **Developers → Walkthrough** in the web app. The in-app version ticks each step off from your account's live state and fills in your customer id; here you set two variables yourself:

```sh
export WIREBLOOM_API_URL=https://api.staging.banking.wirebloom.com/v1   # sandbox
export WIREBLOOM_CUSTOMER_ID=<your customer id>
export WIREBLOOM_API_KEY=<the key from step 1, from your secrets manager>
```

Every call sends the key as a bearer token and `X-Tenant-Id` set to your customer id ([Tenancy](/docs/tenancy)). Use the least scopes each step needs; the [scope catalogue](/scopes) lists what every scope reaches.

## 1. Create a test key

An Owner or Admin opens **Developers → Keys** in the web app and creates a key with environment **test** (prefix `wb_test_`). Creating a key needs a fresh step-up verification, and the full key is shown **once**: store it in your secrets manager straight away. Keys are never created by another key ([session-only operations](/session-only)).

- Scopes for this walkthrough: `balances:read`, `recipients:write`, `payments:write`, `webhooks:manage`.
- `wb_test_` keys work only where the sandbox is enabled (staging and local stacks). If the walkthrough says the sandbox is off for your account, ask your operator for a developer workspace ([Sandbox and simulation](/docs/sandbox)).

Done when a test key that is not revoked exists.

## 2. Make your first call

List your balances ([listBalances](/reference/accounts#listBalances), scope `balances:read`):

```sh
curl "$WIREBLOOM_API_URL/balances" \
  -H "Authorization: Bearer $WIREBLOOM_API_KEY" \
  -H "X-Tenant-Id: $WIREBLOOM_CUSTOMER_ID"
```

```ts
const response = await fetch(`${process.env.WIREBLOOM_API_URL}/balances`, {
  headers: {
    Authorization: `Bearer ${process.env.WIREBLOOM_API_KEY}`,
    'X-Tenant-Id': process.env.WIREBLOOM_CUSTOMER_ID!,
  },
});
const page = await response.json(); // { data: [...], page: { nextCursor, ... } }
```

```python
import os, requests

r = requests.get(
    f"{os.environ['WIREBLOOM_API_URL']}/balances",
    headers={"Authorization": f"Bearer {os.environ['WIREBLOOM_API_KEY']}",
             "X-Tenant-Id": os.environ["WIREBLOOM_CUSTOMER_ID"]},
)
r.raise_for_status()
```

Done when any request was made with a key of your account in the last 7 days. **Developers → Usage** shows the request with its status and request id.

## 3. Do the core job

Create a recipient and send it a payment in the sandbox. Both POSTs need an `Idempotency-Key` ([Idempotency](/docs/idempotency)).

```sh
curl -X POST "$WIREBLOOM_API_URL/recipients" \
  -H "Authorization: Bearer $WIREBLOOM_API_KEY" \
  -H "X-Tenant-Id: $WIREBLOOM_CUSTOMER_ID" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "type": "company", "name": "Acme Supplies GmbH", "currency": "EUR",
        "bank": { "iban": "DE89370400440532013000", "bic": "COBADEFFXXX" } }'
```

Then pay it from a EUR balance ([createPayment](/reference/payments#createPayment), scope `payments:write`):

```sh
curl -X POST "$WIREBLOOM_API_URL/payments" \
  -H "Authorization: Bearer $WIREBLOOM_API_KEY" \
  -H "X-Tenant-Id: $WIREBLOOM_CUSTOMER_ID" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "sourceBalanceId": "<EUR balance id>", "recipientId": "<recipient id>",
        "amount": { "amountMinor": "12500", "currency": "EUR" },
        "reference": "Invoice 4711", "submit": true }'
```

A recipient or a payment may wait for a person to approve it: keys follow the same limits and approval tiers as the web app and never approve. In the sandbox, payments settle at once, except amounts whose minor units end in `77`, which stay pending until you simulate a status ([simulatePaymentStatus](/reference/simulations#simulatePaymentStatus)).

Done when the request log shows `POST /v1/recipients` or `POST /v1/payments` with a `2xx` answer.

## 4. Receive webhooks

Register an HTTPS endpoint ([createIntegratorWebhook](/reference/public-api#createIntegratorWebhook), scope `webhooks:manage`) and keep the `secret` from the response: it is shown once.

```sh
curl -X POST "$WIREBLOOM_API_URL/integrator-webhooks" \
  -H "Authorization: Bearer $WIREBLOOM_API_KEY" \
  -H "X-Tenant-Id: $WIREBLOOM_CUSTOMER_ID" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://erp.example.com/wirebloom/webhooks",
        "events": ["payment.status_changed", "incoming_payment.received"] }'
```

Send a signed test event with [testIntegratorWebhook](/reference/public-api#testIntegratorWebhook), or simulate money arriving with [simulateIncomingPayment](/reference/simulations#simulateIncomingPayment). Verify every delivery against the raw body ([Webhooks](/docs/webhooks)).

Done when an active endpoint has a successful delivery.

## 5. Go live

Ask an Owner or Admin to create a key with environment **live** (prefix `wb_live_`) and an IP allow-list of your servers' addresses, with only the scopes production needs. Then switch the base URL:

```sh
export WIREBLOOM_API_URL=https://api.banking.wirebloom.com/v1
```

- Requests from other addresses get `403` [`ip-not-allowed`](/errors#ip-not-allowed).
- Register your production webhook endpoint with the live key; sandbox endpoints stay in staging.
- Rotate keys regularly: rotation keeps the old key working for a grace period ([Authentication and API keys](/docs/authentication)).

Done when a live key with an IP allow-list exists.

## Next

- [Account management by API](/docs/customer-account-management): profile, people, documents, notifications and audit.
- [Customer recipes](/docs/recipes-customer): bulk uploads, scheduled payments, FX and statements.
- [SDKs](/docs/sdks) wrap auth, idempotency, pagination and retries for you.
