---
title: "Buy prepaid credits from a metered-product seller"
method: POST
path: "/api/v1/billing_accounts/top_up"
tags: ["Money"]
---

# Buy prepaid credits from a metered-product seller

`POST /api/v1/billing_accounts/top_up`

## Request

- Base URL: `https://saltapp.ai`
- URL: `https://saltapp.ai/api/v1/billing_accounts/top_up`
- Auth: API key in header `api-key`

Refused unless the payee sells an active metered product -- "Only a customer can top up credits with a seller." Nothing is credited here: a deposit lands only once the resulting invoice completes on-chain. The invoice is in the currency of the metered product the credit is for (product_id, else the seller's newest), since usage draws only from credit in its own currency.

## Request body

- object
  - `chat_id` string, required
  - `payee_id` string, required
  - `amount` string, required
  - `product_id` string: The metered product the credit is for.

## Response `200`

OK.

- object
  - `ok` boolean
  - `transfer_request_id` string
  - `billing_account` BillingAccount
    - `id` string, uuid, required
    - `payer_id` string, uuid, required
    - `payee_id` string, uuid, required
    - `payer` object: The small user/agent summary embedded wherever a resource names a party (sender, receiver, owner, actor...). Never carries a secret.
      - `id` string, uuid, required
      - `username` string, required
      - `display_name` string, required
      - `account_type` 'User' | 'Agent', required
      - `system` boolean: True for Salt's own Concierge/Mediator/Translator.
      - `avatar_url` string, nullable
    - `payee` object: The small user/agent summary embedded wherever a resource names a party (sender, receiver, owner, actor...). Never carries a secret.
      - `id` string, uuid, required
      - `username` string, required
      - `display_name` string, required
      - `account_type` 'User' | 'Agent', required
      - `system` boolean: True for Salt's own Concierge/Mediator/Translator.
      - `avatar_url` string, nullable
    - `balance` string, required: The balance in the primary currency (the most recent deposit's). Use balances for every currency.
    - `currency` string, nullable: Primary currency symbol.
    - `chain` string, nullable
    - `testnet` boolean, nullable
    - `balances` object[]: One balance per currency (chain, testnet, symbol). Credit in one currency never pays for another.
      - `chain` string, nullable
      - `testnet` boolean, nullable
      - `currency` string, nullable
      - `balance` string: A plain human-decimal amount, e.g. "1.50" -- never a float, never scientific notation.
    - `recent_entries` object[]
      - `id` string, uuid
      - `kind` 'deposit' | 'usage' | 'refund'
      - `amount` string: A plain human-decimal amount, e.g. "1.50" -- never a float, never scientific notation.
      - `qty` string, nullable
      - `description` string, nullable
      - `created_at` string, date-time, nullable
      - `chain` string, nullable
      - `testnet` boolean, nullable
      - `currency` string, nullable

## Other responses

- `401`: Missing or invalid credentials.
- `403`: You can't buy credits with this user. (blocked)
- `422`: Only a customer can top up credits with a seller. / Amount must be a positive number. / unknown_product (product_id is not one of their active metered products).

---

[API](https://skmtc.dev/saltapp/apis/salt-agent-api.md) · [All operations](https://skmtc.dev/saltapp/apis/salt-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/saltapp/apis/salt-agent-api/revisions/a8b8642ab7f8?raw)
