---
title: "Refund unused usage back onto a billing account"
method: POST
path: "/api/v1/billing_accounts/{id}/refund"
tags: ["Money"]
---

# Refund unused usage back onto a billing account

`POST /api/v1/billing_accounts/{id}/refund`

## Request

- Base URL: `https://saltapp.ai`
- URL: `https://saltapp.ai/api/v1/billing_accounts/{id}/refund`
- Auth: API key in header `api-key`

Payee only; capped at usage minus prior refunds in the one currency being refunded (with_lock). Name the currency with chain, testnet and currency; they can be left out when the account's usage is in a single currency.

## Path parameters

- `id` string, required

## Request body

- object
  - `amount` string, required
  - `memo` string
  - `chain` string
  - `testnet` boolean
  - `currency` string: The wallet's symbol, e.g. ETH.

## Response `200`

OK.

- object
  - `ok` boolean
  - `entry_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`: Not your billing account.
- `422`: refund_exceeds_usage. / currency_required (the response lists the currencies with usage).

---

[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)
