# Create a settlement

API to initiate a first party payout (settlement to our customer).

Endpoint: POST /v1/collections/settlements
Version: 1.0.0
Security: Bearer

## Request fields (application/json):

  - `source_account_id` (string, required)
    Source customer account ID for the settlement
    Example: "b2c3d4e5-f6a7-8901-bcde-f12345678901"

  - `amount` (string, required)
    Amount for the settlement
    Example: "100.00"

  - `currency` (string, required)
    Currency for the settlement
    Example: "USD"

  - `network` (string)
    Network for crypto settlements (only applicable when type is CRYPTO)

## Response 201 fields (application/json):

  - `id` (string, required)
    Unique identifier for the settlement
    Example: "63dd59dd-88be-41a2-a246-2f6724209422"

  - `type` (string, required)
    Settlement type
    Enum: "FIAT", "CRYPTO"

  - `currency` (string, required)
    Currency code for the settlement
    Example: "USD"

  - `gross_amount` (string, required)
    Total settlement amount before fees
    Example: "50.00"

  - `settlement_amount` (string, required)
    Net settlement amount after fees
    Example: "49.50"

  - `fees` (object, required)
    Settlement fees

  - `fees.transaction_fees` (string)
    Total fees applied to the settlement
    Example: "0.50"

  - `status` (string, required)
    Settlement status
    Enum: "PENDING", "PROCESSING", "COMPLETED", "FAILED", "CANCELLED"

  - `data` (any, required)
    Settlement data - varies based on settlement type (FIAT or CRYPTO)

  - `settlement_transactions` (array, required)
    List of settlement transactions

  - `settlement_transactions.id` (string, required)
    Unique identifier of the settlement transaction
    Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

  - `settlement_transactions.account_id` (string, required)
    Account ID associated with this settlement transaction
    Example: "f9e8d7c6-b5a4-3210-fedc-ba0987654321"

  - `settlement_transactions.market_rate` (object)
    Market rate at the time of settlement

  - `settlement_transactions.market_rate.base` (string)
    Base currency for the exchange rate
    Example: "USDC"

  - `settlement_transactions.market_rate.counter` (string)
    Counter currency for the exchange rate
    Example: "USD"

  - `settlement_transactions.market_rate.rate` (string)
    Exchange rate from base to counter currency
    Example: "1.00"

  - `settlement_transactions.exchange_rate` (object)
    Exchange rate from base to counter currency

  - `settlement_transactions.exchange_rate.base` (string)
    Base currency for the exchange rate
    Example: "USDC"

  - `settlement_transactions.exchange_rate.counter` (string)
    Counter currency for the exchange rate
    Example: "USD"

  - `settlement_transactions.exchange_rate.rate` (string)
    Exchange rate from base to counter currency
    Example: "0.99"

  - `settlement_transactions.amount` (string, required)
    Example: "49.50"

## Response 400 fields (application/json):

  - `code` (string, required)
    Error code identifying the type of error

  - `reason` (string, required)
    Human-readable error message


