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

# Revise a due-date collection's value modifiers

> Revises the four BACEN value modifiers (fine, interest, abatement, discount) of an ACTIVE due-date collection. Each modifier is an independent RFC 7386 JSON Merge Patch slot: an object present in the body REPLACES that modifier outright, an explicit `null` REMOVES it, and an absent field leaves the currently-stored modifier unchanged. At least one modifier field is required. No other field (calendar, debtor, key, receiver) is revisable through this endpoint.

**Replay:** retrying the same request with the same `X-Idempotency` returns the ORIGINAL 200 response unchanged rather than re-applying the modifiers a second time; retrying the same key with a divergent body is PIX-0031 @ 412. Unlike the other gated mutations, this route is FAIL-CLOSED: if the replay cache cannot serve the request it refuses with PIX-0032 @ 503 instead of re-applying the modifiers without replay protection.



## OpenAPI

````yaml /en/openapi/v3-current/pix-lerian-cob.yaml patch /collections/duedate/{id}
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Public API for Pix BR Codes and immediate and due-date collections. This
    release provides a mock-provider integration for testing; live BACEN
    connectivity is not included.
  license:
    name: Lerian Studio General License
  title: Pix Lerian — Collections
  version: 1.0.0
servers:
  - url: https://api.example.com/cob-hub/v1
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: Create, retrieve, list, and decode static Pix BR Codes.
    name: BR Codes
  - description: Create, retrieve, list, and cancel due-date Pix collections.
    name: Due-Date Collections
  - description: Create, retrieve, list, and cancel immediate Pix collections.
    name: Immediate Collections
paths:
  /collections/duedate/{id}:
    patch:
      tags:
        - Due-Date Collections
      summary: Revise a due-date collection's value modifiers
      description: >-
        Revises the four BACEN value modifiers (fine, interest, abatement,
        discount) of an ACTIVE due-date collection. Each modifier is an
        independent RFC 7386 JSON Merge Patch slot: an object present in the
        body REPLACES that modifier outright, an explicit `null` REMOVES it, and
        an absent field leaves the currently-stored modifier unchanged. At least
        one modifier field is required. No other field (calendar, debtor, key,
        receiver) is revisable through this endpoint.


        **Replay:** retrying the same request with the same `X-Idempotency`
        returns the ORIGINAL 200 response unchanged rather than re-applying the
        modifiers a second time; retrying the same key with a divergent body is
        PIX-0031 @ 412. Unlike the other gated mutations, this route is
        FAIL-CLOSED: if the replay cache cannot serve the request it refuses
        with PIX-0032 @ 503 instead of re-applying the modifiers without replay
        protection.
      operationId: reviseDueDateCollection
      parameters:
        - description: >-
            REQUIRED. Client-supplied replay key, at most 64 bytes. A request
            without it is refused with PIX-0030 @ 400 before the handler runs.
            Replaying the same key with a divergent method, URL or body is
            PIX-0031 @ 412.
          in: header
          name: X-Idempotency
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
        - description: Receiver merchant account UUID
          in: header
          name: X-Account-Id
          required: true
          schema:
            description: Receiver merchant account UUID
            examples:
              - 019606a1-3b4c-7d8e-9f01-234567890abc
            type: string
        - description: Collection UUID
          in: path
          name: id
          required: true
          schema:
            description: Collection UUID
            examples:
              - 019e22f9-aabe-7ec9-ba6b-41608b9accf9
            type: string
      requestBody:
        content:
          application/json:
            example:
              fine:
                modality: FIXED_VALUE
                value: '10.00'
            schema:
              additionalProperties: false
              minProperties: 1
              properties:
                abatement:
                  additionalProperties: false
                  description: >-
                    Replace (object) or remove (null) the abatement (abatimento)
                    modifier; omit to leave unchanged
                  properties:
                    modality:
                      description: Abatement calculation modality
                      enum:
                        - FIXED_VALUE
                        - PERCENTAGE
                      examples:
                        - PERCENTAGE
                      type: string
                    value:
                      description: Abatement value
                      examples:
                        - '5.00'
                      pattern: ^[0-9]+(\.[0-9]{1,2}0{0,32})?$
                      type: string
                  required:
                    - modality
                    - value
                  type:
                    - object
                    - 'null'
                discount:
                  description: >-
                    Replace (object) or remove (null) the discount (desconto)
                    modifier; omit to leave unchanged
                  oneOf:
                    - additionalProperties: false
                      properties:
                        fixedDates:
                          description: >-
                            Date-anchored discount schedule (*_UNTIL_DATES
                            modalities only, at most 3 entries)
                          items:
                            $ref: '#/components/schemas/DiscountFixedDateRequest'
                          maxItems: 3
                          minItems: 1
                          type: array
                        modality:
                          description: Discount calculation modality
                          enum:
                            - FIXED_VALUE_UNTIL_DATES
                            - PERCENT_UNTIL_DATES
                          examples:
                            - FIXED_VALUE_UNTIL_DATES
                          type: string
                        value:
                          description: Discount value (per-day advance modalities only)
                          pattern: ^[0-9]+(\.[0-9]{1,2}0{0,32})?$
                          type: string
                      required:
                        - modality
                        - fixedDates
                      type: object
                    - additionalProperties: false
                      properties:
                        fixedDates:
                          description: >-
                            Date-anchored discount schedule (*_UNTIL_DATES
                            modalities only, at most 3 entries)
                          items:
                            $ref: '#/components/schemas/DiscountFixedDateRequest'
                          type:
                            - array
                            - 'null'
                        modality:
                          description: Discount calculation modality
                          enum:
                            - VALUE_PER_CALENDAR_DAY_ADVANCE
                            - VALUE_PER_BUSINESS_DAY_ADVANCE
                            - PERCENT_PER_CALENDAR_DAY_ADVANCE
                            - PERCENT_PER_BUSINESS_DAY_ADVANCE
                          examples:
                            - VALUE_PER_CALENDAR_DAY_ADVANCE
                          type: string
                        value:
                          description: Discount value (per-day advance modalities only)
                          pattern: ^[0-9]+(\.[0-9]{1,2}0{0,32})?$
                          type: string
                      required:
                        - modality
                        - value
                      type: object
                    - type: 'null'
                fine:
                  additionalProperties: false
                  description: >-
                    Replace (object) or remove (null) the fine (multa) modifier;
                    omit to leave unchanged
                  properties:
                    modality:
                      description: Fine calculation modality
                      enum:
                        - FIXED_VALUE
                        - PERCENTAGE
                      examples:
                        - FIXED_VALUE
                      type: string
                    value:
                      description: Fine value
                      examples:
                        - '10.00'
                      pattern: ^[0-9]+(\.[0-9]{1,2}0{0,32})?$
                      type: string
                  required:
                    - modality
                    - value
                  type:
                    - object
                    - 'null'
                interest:
                  additionalProperties: false
                  description: >-
                    Replace (object) or remove (null) the interest (juros)
                    modifier; omit to leave unchanged
                  properties:
                    modality:
                      description: Interest calculation modality
                      enum:
                        - VALUE_CALENDAR_DAYS
                        - PERCENT_PER_DAY_CALENDAR_DAYS
                        - PERCENT_PER_MONTH_CALENDAR_DAYS
                        - PERCENT_PER_YEAR_CALENDAR_DAYS
                        - VALUE_BUSINESS_DAYS
                        - PERCENT_PER_DAY_BUSINESS_DAYS
                        - PERCENT_PER_MONTH_BUSINESS_DAYS
                        - PERCENT_PER_YEAR_BUSINESS_DAYS
                      examples:
                        - VALUE_CALENDAR_DAYS
                      type: string
                    value:
                      description: Interest value
                      examples:
                        - '1.50'
                      pattern: ^[0-9]+(\.[0-9]{1,2}0{0,32})?$
                      type: string
                  required:
                    - modality
                    - value
                  type:
                    - object
                    - 'null'
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                accountId: 0196a7b2-3e5f-7061-ac12-34567890abcd
                amount: '150.75'
                calendar:
                  dueDate: '2026-09-01'
                  validityAfterDue: 30
                createdAt: '2026-08-02T10:30:00Z'
                currency: BRL
                debtor:
                  document: '12345678909'
                  name: Maria Souza
                emvPayload: >-
                  00020126360014br.gov.bcb.pix2562https://pix.example.com/qr/v2/cobv-abc1235204000053039865802BR5910Loja
                  Exemplo6009Sao Paulo62070503***63041D3F
                expiresAt: '2026-10-01T00:00:00Z'
                externalId: 0196a7b2-4f60-7172-bd23-4567890abcde
                id: 0196a7b2-1c3d-7e4f-8a90-1234567890ab
                isExpired: false
                keyType: EMAIL
                keyValue: loja@example.com
                locationUrl: https://pix.example.com/qr/v2/cobv-abc123
                merchantCity: Sao Paulo
                merchantDocument: '39053344705'
                merchantName: Loja Exemplo
                organizationId: 0196a7b2-2d4e-7f50-9b01-234567890abc
                status: ACTIVE
                txId: TX1234567890123456789012345
                type: DUE_DATE
                updatedAt: '2026-08-02T10:30:00Z'
              schema:
                $ref: '#/components/schemas/DueDateCollectionOutput'
          description: OK
        '400':
          content:
            application/json:
              example:
                code: PIX-0030
                title: Idempotency Key Required
                message: >-
                  The X-Idempotency header is required for this operation and
                  must be within the accepted length.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0200
                title: Bad Request
                status: 400
                detail: Missing or malformed required fields.
                code: PIX-0200
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            X-Idempotency absent or longer than 64 bytes (PIX-0030) uses the
            legacy {code,title,message} envelope; other 400 errors use
            application/problem+json. Malformed id/X-Account-Id, a malformed
            fine/interest/abatement/discount modifier, or no modifier field
            present in the body at all (PIX-0200, PIX-0263-0266).
        '404':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0240
                title: Not Found
                status: 404
                detail: No collection found for the given identifiers.
                code: PIX-0240
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            No collection found for the given id, including the cross-type
            isolation guard (PIX-0240).
        '409':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0226
                title: Conflict
                status: 409
                detail: The collection is in a conflicting state at the provider.
                code: PIX-0226
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The provider reports the collection in a conflicting state
            (PIX-0226).
        '412':
          content:
            application/json:
              example:
                code: PIX-0031
                title: Idempotency Key Conflict
                message: >-
                  The X-Idempotency header was already used with a different
                  request.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            X-Idempotency replayed with a divergent request -- a different
            method, URL or body, or a different X-Account-Id (PIX-0031).
            Evidence that an earlier request under this key already succeeded.
            Legacy {code,title,message} envelope, NOT problem+json.
        '415':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0016
                title: Unsupported Media Type
                status: 415
                detail: >-
                  The request body must be sent with Content-Type:
                  application/json.
                code: PIX-0016
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The non-empty request body is missing an accepted JSON Content-Type
            (PIX-0016).
        '422':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0241
                title: Unprocessable Entity
                status: 422
                detail: >-
                  Collection is in a terminal state (already CANCELLED or
                  COMPLETED) and cannot transition.
                code: PIX-0241
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The collection is not ACTIVE -- already COMPLETED or CANCELLED
            (PIX-0241).
        '500':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0000
                title: Internal Server Error
                status: 500
                detail: >-
                  The server encountered an unexpected error. Please try again
                  later.
                code: PIX-0000
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Persisting the revision failed even after the bounded local retry /
            reconciliation attempt -- the provider already applied it remotely
            and the divergence is durably recorded.
        '502':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0223
                title: Bad Gateway
                status: 502
                detail: Provider adapter is unreachable.
                code: PIX-0223
              schema:
                $ref: '#/components/schemas/Detail'
          description: The provider adapter is unreachable (PIX-0223).
        '503':
          content:
            application/json:
              example:
                code: PIX-0032
                title: Idempotency Unavailable
                message: >-
                  The request was not processed because the idempotency store is
                  unavailable. Please retry.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Replay cache unavailable on this fail-closed route, so the mutation
            was refused rather than executed without replay protection
            (PIX-0032). Legacy {code,title,message} envelope, NOT problem+json.
        '504':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0054
                title: Gateway Timeout
                status: 504
                detail: The request timed out. Please try again later.
                code: PIX-0054
              schema:
                $ref: '#/components/schemas/Detail'
          description: The provider timed out handling the revise request (PIX-0054).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    DiscountFixedDateRequest:
      additionalProperties: false
      properties:
        date:
          description: Discount cutoff date — a civil date, no time-of-day or timezone
          examples:
            - '2026-08-25'
          format: date
          type: string
        value:
          description: Discount value applicable through Date
          examples:
            - '3.00'
          type: string
      required:
        - date
        - value
      type: object
    DueDateCollectionOutput:
      additionalProperties: false
      properties:
        abatement:
          $ref: '#/components/schemas/AbatementTermsDTO'
        accountId:
          examples:
            - 0196a7b2-3e5f-7061-ac12-34567890abcd
          type: string
        additionalInfo:
          items:
            $ref: '#/components/schemas/KVDTO'
          type:
            - array
            - 'null'
        amount:
          examples:
            - '100.50'
          type: string
        calendar:
          $ref: '#/components/schemas/DueDateCalendarDTO'
        cancelledAt:
          examples:
            - '2026-05-06T10:40:00Z'
          format: date-time
          type: string
        cancelledReason:
          examples:
            - Customer requested cancellation
          type: string
        createdAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
        currency:
          enum:
            - BRL
          examples:
            - BRL
          type: string
        debtor:
          $ref: '#/components/schemas/DebtorDTO'
        description:
          examples:
            - Fatura de servicos
          type: string
        discount:
          $ref: '#/components/schemas/DiscountTermsDTO'
        emvPayload:
          examples:
            - >-
              00020126360014br.gov.bcb.pix2562https://pix.example.com/qr/v2/cobv-abc1235204000053039865802BR5910Loja
              Teste6007Goiania62070503***63041D3F
          type: string
        expiresAt:
          examples:
            - '2026-05-06T11:30:00Z'
          format: date-time
          type: string
        externalId:
          examples:
            - 0196a7b2-4f60-7172-bd23-4567890abcde
          type: string
        fine:
          $ref: '#/components/schemas/FineTermsDTO'
        id:
          examples:
            - 0196a7b2-1c3d-7e4f-8a90-1234567890ab
          type: string
        interest:
          $ref: '#/components/schemas/InterestTermsDTO'
        isExpired:
          examples:
            - false
          type: boolean
        keyType:
          enum:
            - CPF
            - CNPJ
            - PHONE
            - EMAIL
            - EVP
          examples:
            - EVP
          type: string
        keyValue:
          examples:
            - 123e4567-e12b-12d1-a456-426655440000
          type: string
        locationUrl:
          examples:
            - https://pix.example.com/qr/v2/cobv-abc123
          type: string
        merchantCity:
          examples:
            - Goiania
          type: string
        merchantDocument:
          examples:
            - '39053344705'
          type: string
        merchantName:
          examples:
            - Loja Teste
          type: string
        organizationId:
          examples:
            - 0196a7b2-2d4e-7f50-9b01-234567890abc
          type: string
        payment:
          $ref: '#/components/schemas/PaymentDTO'
        status:
          enum:
            - ACTIVE
            - COMPLETED
            - CANCELLED
          examples:
            - ACTIVE
          type: string
        txId:
          examples:
            - TX1234567890123456789012345
          type: string
        type:
          enum:
            - IMMEDIATE
            - DUE_DATE
          examples:
            - DUE_DATE
          type: string
        updatedAt:
          examples:
            - '2026-05-06T10:30:00Z'
          format: date-time
          type: string
      required:
        - id
        - organizationId
        - accountId
        - merchantDocument
        - type
        - status
        - txId
        - keyType
        - keyValue
        - merchantName
        - merchantCity
        - amount
        - currency
        - calendar
        - externalId
        - locationUrl
        - emvPayload
        - expiresAt
        - createdAt
        - updatedAt
        - isExpired
      type: object
    LegacyErrorEnvelope:
      additionalProperties: false
      properties:
        code:
          description: PIX-XXXX error code
          type: string
        message:
          description: Human-readable error message
          type: string
        title:
          description: Short error title
          type: string
      required:
        - code
        - title
        - message
      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
    AbatementTermsDTO:
      additionalProperties: false
      properties:
        modality:
          examples:
            - PERCENTAGE
          type: string
        value:
          examples:
            - '5.00'
          type: string
      required:
        - modality
        - value
      type: object
    KVDTO:
      additionalProperties: false
      properties:
        key:
          examples:
            - orderId
          type: string
        value:
          examples:
            - '12345'
          type: string
      required:
        - key
        - value
      type: object
    DueDateCalendarDTO:
      additionalProperties: false
      properties:
        dueDate:
          examples:
            - '2026-09-01'
          format: date
          type: string
        validityAfterDue:
          examples:
            - 30
          format: int64
          minimum: 0
          type: integer
      required:
        - dueDate
        - validityAfterDue
      type: object
    DebtorDTO:
      additionalProperties: false
      properties:
        document:
          examples:
            - '39053344705'
          type: string
        name:
          examples:
            - João da Silva
          type: string
      type: object
    DiscountTermsDTO:
      additionalProperties: false
      properties:
        fixedDates:
          items:
            $ref: '#/components/schemas/DiscountFixedDateDTO'
          type:
            - array
            - 'null'
        modality:
          examples:
            - FIXED_VALUE_UNTIL_DATES
          type: string
        value:
          type: string
      required:
        - modality
        - value
      type: object
    FineTermsDTO:
      additionalProperties: false
      properties:
        modality:
          examples:
            - FIXED_VALUE
          type: string
        value:
          examples:
            - '10.00'
          type: string
      required:
        - modality
        - value
      type: object
    InterestTermsDTO:
      additionalProperties: false
      properties:
        modality:
          examples:
            - VALUE_CALENDAR_DAYS
          type: string
        value:
          examples:
            - '1.50'
          type: string
      required:
        - modality
        - value
      type: object
    PaymentDTO:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '100.50'
          type: string
        endToEndId:
          examples:
            - E12345678202605061030abcdef12345
          type: string
        paidAt:
          examples:
            - '2026-05-06T10:35:00Z'
          format: date-time
          type: string
        payer:
          $ref: '#/components/schemas/PayerDTO'
      required:
        - endToEndId
        - amount
        - paidAt
      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
    DiscountFixedDateDTO:
      additionalProperties: false
      properties:
        date:
          examples:
            - '2026-08-25'
          format: date
          type: string
        value:
          examples:
            - '3.00'
          type: string
      required:
        - date
        - value
      type: object
    PayerDTO:
      additionalProperties: false
      properties:
        ispb:
          examples:
            - '12345678'
          type: string
        name:
          examples:
            - João da Silva
          type: string
        taxId:
          examples:
            - '39053344705'
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````