> ## Documentation Index
> Fetch the complete documentation index at: https://developers.portao3.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Deprecated — Update a deal

> Deprecated: use `PUT .../deals/{dealId}`; contracts are being removed.

Changes an open deal: its description, dates, payment method, closing and due days, or parties. Send only what changes.

A new `description` renames every invoice of the deal. `startAt` can change only while the deal has no invoice; when it is today, the first invoice is created at once. `endAt` can't be after the contract's end nor before the deal's start; `null` removes it when the contract has no end date, and today or earlier terminates the deal at once — its open invoice is closed and issued, and the `BILLING_DEAL_TERMINATED` webhook event is sent. Parties are replaced as a whole and checked like on create: against the contract, the wallets, the shares adding up to 100, and what the (new or current) payment method needs from the payer. A PIX Automático or recurring PIX deal can't change its payment method. The products, charge type, settings, fees and installments can't be changed.

Any member of the organization, or an admin of the realm, can change it; `updatedBy` is set to the ID of the authenticated caller. Answers the deal as changed.


## OpenAPI

````yaml /api-reference/billing.openapi.json put /realms/{realmId}/organizations/{organizationId}/contracts/{contractId}/deals/{dealId}
openapi: 3.0.3
info:
  title: Billing
  version: 1.0.0
  description: >-
    Portão 3 billing API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Full billing surface —
    contracts, deals, invoices, statements, payment links, checkout and NFSe
    orchestration. (The product/supplier catalog moved to registry.) Confidence
    tiers: generated:typed=74 copied:manual=0 unknown=5.
servers:
  - url: https://api.billing.v2.portao3.com.br/
    description: production
  - url: https://api.billing.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Contracts
  - name: Deals
  - name: Invoices
  - name: Invoice Entries
  - name: Invoice Statements
  - name: NFSe Configuration
  - name: Payment Links
paths:
  /realms/{realmId}/organizations/{organizationId}/contracts/{contractId}/deals/{dealId}:
    put:
      tags:
        - Deals
      summary: Deprecated — Update a deal
      description: 'Deprecated: use `PUT .../deals/{dealId}`; contracts are being removed.'
      operationId: >-
        putRealmsByRealmIdOrganizationsByOrganizationIdContractsByContractIdDealsByDealId
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of your organization: the one that issues the deal.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: contractId
          in: path
          required: true
          description: |-
            ID of the contract the deal belongs to.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: 7e4c2a1b-6d5f-4b3a-9e8d-2f1c0b9a8e7d
        - name: dealId
          in: path
          required: true
          description: |-
            ID of the deal to change.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: 9b2f7c1e-4d3a-4f6b-8e2d-1c0b9a8f7e6d
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  description: >-
                    New description, up to 90 characters. It also renames every
                    invoice of the deal. Omitted or empty: unchanged.
                  example: Mensalidade Plano Pro
                  type: string
                  maxLength: 90
                startAt:
                  description: >-
                    New start date (ISO 8601 date or date-time). Only while the
                    deal has no invoice, and not before the contract starts nor
                    before today. When it is today, the deal's first invoice is
                    created at once.
                  example: '2026-11-01'
                  anyOf:
                    - type: string
                      format: date
                    - type: string
                      format: date-time
                endAt:
                  description: >-
                    New end date (ISO 8601 date or date-time), or `null` to
                    remove it — unless the contract has an end date, which the
                    deal's can't exceed. It can't be before the deal's start
                    date. Today or earlier terminates the deal at once. Omitted:
                    unchanged.
                  example: '2027-11-10'
                  anyOf:
                    - type: string
                      format: date
                      nullable: true
                    - type: string
                      format: date-time
                      nullable: true
                paymentMethods:
                  description: >-
                    New payment method, exactly one: `BANK_SLIP`, `PIX` or
                    `P2P`. A PIX Automático or recurring PIX deal can't change
                    it. With `P2P` the payer needs its Portão 3 wallet, with
                    `BANK_SLIP` or `PIX` its billing address (see
                    `debitParties`). Omitted: unchanged.


                    ---


                    Example: `["BANK_SLIP"]`
                  minItems: 1
                  maxItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - BANK_SLIP
                      - PIX
                      - P2P
                    example: BANK_SLIP
                closingAt:
                  description: >-
                    New closing day of the invoices, as a cron expression `0 0
                    <day> * *` with a day from 1 to 28. Omitted or empty:
                    unchanged.
                  example: 0 0 5 * *
                  type: string
                dueAt:
                  description: >-
                    New due day of the invoices, as a cron expression `0 0 <day>
                    * *` with a day from 1 to 28. Omitted or empty: unchanged.
                  example: 0 0 10 * *
                  type: string
                creditParties:
                  description: >-
                    New receivers. Replaces the whole list; their shares must
                    add up to 100. Omitted: unchanged.
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      document:
                        type: string
                        minLength: 1
                        pattern: ^[A-Za-z0-9]+$
                        description: >-
                          CPF or CNPJ of the receiver, without punctuation (a
                          valid one). It must be a vendor or intermediary of the
                          contract.
                        example: '12345678000195'
                      unit:
                        type: string
                        enum:
                          - PERCENTAGE
                        description: Always `PERCENTAGE`.
                        example: PERCENTAGE
                      name:
                        type: string
                        description: Name of the receiver.
                        example: Empresa Exemplo Ltda
                      email:
                        description: E-mail of the receiver.
                        example: financeiro@empresaexemplo.com.br
                        anyOf:
                          - type: string
                            format: email
                            pattern: >-
                              ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                          - type: string
                            enum:
                              - ''
                      amount:
                        type: number
                        description: >-
                          The receiver's share of every payment, in percent. The
                          shares of all receivers must add up to 100.
                        example: 100
                      account:
                        type: object
                        properties:
                          bank:
                            type: string
                            enum:
                              - P3
                            description: Always `P3`.
                            example: P3
                          type:
                            type: string
                            enum:
                              - WALLET
                            description: Always `WALLET`.
                            example: WALLET
                          identifier:
                            type: object
                            properties:
                              realm:
                                type: string
                                minLength: 1
                                description: ID of the wallet owner's realm.
                                example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                              organization:
                                type: string
                                minLength: 1
                                description: ID of the wallet owner's organization.
                                example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                              account:
                                type: string
                                minLength: 1
                                description: ID of the organization's account.
                                example: 6711b4c0d8e1a30012b7c9f1
                              wallet:
                                type: string
                                minLength: 1
                                description: >-
                                  ID of the wallet, or `default` for the
                                  account's default wallet. It must be active.
                                example: default
                            required:
                              - realm
                              - organization
                              - account
                              - wallet
                            description: Which wallet.
                        required:
                          - bank
                          - type
                          - identifier
                        description: The Portão 3 wallet the share is paid into.
                    required:
                      - document
                      - unit
                      - amount
                      - account
                debitParties:
                  description: >-
                    New payer: exactly one. Replaces the stored one — send its
                    wallet again when the deal needs it, and its address when
                    the deal is paid by `BANK_SLIP` or `PIX`. When the payer's
                    `document` is the stored payer's, the contact fields you
                    leave out (`phone`, `name`, `email`, and the `address`
                    unless you send a new one with its `postalCode` and
                    `street`) keep their stored values; a field you send
                    replaces the stored one, and none can be cleared. Omitted:
                    unchanged.
                  minItems: 1
                  maxItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      document:
                        type: string
                        pattern: ^[A-Za-z0-9]+$
                        description: >-
                          CPF or CNPJ of the payer, without punctuation (a valid
                          one). It must be a buyer of the contract.
                        example: '52998224725'
                      name:
                        description: >-
                          Name of the payer. Omitted (or blank), for the stored
                          payer: the stored name is kept.
                        example: Maria da Silva
                        type: string
                      email:
                        description: >-
                          E-mail of the payer. Omitted (or blank), for the
                          stored payer: the stored e-mail is kept.
                        example: maria.silva@example.com
                        anyOf:
                          - type: string
                            format: email
                            pattern: >-
                              ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                          - type: string
                            enum:
                              - ''
                      phone:
                        description: >-
                          Phone of the payer, in E.164 format: `+`, the country
                          code and the number, digits only. A Brazilian number
                          is `+55`, the 2-digit area code and 8 or 9 digits. It
                          is the phone printed on the payer's fiscal documents.
                          Omitted, for the stored payer: the stored phone is
                          kept.
                        example: '+5511987654321'
                        type: string
                        pattern: ^\+(?:55[0-9]{10,11}|(?!55)[1-9]\d{7,14})$
                      unit:
                        type: string
                        enum:
                          - PERCENTAGE
                        description: Always `PERCENTAGE`.
                        example: PERCENTAGE
                      amount:
                        type: number
                        description: 'The payer''s share of each invoice, in percent: `100`.'
                        example: 100
                      account:
                        description: >-
                          The payer's Portão 3 wallet the invoices are debited
                          from. Required, with every field, when the deal is
                          paid by `P2P`.
                        type: object
                        properties:
                          bank:
                            type: string
                            enum:
                              - P3
                            description: Always `P3`.
                            example: P3
                          type:
                            type: string
                            enum:
                              - WALLET
                            description: Always `WALLET`.
                            example: WALLET
                          identifier:
                            description: Which wallet.
                            type: object
                            properties:
                              realm:
                                description: ID of the payer's realm.
                                example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                                type: string
                              organization:
                                description: ID of the payer's organization.
                                example: 1d3f5a7c-9e2b-4c6d-8f0a-2b4c6d8e0f1a
                                type: string
                              account:
                                description: ID of the payer's account.
                                example: 6711b4c0d8e1a30012b7c9f9
                                type: string
                              wallet:
                                description: >-
                                  ID of the payer's wallet, or `default` for the
                                  account's default wallet.
                                example: default
                                type: string
                      address:
                        description: >-
                          The payer's billing address. Required, with every
                          field but `complement`, when the deal is paid by
                          `BANK_SLIP` or `PIX`, or creates all its invoices at
                          the start with `PIX` or `BANK_SLIP` as a secondary
                          method. Otherwise, for the stored payer, an omitted
                          address keeps the stored one; a sent address with its
                          own `postalCode` and `street` replaces it as sent
                          (nothing of the old one is kept); a partial one,
                          without them, keeps the stored value of each field it
                          omits (or leaves blank).
                        type: object
                        properties:
                          street:
                            type: string
                            description: Street.
                            example: Avenida Paulista
                          number:
                            type: string
                            description: Number.
                            example: '1000'
                          complement:
                            description: Complement, up to 50 characters.
                            example: Sala 12
                            type: string
                          neighborhood:
                            type: string
                            description: Neighborhood.
                            example: Bela Vista
                          city:
                            type: string
                            description: City.
                            example: São Paulo
                          state:
                            description: State, as its two-letter code (`SP`, `RJ`, …).
                            example: SP
                            type: string
                          postalCode:
                            type: string
                            description: Postal code (CEP), as `NNNNN-NNN`.
                            example: 01310-100
                    required:
                      - document
                      - unit
                      - amount
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the deal.
                    example: 9b2f7c1e-4d3a-4f6b-8e2d-1c0b9a8f7e6d
                    format: uuid
                  description:
                    type: string
                    description: >-
                      Description of the deal. It names the invoice of a
                      `SINGLE` deal, and the invoices created at the start when
                      `settings.invoiceNameType` is `DEAL_DESCRIPTION`.
                    example: Mensalidade Plano Pro
                  realm:
                    type: string
                    description: ID of the realm of the organization that issues the deal.
                    example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                    format: uuid
                  organization:
                    type: string
                    description: ID of the organization that issues the deal.
                    example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                    format: uuid
                  contract:
                    type: string
                    description: >-
                      ID of the contract the deal belongs to. Absent on a deal
                      created without a contract.
                    example: 7e4c2a1b-6d5f-4b3a-9e8d-2f1c0b9a8e7d
                    format: uuid
                  chargeType:
                    type: string
                    enum:
                      - SINGLE
                      - RECURRENT
                      - SUBSCRIPTION
                    description: >-
                      `SINGLE`: one invoice. `RECURRENT`: monthly invoices up to
                      `numberOfInstallments` months after `firstChargeDate`.
                      `SUBSCRIPTION`: one invoice a month until the deal ends,
                      is terminated or is canceled. After the first, each
                      invoice is created when the previous one closes — unless
                      the deal created them all at the start
                      (`settings.createAllInvoicesOnStart`) — and only while the
                      deal has a `RECURRENT` product.
                    example: RECURRENT
                  status:
                    type: string
                    enum:
                      - OPEN
                      - CANCELED
                      - TERMINATED
                      - EXPIRED
                      - REVOKED
                    description: >-
                      `OPEN`: active — it creates invoices and can be changed or
                      canceled. `CANCELED`: canceled through the API.
                      `TERMINATED`: it reached its end date (checked daily), its
                      end date was moved to today or earlier, or its contract
                      was terminated. `EXPIRED`: a PIX Automático or recurring
                      PIX deal whose payer never authorized the payment, a few
                      days after the first due date. `REVOKED`: the payer
                      revoked the PIX Automático authorization.
                    example: OPEN
                  firstChargeDate:
                    type: string
                    description: >-
                      Due date of the first invoice. The later invoices are due
                      on the same day of each following month.
                    example: '2026-11-10T00:00:00.000Z'
                    format: date-time
                  numberOfInstallments:
                    type: number
                    description: >-
                      With `settings.createAllInvoicesOnStart`, how many
                      invoices were created at the start. Otherwise it sets when
                      a `RECURRENT` deal ends: `numberOfInstallments` months
                      after `firstChargeDate`. `1` unless it was sent.
                    example: 12
                  settings:
                    type: object
                    properties:
                      createAllInvoicesOnStart:
                        type: boolean
                        description: >-
                          `true`: every invoice of the deal was created with the
                          deal, each due one month after the previous one.
                          Otherwise the deal creates its invoices one at a time,
                          the next one when the previous one closes.
                        example: false
                      disableOpenStatus:
                        type: boolean
                        description: >-
                          `true`: each invoice is closed — and its payment
                          issued — as soon as it is created. Otherwise an
                          invoice created one at a time stays open, gathering
                          charges, until 5 days before its due date; of the
                          invoices created at the start, the first stays open
                          until its due date and the others were created closed.
                        example: false
                      invoiceNameType:
                        type: string
                        enum:
                          - DEAL_DESCRIPTION
                        description: >-
                          `DEAL_DESCRIPTION`: the invoices created at the start
                          are named after the deal's description — as
                          `<description> - <n>/<total>` on a `RECURRENT` deal.
                          Absent, and for invoices created one at a time: they
                          are named after their month (`Nov/26`), except a
                          `SINGLE` deal's invoice, which takes the description.
                        example: DEAL_DESCRIPTION
                      paymentLinkId:
                        type: string
                        description: >-
                          ID of the payment link the deal was created from. Only
                          on deals created by a payment-link checkout.
                        example: 5b8e2f1a-9c4d-4e7b-8a6f-3d2c1b0a9e8f
                        format: uuid
                      callBackUrlForPaymentProvider:
                        type: object
                        properties:
                          success:
                            type: string
                            description: After a successful payment.
                            example: >-
                              https://checkout.portao3.com.br/:paymentLinkId/deals/:dealId/success
                          pending:
                            type: string
                            description: While the payment is pending.
                            example: >-
                              https://checkout.portao3.com.br/:paymentLinkId/deals/:dealId/pending
                          error:
                            type: string
                            description: After a failed payment.
                            example: >-
                              https://checkout.portao3.com.br/:paymentLinkId/deals/:dealId/error
                        description: >-
                          The pages the payer returns to. Only on deals created
                          by a payment-link checkout.
                    description: How the deal creates its invoices.
                  startAt:
                    type: string
                    description: >-
                      When the deal starts: when it was created, unless it was
                      changed with `PUT`.
                    example: '2026-10-26T13:00:00.000Z'
                    format: date-time
                  endAt:
                    type: string
                    nullable: true
                    description: >-
                      When the deal ends. `SINGLE`: when it was created.
                      `RECURRENT`: `numberOfInstallments` months after
                      `firstChargeDate`. `SUBSCRIPTION`: the end date you set,
                      or `null` for no end. Once the end date has passed, a
                      daily routine terminates an `OPEN` deal.
                    example: '2027-11-10T00:00:00.000Z'
                    format: date-time
                  products:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: ID of the product inside the deal.
                          example: 3c1d9a7e-2b4f-4e8a-9c6d-5f7e8a9b0c1d
                          format: uuid
                        identifier:
                          type: string
                          description: Your label for the product.
                          example: PLANO-PRO
                        description:
                          type: string
                          description: Description of the product.
                          example: Plano Pro mensal
                        price:
                          type: number
                          description: >-
                            Price in centavos (`15000` is R$ 150,00), charged on
                            each invoice the product appears on.
                          example: 15000
                        type:
                          type: string
                          enum:
                            - RECURRENT
                            - ONE_TIME
                            - ON_EVENT
                          description: >-
                            Which invoices charge the product. `RECURRENT`:
                            every invoice of the deal. `ONE_TIME`: the first
                            invoice only — or every invoice, when the deal
                            creates all its invoices at the start
                            (`settings.createAllInvoicesOnStart`). `ON_EVENT`:
                            no invoice charges it automatically.
                          example: RECURRENT
                        chargeMethod:
                          type: string
                          enum:
                            - INSTANT
                            - LATER
                          description: >-
                            When the product is charged. `LATER`: it is added to
                            the invoice and paid with it. `INSTANT`: it is
                            debited from the payer's Portão 3 wallet as soon as
                            it is added (only on `P2P` deals).
                          example: LATER
                        idProduct:
                          type: string
                          description: >-
                            ID of the product in your product catalog, when the
                            deal was created from one.
                          example: 8f2e6d4c-1a3b-4c5d-9e8f-7a6b5c4d3e2f
                      required:
                        - id
                        - identifier
                        - price
                        - type
                        - chargeMethod
                      description: A product the deal charges for.
                    description: What the deal charges for.
                  paymentMethods:
                    type: array
                    items:
                      type: string
                      enum:
                        - BANK_SLIP
                        - PIX_INITIATION
                        - PIX_AUTOMATIC
                        - PIX
                        - P2P
                      example: BANK_SLIP
                    description: >-
                      How the invoices are paid: one of `BANK_SLIP` (boleto),
                      `PIX` (a PIX charge), `P2P` (a debit from the payer's
                      Portão 3 wallet), `PIX_AUTOMATIC` (PIX Automático) or
                      `PIX_INITIATION` (recurring scheduled PIX).


                      ---


                      Example: `["BANK_SLIP"]`
                  secondaryPaymentMethods:
                    type: array
                    items:
                      type: string
                      enum:
                        - BANK_SLIP
                        - PIX_INITIATION
                        - PIX_AUTOMATIC
                        - PIX
                        - P2P
                    description: >-
                      Other ways the payer can pay the invoices: `PIX` and/or
                      `BANK_SLIP`. Empty when there are none.


                      ---


                      Example: `[]`
                    example: []
                  creditParties:
                    type: array
                    items:
                      type: object
                      properties:
                        document:
                          type: string
                          description: >-
                            CPF or CNPJ of the receiver, digits only (an
                            alphanumeric CNPJ in upper case).
                          example: '12345678000195'
                        name:
                          type: string
                          description: Name of the receiver.
                          example: Empresa Exemplo Ltda
                        email:
                          type: string
                          description: E-mail of the receiver.
                          example: financeiro@empresaexemplo.com.br
                        unit:
                          type: string
                          enum:
                            - PERCENTAGE
                          description: 'Always `PERCENTAGE`: `amount` is a percentage.'
                          example: PERCENTAGE
                        amount:
                          type: number
                          description: >-
                            The receiver's share of every payment, in percent.
                            The shares of all receivers add up to 100; the
                            deal's own organization keeps what is not
                            transferred to the others.
                          example: 100
                        account:
                          type: object
                          properties:
                            bank:
                              type: string
                              enum:
                                - P3
                              description: 'Always `P3`: a Portão 3 account.'
                              example: P3
                            type:
                              type: string
                              enum:
                                - WALLET
                              description: Always `WALLET`.
                              example: WALLET
                            identifier:
                              type: object
                              properties:
                                realm:
                                  type: string
                                  description: ID of the wallet owner's realm.
                                  example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                                  format: uuid
                                organization:
                                  type: string
                                  description: ID of the wallet owner's organization.
                                  example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                                  format: uuid
                                account:
                                  type: string
                                  description: ID of the organization's account.
                                  example: 6711b4c0d8e1a30012b7c9f1
                                wallet:
                                  type: string
                                  description: >-
                                    ID of the wallet, or `default` for the
                                    account's default wallet.
                                  example: default
                              required:
                                - realm
                                - organization
                                - account
                                - wallet
                              description: Which wallet.
                          required:
                            - bank
                            - type
                            - identifier
                          description: The wallet the share is paid into.
                      required:
                        - document
                        - unit
                        - amount
                        - account
                      description: >-
                        Who receives the money the deal collects, and their
                        share of it.
                    description: Who receives the money and each one's share.
                  debitParties:
                    type: array
                    items:
                      type: object
                      properties:
                        document:
                          type: string
                          description: >-
                            CPF or CNPJ of the payer, digits only (an
                            alphanumeric CNPJ in upper case).
                          example: '52998224725'
                        name:
                          type: string
                          description: Name of the payer.
                          example: Maria da Silva
                        email:
                          type: string
                          description: E-mail of the payer.
                          example: maria.silva@example.com
                        phone:
                          type: string
                          description: >-
                            Phone of the payer, in E.164 format (`+`, the
                            country code and the number, digits only). Absent
                            when the deal has none.
                          example: '+5511987654321'
                        unit:
                          type: string
                          enum:
                            - PERCENTAGE
                          description: 'Always `PERCENTAGE`: `amount` is a percentage.'
                          example: PERCENTAGE
                        amount:
                          type: number
                          description: >-
                            The payer's share of each invoice, in percent:
                            `100`, since a deal has one payer.
                          example: 100
                        account:
                          type: object
                          properties:
                            bank:
                              type: string
                              enum:
                                - P3
                              description: 'Always `P3`: a Portão 3 account.'
                              example: P3
                            type:
                              type: string
                              enum:
                                - WALLET
                              description: Always `WALLET`.
                              example: WALLET
                            identifier:
                              type: object
                              properties:
                                realm:
                                  type: string
                                  description: ID of the wallet owner's realm.
                                  example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                                  format: uuid
                                organization:
                                  type: string
                                  description: ID of the wallet owner's organization.
                                  example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                                  format: uuid
                                account:
                                  type: string
                                  description: ID of the organization's account.
                                  example: 6711b4c0d8e1a30012b7c9f1
                                wallet:
                                  type: string
                                  description: >-
                                    ID of the wallet, or `default` for the
                                    account's default wallet.
                                  example: default
                              required:
                                - realm
                                - organization
                                - account
                                - wallet
                              description: Which wallet.
                          required:
                            - bank
                            - type
                            - identifier
                          description: >-
                            The payer's Portão 3 wallet the invoices are debited
                            from. Present on `P2P` deals.
                        address:
                          type: object
                          properties:
                            street:
                              type: string
                              description: Street.
                              example: Avenida Paulista
                            number:
                              type: string
                              description: Number.
                              example: '1000'
                            complement:
                              type: string
                              description: Complement.
                              example: Sala 12
                            neighborhood:
                              type: string
                              description: Neighborhood.
                              example: Bela Vista
                            city:
                              type: string
                              description: City.
                              example: São Paulo
                            state:
                              type: string
                              description: State, as its two-letter code.
                              example: SP
                            postalCode:
                              type: string
                              description: Postal code (CEP), as `NNNNN-NNN`.
                              example: 01310-100
                          required:
                            - street
                            - number
                            - neighborhood
                            - city
                            - state
                            - postalCode
                          description: >-
                            The payer's billing address. Present on boleto and
                            PIX deals.
                      required:
                        - document
                        - name
                        - unit
                        - amount
                      description: Who pays the deal.
                    description: Who pays.
                  closingAt:
                    type: string
                    description: >-
                      When each invoice created one at a time closes, as a cron
                      expression `0 0 <day of month> * *`: 5 days before
                      `firstChargeDate`'s day, or that same day when
                      `settings.disableOpenStatus` is `true`. Invoices created
                      at the start close on their own due date.
                    example: 0 0 5 * *
                  dueAt:
                    type: string
                    description: >-
                      When each invoice is due, as a cron expression `0 0 <day
                      of month> * *`: `firstChargeDate`'s day.
                    example: 0 0 10 * *
                  createdBy:
                    type: string
                    description: ID of who created the deal.
                    example: 5f0c2b1e-8a3d-4e6f-9b7c-2d1a0e9f8c7b
                  updatedBy:
                    type: string
                    description: ID of who last changed the deal.
                    example: 5f0c2b1e-8a3d-4e6f-9b7c-2d1a0e9f8c7b
                  fine:
                    description: Fine for late payment. `null` when the deal has none.
                    type: object
                    properties:
                      amountType:
                        type: string
                        enum:
                          - FIXED_VALUE
                          - PERCENT
                        description: >-
                          `PERCENT`: `amount` is a percentage of the invoice.
                          `FIXED_VALUE`: `amount` is in centavos.
                        example: PERCENT
                      amount:
                        type: number
                        description: >-
                          The fine: a percentage (`2` is 2%) or an amount in
                          centavos, per `amountType`.
                        example: 2
                    required:
                      - amountType
                      - amount
                    nullable: true
                  interest:
                    description: Interest for late payment. `null` when the deal has none.
                    type: object
                    properties:
                      amountType:
                        type: string
                        enum:
                          - AMOUNT_CALENDAR_DAYS
                          - AMOUNT_WORKING_DAYS
                          - PERCENT_POINT_PER_DAY_CALENDAR_DAYS
                          - PERCENT_POINT_PER_DAY_WORKING_DAYS
                        description: >-
                          `PERCENT_POINT_PER_DAY_CALENDAR_DAYS` /
                          `PERCENT_POINT_PER_DAY_WORKING_DAYS`: `amount` is a
                          percentage — per calendar or working day on a PIX
                          charge, but per MONTH on a boleto.
                          `AMOUNT_CALENDAR_DAYS` / `AMOUNT_WORKING_DAYS`:
                          `amount` is in centavos per calendar or working day.
                        example: PERCENT_POINT_PER_DAY_CALENDAR_DAYS
                      amount:
                        type: number
                        description: >-
                          The interest: a percentage or an amount in centavos,
                          per `amountType`.
                        example: 0.1
                    required:
                      - amountType
                      - amount
                    nullable: true
                  discount:
                    description: Discount for early payment. `null` when the deal has none.
                    type: object
                    properties:
                      amountType:
                        type: string
                        enum:
                          - AMOUNT_PER_ANTECIPATION
                          - PERCENT_PER_ANTECIPATION
                        description: >-
                          `PERCENT_PER_ANTECIPATION`: `amount` is a percentage
                          of the invoice. `AMOUNT_PER_ANTECIPATION`: `amount` is
                          in centavos.
                        example: AMOUNT_PER_ANTECIPATION
                      amount:
                        type: number
                        description: >-
                          The discount: a percentage or an amount in centavos,
                          per `amountType`.
                        example: 500
                    required:
                      - amountType
                      - amount
                    nullable: true
                  createdAt:
                    type: string
                    description: When the deal was created.
                    example: '2026-10-26T13:00:00.000Z'
                    format: date-time
                  updatedAt:
                    type: string
                    description: When the deal last changed.
                    example: '2026-10-26T13:00:00.000Z'
                    format: date-time
                  paymentUrl:
                    type: string
                    description: >-
                      Link where the payer authorizes the payments. Only on
                      `PIX_AUTOMATIC` and `PIX_INITIATION` deals.
                    example: https://pix.example.com/authorize/9b2f7c1e
                  paymentLinkValidity:
                    type: string
                    nullable: true
                    description: >-
                      Until when `paymentUrl` can be used. Only on
                      `PIX_AUTOMATIC` deals; `null` on `PIX_INITIATION` deals.
                    example: '2026-11-09T23:59:59.000Z'
                    format: date-time
                required:
                  - id
                  - realm
                  - organization
                  - chargeType
                  - status
                  - firstChargeDate
                  - startAt
                  - endAt
                  - products
                  - paymentMethods
                  - secondaryPaymentMethods
                  - creditParties
                  - debitParties
                  - closingAt
                  - dueAt
                  - createdBy
                  - updatedBy
                  - createdAt
                  - updatedAt
                description: >-
                  A deal: what an organization charges a payer for, how and
                  when.
        '400':
          description: >-
            `DEAL_NOT_OPEN` — The deal was canceled, terminated, expired or
            revoked.


            `DEAL_END_AT_BEFORE_START_AT` — The deal would end before it starts.


            `DEAL_START_AT_LOCKED` — `startAt` was sent, and the deal already
            has invoices.


            `DEAL_PAYMENT_METHOD_LOCKED` — `paymentMethods` was sent for a PIX
            Automático or recurring PIX deal.


            `DEBIT_PARTY_DOCUMENT_MISMATCH_CONTRACT` — The new payer is not a
            buyer of the contract.


            `CREDIT_PARTY_DOCUMENT_MISMATCH_CONTRACT` — A new receiver is not a
            vendor or intermediary of the contract.


            `INVALID_PARTY_REALM_ORG` — A new receiver's wallet belongs to a
            realm and organization that don't match the contract's.


            `PARTY_REALM_ORG_NOT_FOUND` — A new receiver's wallet organization
            does not exist, is not active, or has another document.


            `CREDIT_AMOUNT_MISMATCH` — The new receivers' shares don't add up to
            100.


            `DEBIT_AMOUNT_MISMATCH` — The new payer's share is not 100.


            `WALLET_NOT_ACTIVE` — A new receiver's wallet is not active, or a
            new payer's is neither active nor pending activation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - DEAL_NOT_OPEN
                      - DEAL_END_AT_BEFORE_START_AT
                      - DEAL_START_AT_LOCKED
                      - DEAL_PAYMENT_METHOD_LOCKED
                      - DEBIT_PARTY_DOCUMENT_MISMATCH_CONTRACT
                      - CREDIT_PARTY_DOCUMENT_MISMATCH_CONTRACT
                      - INVALID_PARTY_REALM_ORG
                      - PARTY_REALM_ORG_NOT_FOUND
                      - CREDIT_AMOUNT_MISMATCH
                      - DEBIT_AMOUNT_MISMATCH
                      - WALLET_NOT_ACTIVE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: DEAL_NOT_OPEN
                origin: BILLING
                message: Deal is not open
        '403':
          description: >-
            `INSUFFICIENT_PERMISSIONS` — You are not a member of the
            organization nor an admin of the realm.


            `BILLING_P2P_NOT_ENABLED` — The deal is, or would become, paid by
            `P2P`, and P2P is not enabled for your organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - INSUFFICIENT_PERMISSIONS
                      - BILLING_P2P_NOT_ENABLED
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: INSUFFICIENT_PERMISSIONS
                origin: BILLING
                message: insufficient permissions
        '404':
          description: >-
            `CONTRACT_NOT_FOUND` — The organization has no contract with this
            ID.


            `DEAL_NOT_FOUND` — The contract has no deal with this ID.


            `WALLET_NOT_FOUND` — A new receiver's wallet does not exist.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - CONTRACT_NOT_FOUND
                      - DEAL_NOT_FOUND
                      - WALLET_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: CONTRACT_NOT_FOUND
                origin: BILLING
                message: Contract not found
        '422':
          description: >-
            `DEAL_START_AT_INVALID` — The new `startAt` is before today or
            before the contract starts.


            `DEAL_END_AT_REQUIRED` — `endAt` was sent as `null`, and the
            contract has an end date.


            `DEAL_END_AT_INVALID` — The deal would end after the contract.


            `CREATE_INVOICE_ERROR` — The new `startAt` is today and the deal's
            first invoice could not be created.


            `BAD_REQUEST` — The body is invalid — a date that is not a date, a
            cron that is not `0 0 <day> * *`, more than one payment method, a
            payer without the address or wallet the payment method needs — or a
            path parameter is not a valid ID; `fields` lists each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - DEAL_START_AT_INVALID
                      - DEAL_END_AT_REQUIRED
                      - DEAL_END_AT_INVALID
                      - CREATE_INVOICE_ERROR
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: DEAL_START_AT_INVALID
                origin: BILLING
                message: Start date is before contract start at or today

````

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