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

# Replace payment methods

> Fully replaces organization trip payment-method configuration. Only ACTIVE, card-enabled wallets are accepted. CARD/TRIP custom fields are always copied from the trip; non-shared required CARD fields must be supplied.



## OpenAPI

````yaml /api-reference/travel.openapi.json put /realms/{realmId}/organizations/{organizationId}/configurations/payment-methods
openapi: 3.0.3
info:
  title: Travel
  version: 1.0.0
  description: >-
    Portão 3 travel 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). Passenger directory, trips
    and the search proxy (air/hotel/bus/vehicle). Every route validates path,
    query and body through a zod Input class (`travel/src/domain/*/input`),
    which documents its parameters and body; responses are the named interfaces
    in `travel/src/domain/*/response.ts`. Confidence tiers: generated:typed=60
    copied:manual=0 unknown=0.
servers:
  - url: https://api.travel.v2.portao3.com.br/
    description: production
  - url: https://api.travel.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Passengers
  - name: Trips
  - name: Air search
  - name: Hotel search
  - name: Bus search
  - name: Vehicle search
  - name: Configurations
paths:
  /realms/{realmId}/organizations/{organizationId}/configurations/payment-methods:
    put:
      tags:
        - Configurations
      summary: Replace payment methods
      description: >-
        Fully replaces organization trip payment-method configuration. Only
        ACTIVE, card-enabled wallets are accepted. CARD/TRIP custom fields are
        always copied from the trip; non-shared required CARD fields must be
        supplied.
      operationId: >-
        putRealmsByRealmIdOrganizationsByOrganizationIdConfigurationsPaymentMethods
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of the realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of the organization.

            Format: `UUID`
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  oneOf:
                    - type: object
                      properties:
                        source:
                          type: string
                          enum:
                            - REQUESTER
                      required:
                        - source
                    - type: object
                      properties:
                        source:
                          type: string
                          enum:
                            - WALLET
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                      required:
                        - source
                        - walletId
                  description: >-
                    Use the human requester's personal wallet or a configured
                    organization wallet.
                cardCustomFields:
                  description: >-
                    Values for non-shared ACTIVE CARD fields. Shared CARD/TRIP
                    fields are copied automatically; never submit
                    TRIP_CUSTOM_FIELD.
                  type: object
                  additionalProperties: {}
              required:
                - wallet
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  wallet:
                    anyOf:
                      - type: object
                        properties:
                          source:
                            type: string
                            enum:
                              - REQUESTER
                        required:
                          - source
                      - type: object
                        properties:
                          source:
                            type: string
                            enum:
                              - WALLET
                          walletId:
                            type: string
                          accountId:
                            type: string
                        required:
                          - source
                          - walletId
                          - accountId
                    description: >-
                      Funding wallet selection; accountId is resolved by
                      banking, not supplied by the caller.
                  cardCustomFields:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Validated CARD values plus TRIP_CUSTOM_FIELD markers for
                      shared CARD/TRIP definitions.
                required:
                  - wallet
                  - cardCustomFields
        '403':
          description: >-
            `TRAVEL_ADMIN_REQUIRED` — Human organization or realm admin
            required.
          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:
                      - TRAVEL_ADMIN_REQUIRED
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - TRAVEL
                    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: TRAVEL_ADMIN_REQUIRED
                origin: TRAVEL
                message: Organization admin required
        '422':
          description: >-
            `PAYMENT_METHOD_WALLET_INVALID` — Wallet cannot be selected.


            `CARD_CUSTOM_FIELD_COPIED_FROM_TRIP` — Shared slugs cannot be
            submitted.


            `INVALID_CUSTOM_FIELD` — Unknown, reserved, missing required or
            invalid CARD value.
          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:
                      - PAYMENT_METHOD_WALLET_INVALID
                      - CARD_CUSTOM_FIELD_COPIED_FROM_TRIP
                      - INVALID_CUSTOM_FIELD
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - TRAVEL
                    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: PAYMENT_METHOD_WALLET_INVALID
                origin: TRAVEL
                message: The configured wallet is not active or cannot pay by card

````

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