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

# Simulate a Card Network Settlement

> Simulate a Card Network Settlement for your program, as if Lead received the settlement file from the network, and trigger the related downstream behavior. A Card Network Settlement cannot be created twice for the same settlement reporting ID, `settlement_date`, `currency_code`, and `card_network`. Available in Sandbox only.



## OpenAPI

````yaml POST /v2/simulate/card_network_settlements
openapi: 3.0.1
info:
  title: Lead Bank
  description: Lead Bank's APIs
  version: v1.0
servers:
  - url: https://api.sandbox.lead.bank
  - url: https://api.lead.bank
security:
  - bearerAuth: []
tags:
  - name: ACH
  - name: Account Number
  - name: OAuth
  - name: Events
  - name: Instant Payments
  - name: Lending
  - name: Simulation
  - name: Internal Transfer
  - name: Disbursement
  - name: Entity
  - name: Wire
  - name: Originator
  - name: Funding
  - name: Receivable Sale
  - name: Balances
  - name: Compliance
  - name: Application
  - name: User Account
  - name: Blockchain Payment
  - name: Core Account
  - name: Core Balance
  - name: Core Transaction
  - name: Event Subscription
  - name: Receivable
  - name: User Credit Transaction
  - name: Files
paths:
  /v2/simulate/card_network_settlements:
    post:
      tags:
        - Simulation
      summary: Simulate a Card Network Settlement
      description: >-
        Simulate a Card Network Settlement for your program, as if Lead received
        the settlement file from the network, and trigger the related downstream
        behavior. A Card Network Settlement cannot be created twice for the same
        settlement reporting ID, `settlement_date`, `currency_code`, and
        `card_network`. Available in Sandbox only.
      operationId: simulate-a-network-settlement-v2
      parameters:
        - name: Idempotency-Key
          in: header
          description: Idempotency key
          required: true
          schema:
            type: string
            maxLength: 255
            minLength: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulatedNetworkSettlement'
            example:
              settlement_reporting_id: '123456789'
              settlement_date: '2026-06-01'
              currency_code: USD
              card_network: visa
              network_settlement_amount_breakdown:
                transactions: 250000
                refunds: -5000
                interchange: -3000
                fees: 1200
                disputes: -800
      responses:
        '200':
          description: >-
            The card network settlement was accepted. The response echoes the
            settlement that was submitted; it is not the full Card Network
            Settlement record.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulatedNetworkSettlement'
              example:
                settlement_reporting_id: '123456789'
                settlement_date: '2026-06-01'
                currency_code: USD
                card_network: visa
                network_settlement_amount_breakdown:
                  transactions: 250000
                  refunds: -5000
                  interchange: -3000
                  fees: 1200
                  disputes: -800
        '400':
          description: >-
            The request could not be parsed (`request_malformed`), or the
            `Idempotency-Key` header is missing (`idempotency_key_missing`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: request_malformed
                message: The request is invalid and cannot be parsed by the server.
                errors:
                  - code: payload_invalid
                    message: The request body is not valid JSON.
        '403':
          description: >-
            Rejected before the request reached the Receivable API. `code` is
            one of:

            `authentication_missing` (the request has no credentials),

            `token_invalid` (the bearer token is expired, invalid, or does not
            grant the required scope),

            `source_ip_not_permitted` (the request came from an IP address that
            is not on your program's allowlist).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: authentication_missing
                message: >-
                  The request has no authentication credentials. Send your API
                  token in the Authorization header.
                errors:
                  - code: authentication_missing
                    message: >-
                      The Authorization header is missing. Send your API token
                      as a bearer token.
                    parameters:
                      - Authorization
        '404':
          description: This endpoint is not available outside the Sandbox environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: object_not_found
                message: >-
                  No object exists at the requested ID, or it is not visible to
                  this caller.
        '409':
          description: >-
            A concurrent request with the same `Idempotency-Key` is still in
            flight.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: idempotency_key_in_use
                message: >-
                  A concurrent request using this Idempotency-Key is still in
                  flight.
        '422':
          description: >-
            The request was parsed but cannot be processed. `code` is one of:

            `parameters_invalid` (a field is missing, malformed, or out of
            range; all failures returned at once),

            `related_object_invalid` (the `card_network` and `currency_code`
            combination does not match a network configured for your program),

            `object_state_conflict` (a network settlement already exists for
            this `settlement_reporting_id`, `card_network`, `settlement_date`,
            and `currency_code`),

            `idempotency_request_inconsistent` (this `Idempotency-Key` was used
            with a different request body).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: parameters_invalid
                message: One or more parameters are invalid.
                errors:
                  - code: out_of_range
                    message: >-
                      network_settlement_amount_breakdown.transactions must be
                      greater than or equal to 0.
                    parameters:
                      - network_settlement_amount_breakdown.transactions
                  - code: out_of_range
                    message: >-
                      network_settlement_amount_breakdown.refunds must be less
                      than or equal to 0.
                    parameters:
                      - network_settlement_amount_breakdown.refunds
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: rate_limit_exceeded
                message: >-
                  You have exceeded the rate limit for this endpoint. Retry with
                  backoff.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: internal_server_error
                message: >-
                  An unexpected error occurred. Contact support with the
                  Request-Id header value.
components:
  schemas:
    SimulatedNetworkSettlement:
      type: object
      description: >-
        A card network settlement submitted to the simulation endpoint. When
        returned, this echoes the values that were submitted; it is not the full
        Card Network Settlement record.
      required:
        - settlement_reporting_id
        - settlement_date
        - currency_code
        - card_network
        - network_settlement_amount_breakdown
      properties:
        settlement_reporting_id:
          type: string
          description: >-
            In Sandbox this is not checked against your program's configuration
            and does not have to match a production reporting ID; any non-empty
            value is accepted.
          minLength: 1
          maxLength: 64
          example: '123456789'
        settlement_date:
          type: string
          format: date
          description: The date this network settlement is for.
          example: '2026-06-01'
        currency_code:
          $ref: '#/components/schemas/CurrencyCode'
        card_network:
          $ref: '#/components/schemas/ReceivableCardNetwork'
        network_settlement_amount_breakdown:
          $ref: '#/components/schemas/NetworkSettlementAmountBreakdown'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            A human-readable description of the error family. Identical for
            every occurrence of a given `code`; carries no request-specific
            detail.
          example: One or more parameters are invalid.
        errors:
          type: array
          description: >-
            Zero or more specific errors within this family. Always present for
            validation errors, one entry per failing field.
          items:
            $ref: '#/components/schemas/ErrorItem'
    CurrencyCode:
      description: A three-letter currency code as defined in ISO 4217.
      type: string
      example: USD
      enum:
        - USD
    ReceivableCardNetwork:
      type: string
      description: The card network the settlement came from.
      enum:
        - visa
        - mastercard
        - pulse
        - accel
        - maestro
        - tabapay
        - amex
        - star
        - interlink
      example: visa
    NetworkSettlementAmountBreakdown:
      type: object
      description: >-
        The gross and net components that make up a card network settlement, in
        minor units.
      required:
        - transactions
        - refunds
        - interchange
        - fees
        - disputes
      properties:
        transactions:
          type: integer
          description: >-
            Gross transactions that settled on the network — funds spent by
            cardholders, in aggregate, in minor units. For credit programs this
            is the amount that drives receivable creation.
          minimum: 0
          example: 250000
        refunds:
          type: integer
          description: >-
            Gross refunds that settled on the network — funds returned to
            cardholders, in aggregate, in minor units. Zero or negative.
          maximum: 0
          example: -5000
        interchange:
          type: integer
          description: >-
            Net interchange that settled on the network, in minor units. May be
            positive or negative.
          example: -3000
        fees:
          type: integer
          description: >-
            Net fees that settled on the network, in minor units. May be
            positive or negative.
          example: 1200
        disputes:
          type: integer
          description: >-
            Net disputes that settled on the network, in minor units. May be
            positive or negative.
          example: -800
    ErrorCode:
      type: string
      description: >-
        A snake_case code identifying the error family — the stable,
        machine-readable value partners branch on, together with the HTTP
        status.
      example: parameters_invalid
      enum:
        - request_malformed
        - content_too_large
        - idempotency_key_missing
        - authentication_missing
        - token_invalid
        - source_ip_not_allowed
        - url_invalid
        - object_not_found
        - method_not_allowed
        - idempotency_key_in_use
        - idempotency_request_inconsistent
        - rate_limit_exceeded
        - internal_server_error
        - service_unavailable
        - endpoint_disabled
        - gateway_timeout
        - unclassified
        - parameters_invalid
        - related_object_invalid
        - related_object_not_ready
        - related_object_conflict
        - limit_exceeded
        - client_control_restricted
        - lead_control_restricted
        - object_state_conflict
        - object_modified_concurrently
        - operation_invalid
    ErrorItem:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: A snake_case code naming the specific error or sub-category.
          example: required
        message:
          type: string
          description: >-
            A human-readable description of this specific error, with
            interpolated values where relevant.
          example: account_number_id is required.
        parameters:
          type: array
          description: >-
            The request fields this error implicates, in dot notation for nested
            fields. Present for validation errors.
          items:
            type: string
          example:
            - account_number_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.