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

# Assign a parked credit to an ACTIVE indirect and post it

> Assigns a parked inbound credit to one ACTIVE indirect participant and POSTS the money to that participant's `@pi` settlement account. This is the operation that finally moves a parked credit, so the target matters: the destination comes solely from the indirectId in this body. The park row records where the credit was ADDRESSED, which is evidence — not a decision.

Order of events, which is what a log reads like after a failure: the park is CLAIMED first (PARKED -> RESOLVED, conditionally, in one statement) and only then is the credit posted. A concurrent resolve or reject therefore loses cleanly with a 409 and posts nothing, and a reject can never win AFTER the claim — so a park is never left REJECTED with money already posted. The credit is keyed by the park's end-to-end id, so a replay is idempotent at the ledger: if the credit turns out to have already settled, the park stays RESOLVED and the call succeeds instead of double-posting. If the post fails for a genuine infrastructure reason and the credit demonstrably did not land, the claim is rolled back to PARKED so the operation can be retried.

RESOLVED is terminal. A resolved park cannot be re-resolved to a different indirect, and no operation un-posts the credit — a wrong target has to be corrected as a new money movement outside this API. Resolution works even when the tenant's indirect-participants feature is switched off, deliberately, so pre-existing parked money is never trapped by a toggle.

Refusals: 404 PIX-0063 for an unknown parkId; 409 PIX-0103 when the park is no longer PARKED — already resolved or rejected, possibly by a concurrent request — and nothing was posted; 404 PIX-0095 when indirectId names no indirect in this tenant; 409 PIX-0104 when it names one that is not ACTIVE; 400 PIX-0061 when parkId or indirectId is not a valid UUID.



## OpenAPI

````yaml /en/openapi/v3-current/pix.yaml post /v1/indirect-credit-parks/{parkId}/resolve
openapi: 3.1.0
info:
  description: Brazilian PIX Direct (DICT + SPI) plugin API.
  title: plugin-br-pix-jd
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
paths:
  /v1/indirect-credit-parks/{parkId}/resolve:
    post:
      tags:
        - Indirect Credit Parks
      summary: Assign a parked credit to an ACTIVE indirect and post it
      description: >-
        Assigns a parked inbound credit to one ACTIVE indirect participant and
        POSTS the money to that participant's `@pi` settlement account. This is
        the operation that finally moves a parked credit, so the target matters:
        the destination comes solely from the indirectId in this body. The park
        row records where the credit was ADDRESSED, which is evidence — not a
        decision.


        Order of events, which is what a log reads like after a failure: the
        park is CLAIMED first (PARKED -> RESOLVED, conditionally, in one
        statement) and only then is the credit posted. A concurrent resolve or
        reject therefore loses cleanly with a 409 and posts nothing, and a
        reject can never win AFTER the claim — so a park is never left REJECTED
        with money already posted. The credit is keyed by the park's end-to-end
        id, so a replay is idempotent at the ledger: if the credit turns out to
        have already settled, the park stays RESOLVED and the call succeeds
        instead of double-posting. If the post fails for a genuine
        infrastructure reason and the credit demonstrably did not land, the
        claim is rolled back to PARKED so the operation can be retried.


        RESOLVED is terminal. A resolved park cannot be re-resolved to a
        different indirect, and no operation un-posts the credit — a wrong
        target has to be corrected as a new money movement outside this API.
        Resolution works even when the tenant's indirect-participants feature is
        switched off, deliberately, so pre-existing parked money is never
        trapped by a toggle.


        Refusals: 404 PIX-0063 for an unknown parkId; 409 PIX-0103 when the park
        is no longer PARKED — already resolved or rejected, possibly by a
        concurrent request — and nothing was posted; 404 PIX-0095 when
        indirectId names no indirect in this tenant; 409 PIX-0104 when it names
        one that is not ACTIVE; 400 PIX-0061 when parkId or indirectId is not a
        valid UUID.
      operationId: resolveIndirectCreditPark
      parameters:
        - description: The parked-credit id.
          in: path
          name: parkId
          required: true
          schema:
            description: The parked-credit id.
            examples:
              - 018f2b7c-0000-7000-8000-000000000000
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResolveCreditParkBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditParkResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    ResolveCreditParkBody:
      additionalProperties: false
      properties:
        indirectId:
          description: >-
            The registry indirect to assign the parked credit to (must be
            ACTIVE).
          examples:
            - 018f2b7c-0000-7000-8000-000000000001
          type: string
        note:
          description: Optional operator annotation.
          maxLength: 500
          type: string
      required:
        - indirectId
      type: object
    CreditParkResponse:
      additionalProperties: false
      properties:
        amount:
          description: The parked credit amount, in centavos.
          examples:
            - 110001
          format: int64
          type: integer
        createdAt:
          description: Park creation timestamp (UTC).
          format: date-time
          type: string
        endToEndId:
          description: The JD end-to-end id (also the Midaz idempotency key on resolve).
          type: string
        parkId:
          description: The parked-credit id.
          type: string
        reason:
          description: Park classification (no_match, suspended).
          examples:
            - no_match
          type: string
        receiver:
          $ref: '#/components/schemas/CreditParkReceiver'
          description: The recebedor routing fields captured at park time.
        resolutionNote:
          description: The operator note (resolve) or reason (reject), or null.
          type: string
        resolvedAt:
          description: Transition timestamp (UTC), or null while PARKED.
          format: date-time
          type: string
        resolvedIndirectId:
          description: The indirect the credit was resolved to, or null.
          type: string
        status:
          description: Lifecycle status.
          examples:
            - PARKED
          type: string
      required:
        - parkId
        - status
        - endToEndId
        - amount
        - receiver
        - createdAt
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    CreditParkReceiver:
      additionalProperties: false
      properties:
        accountNumber:
          description: The recebedor account number (nrConta).
          examples:
            - '9990001'
          type: string
        branch:
          description: The recebedor branch (nrAgencia).
          examples:
            - '0001'
          type: string
        document:
          description: The recebedor CPF/CNPJ.
          examples:
            - '22222222222'
          type: string
        ispb:
          description: The recebedor ISPB.
          examples:
            - '77777009'
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````