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

# Accounts and fund allocation

<Note>**Disclaimer: This article contains AI translations and should only be used as reference.** Contact Cobo's support team through [help@cobo.com](mailto:help@cobo.com) if you have any questions.</Note>

This article introduces the various types of accounts involved in fund management, and how funds are efficiently allocated and managed between accounts through **settlement** and **allocation** after payment collection.

## Accounts

An account is a virtual fund entity managed in the system ledger, without a one-to-one correspondence to on-chain wallets or addresses.

* Each operation such as payment collection, settlement, fees, refunds, or payouts creates detailed entries in the ledger, which dynamically update the balance of each account.
* Fund allocation between accounts (such as automatic settlement or manual allocation) only flows within the ledger and does not directly result in on-chain transfers. Only when performing payouts or refunds will actual on-chain asset transfers be triggered.

The following accounts are currently supported:

* **Developer account**: A single account that holds the developer balance. This represents funds belonging to you as the payment collection service provider.
* **Merchant accounts**: Each merchant corresponds to an account that holds its respective merchant balance. Each merchant represents an actual business entity receiving payments.

When you perform operations such as payouts or refunds, you need to select which account to use as the source of funds.

## Fund settlement and allocation

Funds can be distributed between accounts in two ways:

* **Automatic settlement**: During the payment collection process, funds are automatically settled to merchant accounts and the developer account based on predefined rules.
* **Manual allocation**: You can use the Allocate feature to manually transfer funds between accounts.

### Automatic settlement

When a payment is received, the system automatically distributes funds to the corresponding merchant account and developer account based on predefined rules. The diagram below illustrates this settlement process. The specific settlement rules may vary depending on the payment collection mode:

```mermaid theme={null}
%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    A[Payer A<br/>100 USDT] --> B[Merchant A<br/>Rate: 2%]
    C[Payer B<br/>100 USDT] --> D[Merchant B<br/>Rate: 1.5%]
    E[Payer C<br/>100 USDT] --> F[Merchant C<br/>Rate: 1%]
    
    B --> G[Merchant A Account<br/>98 USDT]
    B --> H[Developer Fee<br/>2 USDT]
    
    D --> I[Merchant B Account<br/>98.5 USDT]
    D --> J[Developer Fee<br/>1.5 USDT]
    
    F --> K[Merchant C Account<br/>99 USDT]
    F --> L[Developer Fee<br/>1 USDT]
    
    H --> M[Developer Account<br/>4.5 USDT]
    J --> M
    L --> M
    
    style A fill:#e3f2fd
    style C fill:#e3f2fd
    style E fill:#e3f2fd
    style B fill:#f3e5f5
    style D fill:#f3e5f5
    style F fill:#f3e5f5
    style G fill:#c8e6c9
    style I fill:#c8e6c9
    style K fill:#c8e6c9
    style H fill:#fff3e0
    style J fill:#fff3e0
    style L fill:#fff3e0
    style M fill:#fff3e0
```

#### Top-up mode

In top-up mode, fund settlement is based on the developer fee rate (`developer_fee_rate`) set when creating the merchant. The developer fee rate determines the proportion of each top-up that is settled to the developer account.

**Example**: When the developer fee rate is 1%, a 100 USDT top-up will be settled as 99 USDT to the merchant account and 1 USDT to the developer account.

```mermaid theme={null}
%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    A[Developer fee rate: 1%] --> B[Payer top-up<br/>100 USDT]
    
    B -->|99 USDT| E[Merchant account<br/>+99 USDT]
    B -->|1 USDT| F[Developer account<br/>+1 USDT]
    
    style A fill:#e3f2fd
    style B fill:#f3e5f5
    style E fill:#c8e6c9
    style F fill:#fff3e0
```

#### Order mode

In order mode, fund settlement is based on the amount parameters set when creating the order. The ratio between the developer fee (`fee_amount`) and the order amount (`pricing_amount`) determines the proportion of each order that is settled to the developer account.

**Example**: When the order amount is 99 USDT and the developer fee is 1 USDT, the actual received amount of 100 USDT will be settled as 99 USDT to the merchant account and 1 USDT to the developer account:

```mermaid theme={null}
%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    A[Order amount 99 USDT<br/>Developer fee 1 USDT] --> B[Payer payment<br/>100 USDT]
    
    B -->|99 USDT| E[Merchant account<br/>+99 USDT]
    B -->|1 USDT| F[Developer account<br/>+1 USDT]
    
    style A fill:#e3f2fd
    style B fill:#f3e5f5
    style E fill:#c8e6c9
    style F fill:#fff3e0
```

<Note>
  Special case handling:

  * Overpayment/Underpayment: Funds are settled according to the same ratio as above
  * Late payment: All funds are settled to the developer account
</Note>

#### Refunds

The source of the refund amount can be either the merchant account or the developer account.

* When the refund amount comes from the merchant account, you can specify a developer fee to charge a service fee for the refund. For example, when the refund amount (`payable_amount`) is 100 USDT and the developer fee (`merchant_fee_amount`) is 1 USDT, 1 USDT from the 100 USDT refund will be settled to the developer account, and the payer will actually receive 99 USDT.
* When the refund amount comes from the developer account, the developer fee field will be ignored, and the full refund amount will be deducted from the developer account and transferred to the payer.

The following diagram shows the settlement and flow of funds during the refund process (sample data):

```mermaid theme={null}
%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    F[Select refund source] -->|Refund from merchant account| E1[Create refund order<br/>Refund amount: 100 USDT<br/>Developer fee: 1 USDT]
    F -->|Refund from developer account| E2[Create refund order<br/>Refund amount: 100 USDT]
    
    E1 --> G[Deduct 100 USDT from<br/>merchant account]
    E2 --> H[Deduct 100 USDT from<br/>developer account]
    
    G --> J[Payer actually receives<br/>99 USDT]
    G --> K[Developer account<br/>+1 USDT]
    
    H --> L[Transfer to payer<br/>100 USDT]
    
    style F fill:#f3e5f5
    style E1 fill:#e3f2fd
    style E2 fill:#e3f2fd
    style G fill:#c8e6c9
    style H fill:#fff3e0
    style J fill:#c8e6c9
    style K fill:#fff3e0
    style L fill:#c8e6c9
```

### Manual allocation

In addition to automatic settlement during payment collection, you can also use the Allocate feature to manually transfer funds between accounts. For details, see [Allocate funds](/payments/en/guides/allocate-funds).

## Balances

Account balance refers to the total amount of funds in an account that can be used for payouts or refunds at a specific moment. This balance can be queried through the **Balance** module in the Payments App or by calling [List merchant balances](/payments/en/api-references/payment/list-merchant-balances) and [Get developer balance](/payments/en/api-references/payment/get-developer-balance).

Balance changes mainly come from the following activities:

**Situations that increase balance:**

* Automatic settlement during payment collection
* Manual allocation transfer in
* Automatic settlement during refunds (only applicable to the developer account)

**Situations that decrease balance:**

* Payout
* Refund
* Manual allocation transfer out

The following diagram shows the main sources and destinations of merchant account balances and developer account balances (allocation operations not included):

```mermaid theme={null}
%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    A[Payment collection]
    
    A --> L[Under review, isolated<br>or frozen amount]
    A --> F[Merchant account balance]
    A --> G[Developer account balance]
    
    F --> H[Payout]
    F --> I[Refund]
    
    G --> J[Payout]
    G --> K[Refund]
    
    M[Developer fee collected from refunds] --> G
    
    style A fill:#e1f5fe
    style F fill:#c8e6c9
    style G fill:#fff3e0
    style H fill:#c8e6c9
    style I fill:#c8e6c9
    style J fill:#fff3e0
    style K fill:#fff3e0
    style M fill:#e1f5fe
    style L fill:#ffebee
```
