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

# Payment Operations

> Learn how to create collection accounts and process payouts step-by-step using Carbon Business API.

This guide covers essential payment operations including setting up collection accounts for receiving funds and processing payouts to beneficiaries.

## Creating Collection Accounts

There are two types of accounts you can create via the API, each serving different purposes:

<Warning>
  Dashboard accounts are not accessible via the API. You must create accounts programmatically for API operations.
</Warning>

### Option 1: Collection Sub-Accounts (No Customer Required)

Collection sub-accounts are designed for receiving payments and do not require customer creation.

<Steps>
  <Step title="Create Collection Sub-Account">
    Use the [Create Account](/api-reference/accounts/create-account) endpoint directly for collection purposes:

    ```json theme={null}
    {
      "account_type": "static",
      "third_party": false,
      "account_name": "Collections Account"
    }
    ```

    <Info>
      The API will return an account number that can receive payments from any bank in Nigeria. No customer creation is needed for this type of account.
    </Info>
  </Step>
</Steps>

### Option 2: Customer-Linked Business Accounts

Business accounts are linked to specific customers and require customer creation first.

<Steps>
  <Step title="Create Customer">
    Use the [Create Customer](/api-reference/customers/create-customer) endpoint to register customer details:

    ```json theme={null}
    {
      "email": "customer@example.com",
      "phone": "08012345678",
      "first_name": "John",
      "last_name": "Doe",
      "bvn": "12345678901"
    }
    ```
  </Step>

  <Step title="Create Customer-Linked Account">
    Use the [Create Account](/api-reference/accounts/create-account) endpoint with the customer ID:

    ```json theme={null}
    {
      "account_type": "static",
      "third_party": true,
      "customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3"
    }
    ```

    <Info>
      This creates a business account linked to the specific customer for more personalized banking operations.
    </Info>
  </Step>
</Steps>

### Monitoring Collections

Track incoming payments using webhooks and transaction endpoints for both account types.

<Steps>
  <Step title="Set Up Webhooks">
    Configure webhooks to receive real-time notifications for incoming transactions:

    * `account.incoming-transaction` - Triggered when funds are received

    See [Webhooks Documentation](/webhooks/introduction) for setup details.
  </Step>

  <Step title="Fetch Transactions">
    Use [Fetch Transactions](/api-reference/transactions/fetch-transactions) to retrieve payment history and verify collections.
  </Step>
</Steps>

## Processing Payouts

Payouts allow you to send money from your API-created accounts to any Nigerian bank account.

<Note>
  Minimum payout amount is ₦200. Source account must be created via the API.
</Note>

### Step 1: Validate Beneficiary Account

Before initiating any payout, validate the beneficiary's account details.

<Steps>
  <Step title="Resolve Account Details">
    Use the [Resolve Account](/api-reference/banks/resolve-account) endpoint to verify beneficiary information:

    ```json theme={null}
    {
      "account_number": "1234567890",
      "bank_code": "058"
    }
    ```

    <Info>
      This endpoint returns the actual account name, which you'll need for the payout request.
    </Info>
  </Step>
</Steps>

### Step 2: Check Account Balance

Ensure your source account has sufficient funds for the payout.

<Steps>
  <Step title="Fetch Balance">
    Use [Fetch Balance](/api-reference/accounts/fetch-balance) to check available funds in your source account.

    <Warning>
      Verify you have enough balance to cover both the payout amount and any applicable fees.
    </Warning>
  </Step>
</Steps>

### Step 3: Create Payout

Execute the payout using validated beneficiary details and your API-created source account.

<Steps>
  <Step title="Initiate Payout">
    Use the [Create Payout](/api-reference/payouts/create-payout) endpoint:

    ```json theme={null}
    {
      "amount": 50000,
      "source": {
        "account_number": "your_api_account_number"
      },
      "beneficiary": {
        "bank_code": "058",
        "bank_name": "GTBank",
        "account_number": "1234567890",
        "account_name": "Jane Smith"
      },
      "reference": "PAYOUT_USER123_20260119",
      "remark": "Service payment"
    }
    ```

    <Info>
      Use unique references for each payout to avoid duplicate transactions.
    </Info>
  </Step>

  <Step title="Track Payout Status">
    Monitor payout progress using [Get Payout Status](/api-reference/payouts/get-payout-status) with your payout reference.
  </Step>
</Steps>

## Best Practices

<AccordionGroup>
  <Accordion title="Account Management">
    * Always use API-created accounts for programmatic operations
    * Keep track of customer-to-account relationships
    * Regularly monitor account balances before payouts
  </Accordion>

  <Accordion title="Validation & Security">
    * Always validate beneficiary accounts before payouts
    * Use unique references for each transaction
    * Implement webhook signature verification
  </Accordion>

  <Accordion title="Error Handling">
    * Handle insufficient balance scenarios gracefully
    * Retry failed account validation requests
    * Log all transaction attempts for audit purposes
  </Accordion>
</AccordionGroup>

## Common Use Cases

### E-commerce Platform

1. Create collection accounts for merchants
2. Monitor incoming payments via webhooks
3. Process payouts to merchant bank accounts

### Payroll System

1. Create accounts for employee salary management
2. Fund accounts from company's main account
3. Distribute salaries using batch payouts

### Marketplace

1. Create collection accounts for sellers
2. Collect payments from buyers
3. Pay sellers after transaction completion

<Info>
  For detailed API specifications and additional parameters, refer to the individual endpoint documentation in the API Reference section.
</Info>
