# Testguthaben abrufen

EUR-Testguthaben der Organisation abrufen

`GET https://tokenlane.de/api/credits/balance`

## Authentifizierung

[
  [
    {
      "name": "Authorization",
      "description": "Management-Key der Organisation: `Authorization: Bearer sk-tl-v1-…`. Bestehende `sk-eu-`-Keys bleiben gültig. Erforderliche Scopes stehen in `x-scopes`; Inferenz-Keys berechtigen nicht zu Verwaltungsoperationen.",
      "type": "http bearer",
      "location": "",
      "scopes": []
    }
  ]
]

## curl

```curl
curl --request GET \
  --url 'https://tokenlane.de/api/credits/balance' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## node

```node
const response = await fetch("https://tokenlane.de/api/credits/balance", {
  method: "GET",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
  },
});
console.log(await response.text());
```

## python

```python
import os
import urllib.request

request = urllib.request.Request(
    "https://tokenlane.de/api/credits/balance",
    method="GET",
    headers={
        "Authorization": "Bearer " + os.environ["TOKENLANE_API_KEY"],
    },
)

with urllib.request.urlopen(request) as response:
    print(response.read().decode("utf-8"))
```

## vercel

```vercel
// This operation uses HTTP directly.
const response = await fetch("https://tokenlane.de/api/credits/balance", {
  method: "GET",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
  },
});
console.log(await response.text());
```

## Antwort 200: application/json

Anfrage erfolgreich

```json
{
  "currency": "EUR",
  "amount": "YOUR_AMOUNT",
  "amountPicos": "YOUR_AMOUNTPICOS",
  "checkout": {
    "minimum": "YOUR_MINIMUM",
    "maximum": "YOUR_MAXIMUM",
    "remaining": "YOUR_REMAINING",
    "pausedUntil": "YOUR_PAUSEDUNTIL"
  },
  "heldAmountPicos": "YOUR_HELDAMOUNTPICOS",
  "bookedAmountPicos": "YOUR_BOOKEDAMOUNTPICOS",
  "pricing": {
    "basisPoints": 0,
    "fixedFee": "YOUR_FIXEDFEE",
    "minimumFee": "YOUR_MINIMUMFEE",
    "minimumAmount": "YOUR_MINIMUMAMOUNT"
  },
  "testMode": true
}
```

### s20: object

{}

- currency (Pflichtfeld): s81

### s81: string

"EUR"

{}

- amount (Pflichtfeld): s35

### s35: string

{}

- amountPicos (Pflichtfeld): s35

- checkout (Pflichtfeld): s82

### s82: object

{}

- minimum (Pflichtfeld): s35

- maximum (Pflichtfeld): s35

- remaining (Pflichtfeld): s35

- pausedUntil (Pflichtfeld): s86

### s86: string | null

date-time

{}

- heldAmountPicos (Pflichtfeld): s35

- bookedAmountPicos (Pflichtfeld): s35

- pricing (Pflichtfeld): s47

### s47: object

{}

- basisPoints (Pflichtfeld): s55

### s55: integer

{}

- fixedFee (Pflichtfeld): s35

- minimumFee (Pflichtfeld): s35

- minimumAmount (Pflichtfeld): s35

- byokQuota (optional): s48

### s48: object | null

{"additionalProperties":"false"}

- month (Pflichtfeld): s149

### s149: string

{"pattern":"\"^\\\\d{4}-\\\\d{2}$\""}

- free_limit (Pflichtfeld): s150

### s150: integer

{"minimum":"0"}

- free_used (Pflichtfeld): s150

- free_remaining (Pflichtfeld): s150

- month_bytes (Pflichtfeld): s150

- month_limit (Pflichtfeld): s151

### s151: integer

{"exclusiveMinimum":"0"}

- day_bytes (Pflichtfeld): s150

- day_limit (Pflichtfeld): s151

- parallel (Pflichtfeld): s150

- parallel_limit (Pflichtfeld): s151

- testMode (Pflichtfeld): s83

### s83: boolean

true

{}

## Antwort 401: application/json

Authentifizierung erforderlich: Zugangsdaten fehlen oder sind ungültig.

```json
{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}
```

### s11: object

{}

- requestId (optional): s56

### s56: string

Serverseitige Zuordnungs-ID für einen internen Fehler. Auch in X-Request-Id enthalten.

uuid

{}

- status (Pflichtfeld): s57

### s57: number

HTTP-Statuscode

{}

```json
400
```

- code (Pflichtfeld): s58

### s58: string

Fehlercode

{}

```json
"VALIDATION_ERROR"
```

- message (Pflichtfeld): s59

### s59: string

Fehlermeldung

{}

```json
"Request validation failed"
```

- remedy_hint (optional): s60

### s60: string

Sichere, ausführbare Abhilfe aus dem Fehlerkatalog.

{}

- details (optional): s61

### s61: array

Detaillierte Validierungsfehler

{}

### s154: object

{}

- path (Pflichtfeld): s179

### s179: string

Feldpfad

{}

```json
"title"
```

- message (Pflichtfeld): s180

### s180: string

Fehlermeldung zum Feld

{}

```json
"Required"
```

## Antwort 403: application/json

Berechtigungsumfang reicht nicht aus: authentifiziert, aber nicht berechtigt.

```json
{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}
```

## Antwort 409: application/json

Aktuell veröffentlichte Bedingungen vor Fortsetzen dieser Sitzung lesen und akzeptieren

```json
{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}
```

## Antwort 500: application/json

Interner Serverfehler

```json
{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}
```
