> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talescria.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an OAuth client, get an access token and list your accounts.

You'll need a Talescria account. Test mode works straight after sign-up, before your business is verified.

**1. Create an OAuth client**

In the dashboard, go to **Settings → OAuth clients → Create**, choose **Test**, and pick the permissions (scopes) it needs. For this quickstart, **Accounts: read** is enough.

Copy the client ID (`cl_…`) and secret (`sk_test_…`). **The secret is shown once.** Store it like a password, on your server only.

**2. Get an access token**

Exchange the client's credentials for an access token. Tokens last 15 minutes.

```bash curl theme={null}
curl https://idp.talescria.com/oauth/token \
  -u "$TALESCRIA_CLIENT_ID:$TALESCRIA_CLIENT_SECRET" \
  -d grant_type=client_credentials
```

```python Python theme={null}
import os
import requests

resp = requests.post(
    "https://idp.talescria.com/oauth/token",
    auth=(os.environ["TALESCRIA_CLIENT_ID"], os.environ["TALESCRIA_CLIENT_SECRET"]),
    data={"grant_type": "client_credentials"},
    timeout=30,
)
resp.raise_for_status()
access_token = resp.json()["access_token"]
```

```json Response theme={null}
{
  "access_token": "at_test_…",
  "refresh_token": "rt_test_…",
  "token_type": "Bearer",
  "expires_in": 900,
  "scope": "accounts:read"
}
```

**3. List your accounts**

Send the token as a bearer token.

```bash curl theme={null}
curl https://api.talescria.com/v1/accounts \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

```python Python theme={null}
resp = requests.get(
    "https://api.talescria.com/v1/accounts",
    headers={"Authorization": f"Bearer {access_token}"},
    timeout=30,
)
resp.raise_for_status()
for account in resp.json()["accounts"]:
    if account["status"] == "ok":
        print(account["accountId"], account["currency"], account["available"]["minorUnits"])
```

A new account has no accounts yet, so you'll see `"accounts": []`. That's expected.

**4. Open an account**

Opening an account needs the **Accounts: write** scope. Add it to your client in the dashboard, then get a new token.

```bash curl theme={null}
curl https://api.talescria.com/v1/accounts \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"currency": "GBP", "name": "Operations"}'
```

```python Python theme={null}
import uuid

resp = requests.post(
    "https://api.talescria.com/v1/accounts",
    headers={
        "Authorization": f"Bearer {access_token}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={"currency": "GBP", "name": "Operations"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json()["account"])
```

The new account has a zero balance. List your accounts again and it's there.

## Next steps

> [card] [Authentication](https://docs.talescria.com/concepts/authentication.md)
>
> Scopes, token lifetimes and refreshing.

> [card] [Pay a recipient](https://docs.talescria.com/guides/payments.md)
>
> Add a recipient and send them money.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.