# Your first call in 5 minutes

> Create sandbox credentials, request an access token, top up a test balance and withdraw COP over Bre-B.

In five minutes you will authenticate against the sandbox, load a simulated balance and create a Bre-B payout. No step moves real money.

## 1. Create your credentials

Request access in the [dashboard](https://developers.zulu.com.co/en/dashboard/request-access). Once your access is approved, create a credential set: you get a `client_id`, a `client_secret` and an `X-API-Key`. Secrets are shown only once.

Keep them as environment variables, never in your code:

```bash title=".env"
ZULU_CLIENT_ID=zsbx_ci_...
ZULU_CLIENT_SECRET=zsbx_cs_...
ZULU_API_KEY=zsbx_ak_...
```

## 2. Request an access token

Authentication is OAuth2 with the `client_credentials` grant, exactly as in production. The token lasts one hour: reuse it until it expires.

**POST /v1/auth/token**

```bash
curl https://sandbox.zulu.com.co/v1/auth/token \
  -H "Content-Type: application/json" \
  -d "{\"client_id\": \"$ZULU_CLIENT_ID\", \"client_secret\": \"$ZULU_CLIENT_SECRET\"}"
```

```js
const response = await fetch('https://sandbox.zulu.com.co/v1/auth/token', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ client_id: process.env.ZULU_CLIENT_ID, client_secret: process.env.ZULU_CLIENT_SECRET }),
});
const { access_token: accessToken, expires_in: expiresIn } = await response.json();
```

```python
import os

import requests

response = requests.post(
    "https://sandbox.zulu.com.co/v1/auth/token",
    json={"client_id": os.environ["ZULU_CLIENT_ID"], "client_secret": os.environ["ZULU_CLIENT_SECRET"]},
    timeout=30,
)
access_token = response.json()["access_token"]
```

**Response 200**

```json
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}
```

Export the token for the next steps: `export ZULU_ACCESS_TOKEN=eyJ...`.

## 3. Top up a test balance

A new workspace starts with no balance. In the sandbox you top it up with a simulator that does not exist in production:

**POST** `/v1/sandbox/balances/top-up` — Top up the simulated balance · [Sandbox only] · [See the reference](https://developers.zulu.com.co/en/reference/top-up-balance.md)

**POST /v1/sandbox/balances/top-up**

```bash
curl https://sandbox.zulu.com.co/v1/sandbox/balances/top-up \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "currency": "COP",
  "amount": 50000000
}'
```

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/sandbox/balances/top-up', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ZULU_ACCESS_TOKEN}`,
    'X-API-Key': process.env.ZULU_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "currency": "COP",
    "amount": 50000000
  }),
});

console.log(response.status, await response.json());
```

```python
import os

import requests

response = requests.post(
    "https://sandbox.zulu.com.co/v1/sandbox/balances/top-up",
    headers={
        "Authorization": f"Bearer {os.environ['ZULU_ACCESS_TOKEN']}",
        "X-API-Key": os.environ["ZULU_API_KEY"],
    },
    json={
        "currency": "COP",
        "amount": 50000000,
    },
    timeout=30,
)
print(response.status_code, response.json())
```

## 4. Withdraw COP over Bre-B

Every call carries the token in `Authorization` and your `X-API-Key`. With `breBKey` and an amount within the Bre-B maximum, the withdrawal goes out over Bre-B; zulu tells you the method in `method`.

**POST /v1/transfer**

```bash
curl https://sandbox.zulu.com.co/v1/transfer \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 50000,
  "destination": {
    "entityType": "person",
    "documentType": "CC",
    "documentNumber": "1020304050",
    "firstName": "Luis",
    "lastName": "Gómez",
    "bankAccount": {
      "bankCode": "0007",
      "accountType": "ahorros",
      "accountNumber": "0012345678"
    },
    "breBKey": {
      "key": "@luisgomez",
      "keyType": "ALPHA",
      "bankOrgId": "890903938",
      "bankCamera": "TFY"
    }
  }
}'
```

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/transfer', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ZULU_ACCESS_TOKEN}`,
    'X-API-Key': process.env.ZULU_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "amount": 50000,
    "destination": {
      "entityType": "person",
      "documentType": "CC",
      "documentNumber": "1020304050",
      "firstName": "Luis",
      "lastName": "Gómez",
      "bankAccount": {
        "bankCode": "0007",
        "accountType": "ahorros",
        "accountNumber": "0012345678"
      },
      "breBKey": {
        "key": "@luisgomez",
        "keyType": "ALPHA",
        "bankOrgId": "890903938",
        "bankCamera": "TFY"
      }
    }
  }),
});

console.log(response.status, await response.json());
```

```python
import os

import requests

response = requests.post(
    "https://sandbox.zulu.com.co/v1/transfer",
    headers={
        "Authorization": f"Bearer {os.environ['ZULU_ACCESS_TOKEN']}",
        "X-API-Key": os.environ["ZULU_API_KEY"],
    },
    json={
        "amount": 50000,
        "destination": {
            "entityType": "person",
            "documentType": "CC",
            "documentNumber": "1020304050",
            "firstName": "Luis",
            "lastName": "Gómez",
            "bankAccount": {
                "bankCode": "0007",
                "accountType": "ahorros",
                "accountNumber": "0012345678",
            },
            "breBKey": {
                "key": "@luisgomez",
                "keyType": "ALPHA",
                "bankOrgId": "890903938",
                "bankCamera": "TFY",
            },
        },
    },
    timeout=30,
)
print(response.status_code, response.json())
```

**Response 201**

```json
{
  "transactionId": "SBX-OR-NPTRFI2611243HWD8T-6P",
  "status": "CREATED",
  "method": "BRE_B"
}
```

## 5. Follow the status

In the sandbox a Bre-B payout ends `COMPLETED` within seconds. Check it, or set up the `TRANSACTIONS` webhook to hear about it without asking:

**GET** `/v1/transactions/{transactionId}` — Get a transaction · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/get-transaction.md)

> **Note**
>
> To force rejections and the other methods, use the [test data](https://developers.zulu.com.co/en/docs/test-data.md): account `0000000001` ends `REJECTED` and key `@failbreb` falls back to manual payment.

## Next steps

- Learn how zulu picks the method in [Payouts and method selection](https://developers.zulu.com.co/en/docs/payout/transfers.md).
- Receive money with [PSE links, Bre-B keys and QR codes](https://developers.zulu.com.co/en/docs/pay-in.md).
- Receive [signed webhooks](https://developers.zulu.com.co/en/docs/webhooks.md) on your server.
