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

# Fund a balance

> Sandbox only — responds 404 on production. Credits a fiat balance instantly so you can test payouts and conversions without a real inflow. Crypto currencies are rejected. `externalReference` is idempotent: the same value replays the original credit with 200.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/simulations/fund-balance
openapi: 3.1.0
info:
  title: Chipper Platform API
  version: '2026-02-20'
  description: >-
    Payouts, collections, and FX across African rails — bank, mobile money, and
    stablecoins — through one API.
servers:
  - url: https://sandbox-api.platform.chipper.ai
    description: Sandbox (sk_test_ keys — simulated rails, no real money)
  - url: https://api.platform.chipper.ai
    description: Production (sk_live_ keys)
security:
  - bearerAuth: []
paths:
  /v1/simulations/fund-balance:
    post:
      tags:
        - Simulations
      summary: Fund a balance
      description: >-
        Sandbox only — responds 404 on production. Credits a fiat balance
        instantly so you can test payouts and conversions without a real inflow.
        Crypto currencies are rejected. `externalReference` is idempotent: the
        same value replays the original credit with 200.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  anyOf:
                    - type: string
                      pattern: ^\d+(\.\d{1,8})?$
                    - type: number
                      exclusiveMinimum: 0
                currency:
                  type: string
                  minLength: 3
                  maxLength: 4
                externalReference:
                  type: string
                  minLength: 1
                  maxLength: 255
              required:
                - amount
                - currency
                - externalReference
      responses:
        '200':
          description: 'Idempotent replay — same body shape as 201 with `replayed: true`.'
        '201':
          description: The balance was credited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  simulation:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - fund_balance
                      transactionId:
                        type: string
                        description: The completed top-up transaction.
                        example: le_p2r8m5xk9qz3v7nt4wbh
                      accountId:
                        type: string
                        example: GHS12345678
                      amount:
                        type: string
                        description: Decimal string — never parse as float for arithmetic.
                        example: '1000.00'
                      currency:
                        type: string
                        example: GHS
                      newBalance:
                        type: string
                        description: Decimal string — never parse as float for arithmetic.
                        example: '1150.00'
                      externalReference:
                        type: string
                        example: seed-1
                      replayed:
                        type: boolean
                    required:
                      - type
                      - transactionId
                      - accountId
                      - amount
                      - currency
                      - newBalance
                      - externalReference
                      - replayed
                required:
                  - simulation
        '400':
          description: Invalid request — the body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: validation_error
                message: Request validation failed
                requestId: req_q7vei435zifs51ia0lqr
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: unauthorized
                message: Invalid API key
                requestId: req_q7vei435zifs51ia0lqr
        '403':
          description: The API key lacks the required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: forbidden
                message: API key does not have the required scope
                requestId: req_q7vei435zifs51ia0lqr
        '404':
          description: 'Not available: production keys, or (deposits) no such resource.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: not_found
                message: Simulation endpoint not found
                requestId: req_q7vei435zifs51ia0lqr
        '409':
          description: This externalReference was already used with different parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: conflict
                message: >-
                  externalReference was already used for different balance
                  funding
                requestId: req_q7vei435zifs51ia0lqr
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Stable machine-readable code.
        message:
          type: string
          description: Human-readable explanation.
        requestId:
          type: string
          description: Echoed in the x-request-id response header — quote it to support.
      required:
        - error
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key: `sk_test_…` (sandbox) or `sk_live_…` (production).'

````