> ## 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 Advance ACH

> Moves one ACH, incoming or outgoing, to the status named in `next_status`. Each call applies one allowed transition and emits the production webhook for the new status where production emits one. The response body is empty; read the ACH with Retrieve an ACH V2. Pending return states are entered through Return an ACH V2 or the `incoming_return` scenario, not through this endpoint. Available in Sandbox only.

If `next_status` isn't an allowed transition, the call returns `422 object_state_mismatched` (`status_transition_not_permitted` or `object_status_unchanged`), or `422 operation_invalid` (`object_status_terminal`) if the ACH is in a final status. If another request changed the ACH while this one was processing, it returns `409 object_modified_concurrently`; fetch the ACH and retry.

> [!NOTE]
>
> See [Errors](https://docs.lead.bank/api-reference/using-the-api/errors-v2.md) for the common errors every v2 endpoint can return.


## OpenAPI

````yaml openapi.json POST /v2/simulate/ach/{id}/advance
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: ACHv2
  - name: Account Number
  - name: OAuth
  - name: Events
  - name: Instant Payments
  - name: Lending
  - name: Simulation
  - name: Sandbox
  - 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/ach/{id}/advance:
    post:
      tags:
        - Simulation
      summary: Advance Sandbox ACH V2
      description: >-
        Moves one ACH, incoming or outgoing, to the status named in
        `next_status`. Each call applies one allowed transition and emits the
        production webhook for the new status where production emits one. The
        response body is empty; read the ACH with Retrieve an ACH V2. Pending
        return states are entered through Return an ACH V2 or the
        `incoming_return` scenario, not through this endpoint. Available in
        Sandbox only.


        If `next_status` isn't an allowed transition, the call returns `422
        object_state_mismatched` (`status_transition_not_permitted` or
        `object_status_unchanged`), or `422 operation_invalid`
        (`object_status_terminal`) if the ACH is in a final status. If another
        request changed the ACH while this one was processing, it returns `409
        object_modified_concurrently`; fetch the ACH and retry.
      operationId: simulate-advance-ach-v2
      parameters:
        - name: id
          description: ID of the ACH object you want to advance.
          example: ach_xyz001
          in: path
          required: true
          schema:
            type: string
            pattern: ^ach_\w+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateAdvanceAchRequestV2'
      responses:
        '200':
          description: ACH advanced. The response body is empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateResponse'
        4XX:
          $ref: '#/components/responses/Error4XX'
        5XX:
          $ref: '#/components/responses/Error5XX'
components:
  schemas:
    SimulateAdvanceAchRequestV2:
      type: object
      required:
        - next_status
      properties:
        next_status:
          type: string
          description: >-
            The status to move the ACH to. It must be an allowed next status
            from the ACH's current status:


            | Direction | From | To |

            | --- | --- | --- |

            | Incoming | `scheduled` | `posted` |

            | Outgoing | `scheduled` | `processing` |

            | Outgoing | `processing` | `submitted` |

            | Outgoing | `submitted` | `posted` |

            | Either | `pending_return` | `returned` |

            | Either | `pending_dishonored_return` | `return_dishonored` |

            | Either | `pending_contested_return` | `return_contested` |
          example: processing
          enum:
            - processing
            - submitted
            - posted
            - returned
            - return_dishonored
            - return_contested
    SimulateResponse:
      type: object
    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. See errors for each one.
        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'
    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
        - headers_invalid
        - unsupported_media_type
        - authentication_missing
        - token_invalid
        - source_ip_not_permitted
        - client_credentials_invalid
        - url_invalid
        - object_not_found
        - method_not_allowed
        - idempotency_key_in_use
        - idempotency_request_mismatched
        - rate_limit_exceeded
        - internal_server_error
        - service_unavailable
        - endpoint_disabled
        - gateway_timeout
        - parameters_invalid
        - related_object_invalid
        - related_object_not_ready
        - related_object_incompatible
        - limit_exceeded
        - partner_control_restricted
        - lead_control_restricted
        - object_state_mismatched
        - 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: schema_violation
        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 that caused this error, as `jq` paths without the
            leading dot. For example, a nested field is `address.city` and an
            array item is `beneficial_owners[1].ownership`. A key with
            characters other than letters, digits, and underscores is
            JSON-quoted, like `metadata["order.id"]`. Headers appear by name,
            like `Idempotency-Key`. Present for validation errors.
          items:
            type: string
          example:
            - account_number_id
  responses:
    Error4XX:
      x-api-version: v2
      description: >-
        A client error. The HTTP status and `code` identify the problem; `code`
        is one of the top-level codes in the Lead Error Registry. Branch on
        `code` together with the status. The examples show each registry code
        that can return a 4xx status. Not every code applies to every endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            request_malformed:
              summary: 400 request_malformed
              value:
                code: request_malformed
                message: The request couldn't be parsed. Fix its format and resend it.
                errors:
                  - code: url_malformed
                    message: >-
                      The request URL contains characters that can't be parsed.
                      URL-encode path and query values.
            headers_invalid:
              summary: 400 headers_invalid
              value:
                code: headers_invalid
                message: One or more headers are invalid. See errors for each one.
                errors:
                  - code: idempotency_key_invalid
                    message: >-
                      This endpoint requires an Idempotency-Key header of up to
                      255 characters. Set the header and resend the request.
                    parameters:
                      - Idempotency-Key
            client_credentials_invalid:
              summary: 401 client_credentials_invalid
              value:
                code: client_credentials_invalid
                message: >-
                  Your client ID or client secret is wrong. Check them and
                  resend the request.
            authentication_missing:
              summary: 403 authentication_missing
              value:
                code: authentication_missing
                message: >-
                  The request has no authentication credentials. Send your API
                  token in the Authorization header.
            token_invalid:
              summary: 403 token_invalid
              value:
                code: token_invalid
                message: >-
                  Your bearer token is expired, invalid, or lacks required
                  scopes. Get a new token.
            source_ip_not_permitted:
              summary: 403 source_ip_not_permitted
              value:
                code: source_ip_not_permitted
                message: >-
                  This request came from an IP address that isn't on your
                  program's allowlist. Send from an allowlisted IP, or contact
                  Lead to update the list.
            url_invalid:
              summary: 404 url_invalid
              value:
                code: url_invalid
                message: >-
                  This path isn't a valid endpoint. Check the URL against the
                  API reference.
            object_not_found:
              summary: 404 object_not_found
              value:
                code: object_not_found
                message: >-
                  No object with this ID exists, or your program can't access
                  it. Check the ID.
            method_not_allowed:
              summary: 405 method_not_allowed
              value:
                code: method_not_allowed
                message: >-
                  This path doesn't support this HTTP method. Check the API
                  reference for the methods it accepts.
            idempotency_key_in_use:
              summary: 409 idempotency_key_in_use
              value:
                code: idempotency_key_in_use
                message: >-
                  Another request with this Idempotency-Key is still processing.
                  Wait for it to finish, then retry.
            object_modified_concurrently:
              summary: 409 object_modified_concurrently
              value:
                code: object_modified_concurrently
                message: >-
                  Another request changed this object while yours was
                  processing, so yours wasn't applied. Fetch the object's
                  current state and retry.
            content_too_large:
              summary: 413 content_too_large
              value:
                code: content_too_large
                message: >-
                  The request is over a size limit for this endpoint. Make it
                  smaller and resend it.
            unsupported_media_type:
              summary: 415 unsupported_media_type
              value:
                code: unsupported_media_type
                message: >-
                  The request is in a format this endpoint doesn't accept.
                  Change it to a supported format and resend it.
            idempotency_request_mismatched:
              summary: 422 idempotency_request_mismatched
              value:
                code: idempotency_request_mismatched
                message: >-
                  This Idempotency-Key was already used with a different request
                  body. Use a new key, or resend the original body.
            parameters_invalid:
              summary: 422 parameters_invalid
              value:
                code: parameters_invalid
                message: One or more parameters are invalid. See errors for each one.
                errors:
                  - code: parameter_bound_exceeded
                    message: limit is 500, which is over the maximum of 100.
                    parameters:
                      - limit
            related_object_invalid:
              summary: 422 related_object_invalid
              value:
                code: related_object_invalid
                message: >-
                  An object this request refers to doesn't exist or can't be
                  used. Fix the reference, or create the object first.
            related_object_not_ready:
              summary: 422 related_object_not_ready
              value:
                code: related_object_not_ready
                message: >-
                  An object this request depends on isn't ready for it. Update
                  that object, then retry the same request.
            related_object_incompatible:
              summary: 422 related_object_incompatible
              value:
                code: related_object_incompatible
                message: >-
                  This request conflicts with an object it refers to. Change the
                  request to match the object.
            limit_exceeded:
              summary: 422 limit_exceeded
              value:
                code: limit_exceeded
                message: >-
                  This request is over a limit. Lower the amount or count. Check
                  errors for when, or whether, the limit resets.
            partner_control_restricted:
              summary: 422 partner_control_restricted
              value:
                code: partner_control_restricted
                message: >-
                  A partner-configured control blocks this request. Update the
                  control, then retry the same request.
            lead_control_restricted:
              summary: 422 lead_control_restricted
              value:
                code: lead_control_restricted
                message: >-
                  A Lead-configured control blocks this request. Contact Lead
                  with the Lead-Request-ID.
            object_state_mismatched:
              summary: 422 object_state_mismatched
              value:
                code: object_state_mismatched
                message: >-
                  The object isn't in the state this request expected. Fetch its
                  current state before you retry.
            operation_invalid:
              summary: 422 operation_invalid
              value:
                code: operation_invalid
                message: This operation isn't available for this object.
            rate_limit_exceeded:
              summary: 429 rate_limit_exceeded
              value:
                code: rate_limit_exceeded
                message: >-
                  You've sent too many requests to this endpoint. Retry with
                  exponential backoff.
    Error5XX:
      x-api-version: v2
      description: >-
        A server error on Lead's side. `code` is one of the 5xx codes in the
        Lead Error Registry. Retry with exponential backoff, and reuse the same
        Idempotency-Key for a POST, PATCH or DELETE.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            internal_server_error:
              summary: 500 internal_server_error
              value:
                code: internal_server_error
                message: >-
                  Internal server error. Retry with exponential backoff. For a
                  POST, PATCH or DELETE, reuse the same Idempotency-Key so the
                  request isn't processed twice. If it keeps failing, contact
                  Lead with the Lead-Request-ID.
            service_unavailable:
              summary: 503 service_unavailable
              value:
                code: service_unavailable
                message: >-
                  A system this request depends on is temporarily unavailable.
                  Retry with exponential backoff.
            endpoint_disabled:
              summary: 503 endpoint_disabled
              value:
                code: endpoint_disabled
                message: >-
                  This endpoint is temporarily disabled. Retry after the time in
                  the Retry-After header.
            gateway_timeout:
              summary: 504 gateway_timeout
              value:
                code: gateway_timeout
                message: >-
                  A system this request depends on didn't respond in time. Retry
                  with exponential backoff. For a POST, PATCH or DELETE, reuse
                  the same Idempotency-Key so the request isn't processed twice.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````