BillOS v1
Console llms.txt OpenAPI
POST/sandboxes/token

Collect an approved sandbox key

POST /sandboxes/token

The second half of POST /sandboxes. Takes no credential but the deviceCode. Answers status: "pending" until the person approves, then status: "approved" with the apiKey, exactly once: the next call is 404. If the person declines, the answer is 403 authorization_denied, also once: tell them, and do not start another authorization by yourself. An authorization that expired, or a code that is not known, is 404; start again with POST /sandboxes.

Body

FieldTypeDescription
deviceCodestringrequiredFrom POST /sandboxes.

Response

200: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
statusstringrequiredOne of: pending, approved.
intervalintegerWhile pending: seconds to wait before the next poll.
modestringWhen approved. One of: sandbox.
apiKeystringWhen approved: the bk_test_ key, shown here once.
keyPrefixstringWhen approved: the first characters of the key.
apiBasestring
mcpUrlstring
docsstring

Errors: 400, 403, 404, 429, 503. Every failure answers { "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }: branch on reason, and read hint for what to change (https://docs.billos.co.il/errors.md).

On this page
BodyResponse
POST /sandboxes/token
curl -X POST "$BASE/sandboxes/token" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceCode": "string"
  }'
const res = await fetch(`${BASE}/sandboxes/token`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "deviceCode": "string"
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.post(
    f"{BASE}/sandboxes/token",
    json={
      "deviceCode": "string"
    },
)
data = res.json()
Set BASE to https://api.billos.co.il/v1 and KEY to your bk_live_… key, or a bk_test_… key to run it against the sandbox.
Manage your businesses, keys and webhooks in the BillOS Console.