> ## 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.

# Update an immediate dynamic PIX QR code

> Updates an existing immediate dynamic PIX QR code (JDPI §8.3.5): the charge amount, conciliation, expiration, optional payer, and the charge status (0=Active, 1=Concluded, 2=Removed by recipient, 3=Removed by PSP). The recipient name + city are CRM-sourced (never the body). The plugin re-hosts the updated signed JWS so the QR stays end-to-end resolvable; the response carries the JDPI revision and the resolvable payload URL.

It is also the RECOVERY path for an indirect-hosted payloadJws whose create response never reached the caller: the update re-signs the charge under whichever certificate the request names and returns the fresh payloadJws, so supply the SAME indirectId the charge was created with (omitting it re-signs under the DIRECT participant and moves the location onto the direct FQDN). Every update — recovery or not — mints a new payloadUrl and a regenerated EMV payload, so the previously advertised location is superseded.

THE PLUGIN STORES NO INDIRECT ASSOCIATION FOR A CHARGE, so this request's indirectId — not the create's — decides who signs and where the location points, on every update. Omitting it on a charge created for an institution that hosts its own certificate is not a no-op: it MOVES the charge onto the direct participant's certificate and domain, and the institution's own domain stops serving the current location. The same rules as on create apply here: the value is silently ignored while this tenant's indirect-participants feature is off, and it is refused with 404 PIX-0095 (unknown or malformed id), 422 PIX-0100 (not ACTIVE), 422 PIX-0113 (registered host a payer's app cannot resolve) or 422 PIX-0112 (composed payload URL over the 77-character BACEN cap) — all before JDPI is called, so a refused update changes nothing.



## OpenAPI

````yaml /en/openapi/v3-current/pix.yaml put /v1/qrcodes/dynamic/{documentId}
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/qrcodes/dynamic/{documentId}:
    put:
      tags:
        - QR Codes
      summary: Update an immediate dynamic PIX QR code
      description: >-
        Updates an existing immediate dynamic PIX QR code (JDPI §8.3.5): the
        charge amount, conciliation, expiration, optional payer, and the charge
        status (0=Active, 1=Concluded, 2=Removed by recipient, 3=Removed by
        PSP). The recipient name + city are CRM-sourced (never the body). The
        plugin re-hosts the updated signed JWS so the QR stays end-to-end
        resolvable; the response carries the JDPI revision and the resolvable
        payload URL.


        It is also the RECOVERY path for an indirect-hosted payloadJws whose
        create response never reached the caller: the update re-signs the charge
        under whichever certificate the request names and returns the fresh
        payloadJws, so supply the SAME indirectId the charge was created with
        (omitting it re-signs under the DIRECT participant and moves the
        location onto the direct FQDN). Every update — recovery or not — mints a
        new payloadUrl and a regenerated EMV payload, so the previously
        advertised location is superseded.


        THE PLUGIN STORES NO INDIRECT ASSOCIATION FOR A CHARGE, so this
        request's indirectId — not the create's — decides who signs and where
        the location points, on every update. Omitting it on a charge created
        for an institution that hosts its own certificate is not a no-op: it
        MOVES the charge onto the direct participant's certificate and domain,
        and the institution's own domain stops serving the current location. The
        same rules as on create apply here: the value is silently ignored while
        this tenant's indirect-participants feature is off, and it is refused
        with 404 PIX-0095 (unknown or malformed id), 422 PIX-0100 (not ACTIVE),
        422 PIX-0113 (registered host a payer's app cannot resolve) or 422
        PIX-0112 (composed payload URL over the 77-character BACEN cap) — all
        before JDPI is called, so a refused update changes nothing.
      operationId: updateDynamicQRCode
      parameters:
        - description: The existing charge GUID to update (JDPI idDocumento).
          in: path
          name: documentId
          required: true
          schema:
            description: The existing charge GUID to update (JDPI idDocumento).
            examples:
              - 52c43361-caa1-4ddb-9152-708426a25db3
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDynamicQRBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDynamicQRResponse'
          description: OK
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    UpdateDynamicQRBody:
      additionalProperties: false
      properties:
        accountId:
          description: The CRM account id of the recipient (sources name + city).
          examples:
            - acc-123
          type: string
        amount:
          description: Amount in centavos (an integer).
          examples:
            - 10050
          format: int64
          type: integer
        description:
          description: Optional additional-data entries (dadosAdicionais).
          items:
            $ref: '#/components/schemas/AdditionalDataBody'
          type:
            - array
            - 'null'
        expirationTime:
          description: QR expiration in seconds (0 = JDPI default).
          examples:
            - 3600
          format: int64
          type: integer
        indirectId:
          description: >-
            Optional identifier (UUID) of an indirect participant registered
            here, mirroring the create body. Supply the SAME institution the
            charge was generated for: the plugin stores no indirect association
            for a QR, so an omitted value re-signs the charge under the DIRECT
            participant's certificate and moves its location onto the direct
            participant's domain. IGNORED, without any error, while this
            tenant's indirect-participants feature is off.
          examples:
            - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
          format: uuid
          type: string
        key:
          description: The recipient PIX key the dynamic QR pays into.
          examples:
            - recipient@bank.com
          type: string
        payer:
          $ref: '#/components/schemas/PayerBody'
          description: Optional payer block.
        recipientConciliationId:
          description: >-
            Conciliation id (idConciliacaoRecebedor); §8.3.5 mandatory; 26..35
            alphanumeric ([a-zA-Z0-9]).
          examples:
            - JDPI2020010300000000000000000000001
          type: string
        status:
          description: >-
            Charge status: 0=Active, 1=Concluded, 2=Removed by recipient,
            3=Removed by PSP.
          examples:
            - 0
          format: int64
          type: integer
        zipCode:
          description: Recipient postal code (cep).
          examples:
            - '01310100'
          type: string
      required:
        - key
        - amount
        - accountId
        - status
        - recipientConciliationId
      type: object
    UpdateDynamicQRResponse:
      additionalProperties: false
      properties:
        payloadJws:
          description: >-
            The re-signed JWS payload, returned ONLY when the update ran under
            an indirect participant's own certificate. Absent on the direct
            path.
          examples:
            - eyJhbGciOiJFUzI1NiJ9.eyJyZXYiOjJ9.sig
          type: string
        payloadUrl:
          description: >-
            The resolvable JWS host URL the dynamic QR embeds (urlPayloadJson;
            schema-less).
          examples:
            - pix.example.com/qr/cob/fzqRwuXYSweWofLD1OX2Bw
          type: string
        qrCode:
          description: The updated EMV QR-code payload (base64-decoded, ready to render).
          examples:
            - 00020126...
          type: string
        revision:
          description: The JDPI-computed charge revision (revisao).
          examples:
            - 2
          format: int64
          type: integer
      required:
        - qrCode
        - revision
      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
    AdditionalDataBody:
      additionalProperties: false
      properties:
        name:
          description: The additional-data entry name.
          examples:
            - order
          type: string
        value:
          description: The additional-data entry value.
          examples:
            - '42'
          type: string
      required:
        - name
        - value
      type: object
    PayerBody:
      additionalProperties: false
      properties:
        document:
          description: Payer document (CPF/CNPJ).
          examples:
            - '12345678909'
          type: string
        name:
          description: Payer holder name (only forwarded with a document).
          examples:
            - Jane Doe
          type: string
        validate:
          description: Whether the payer document must be validated at settlement.
          examples:
            - false
          type: boolean
      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

````