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

# Update payment account

> Updates the legal entity of a payment account, including the billing emails that receive its invoices. The payload replaces the current legal entity, so send every field you want to keep: an omitted trade name, address or email list is cleared, and a partial address is rejected.



## OpenAPI

````yaml /api-reference/openapi.yaml put /v1/payment-accounts/{id}
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/payment-accounts/{id}:
    put:
      tags:
        - Payment Accounts
      summary: Update payment account
      description: >-
        Updates the legal entity of a payment account, including the billing
        emails that receive its invoices. The payload replaces the current legal
        entity, so send every field you want to keep: an omitted trade name,
        address or email list is cleared, and a partial address is rejected.
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
          description: The unique identifier of the payment account in our system.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customerId:
                  description: >-
                    The unique identifier of the customer that owns the payment
                    account.
                  type: string
                  format: uuid
                legalEntity:
                  type: object
                  description: >-
                    Schema representing a legal entity: the registered company
                    or person behind payment accounts and issued invoices.
                  properties:
                    tradeName:
                      type: string
                      nullable: true
                      description: >-
                        Trade name (nome fantasia) of the legal entity. Null
                        when absent.
                    businessName:
                      type: string
                      description: >-
                        Registered business name (razão social) of the legal
                        entity.
                    emails:
                      type: array
                      items:
                        type: string
                        format: email
                      default: []
                      description: Billing contact email addresses of the legal entity.
                    taxId:
                      type: string
                      pattern: ^(^\d{14}$|^\d{11}$)$
                      description: >-
                        Tax identification number of the legal entity, digits
                        only.
                      example: '01234567000189'
                    taxIdType:
                      type: string
                      enum:
                        - cnpj
                        - cpf
                      description: >-
                        The kind of tax identification number in taxId (e.g.
                        CNPJ for Brazilian companies, CPF for individuals).
                    zipCode:
                      type: string
                      pattern: ^[0-9]{8}$
                      nullable: true
                      description: >-
                        Postal code of the legal entity address. Null when
                        absent.
                    street:
                      type: string
                      nullable: true
                      description: Street of the legal entity address. Null when absent.
                    number:
                      type: string
                      nullable: true
                      description: >-
                        Street number of the legal entity address. Null when
                        absent.
                    neighborhood:
                      type: string
                      nullable: true
                      description: >-
                        Neighborhood of the legal entity address. Null when
                        absent.
                    city:
                      type: string
                      nullable: true
                      description: City of the legal entity address. Null when absent.
                    state:
                      type: string
                      enum:
                        - AC
                        - AL
                        - AP
                        - AM
                        - BA
                        - CE
                        - DF
                        - ES
                        - GO
                        - MA
                        - MT
                        - MS
                        - MG
                        - PA
                        - PB
                        - PR
                        - PE
                        - PI
                        - RJ
                        - RN
                        - RS
                        - RO
                        - RR
                        - SC
                        - SP
                        - SE
                        - TO
                      nullable: true
                      description: >-
                        State of the legal entity address, as a two-letter code.
                        Null when absent.
                    country:
                      type: string
                      enum:
                        - Brasil
                      nullable: true
                      description: Country of the legal entity address. Null when absent.
                    complement:
                      type: string
                      nullable: true
                      description: >-
                        Address complement of the legal entity address. Null
                        when absent.
                    customFields:
                      type: object
                      description: >-
                        Custom fields that can be associated with the entity.
                        The fields must be previously created in the system
                        before they can be used.
                      additionalProperties:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                      default: {}
                      example:
                        customField1: value1
                        customField2:
                          - value2
                          - value3
                  required:
                    - businessName
                    - taxId
                    - taxIdType
                    - customFields
                  additionalProperties: false
              required:
                - customerId
                - legalEntity
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Schema representing a payment account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    description: >-
                      The unique identifier of the payment account in our
                      system.
                    type: string
                    format: uuid
                  customerId:
                    description: >-
                      The unique identifier of the customer that owns the
                      payment account.
                    type: string
                    format: uuid
                  archivedAt:
                    description: Archive timestamp for payment accounts that were archived.
                    type:
                      - 'null'
                      - string
                    format: date-time
                  legalEntity:
                    type: object
                    description: >-
                      Schema representing a legal entity: the registered company
                      or person behind payment accounts and issued invoices.
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: >-
                          The unique identifier of the legal entity in our
                          system.
                      tradeName:
                        type: string
                        nullable: true
                        description: >-
                          Trade name (nome fantasia) of the legal entity. Null
                          when absent.
                      businessName:
                        type: string
                        description: >-
                          Registered business name (razão social) of the legal
                          entity.
                      emails:
                        type: array
                        items:
                          type: string
                          format: email
                        default: []
                        description: Billing contact email addresses of the legal entity.
                      taxId:
                        type: string
                        pattern: ^(^\d{14}$|^\d{11}$)$
                        description: >-
                          Tax identification number of the legal entity, digits
                          only.
                        example: '01234567000189'
                      taxIdType:
                        type: string
                        enum:
                          - cnpj
                          - cpf
                        description: >-
                          The kind of tax identification number in taxId (e.g.
                          CNPJ for Brazilian companies, CPF for individuals).
                      zipCode:
                        type: string
                        pattern: ^[0-9]{8}$
                        nullable: true
                        description: >-
                          Postal code of the legal entity address. Null when
                          absent.
                      street:
                        type: string
                        nullable: true
                        description: Street of the legal entity address. Null when absent.
                      number:
                        type: string
                        nullable: true
                        description: >-
                          Street number of the legal entity address. Null when
                          absent.
                      neighborhood:
                        type: string
                        nullable: true
                        description: >-
                          Neighborhood of the legal entity address. Null when
                          absent.
                      city:
                        type: string
                        nullable: true
                        description: City of the legal entity address. Null when absent.
                      state:
                        type: string
                        enum:
                          - AC
                          - AL
                          - AP
                          - AM
                          - BA
                          - CE
                          - DF
                          - ES
                          - GO
                          - MA
                          - MT
                          - MS
                          - MG
                          - PA
                          - PB
                          - PR
                          - PE
                          - PI
                          - RJ
                          - RN
                          - RS
                          - RO
                          - RR
                          - SC
                          - SP
                          - SE
                          - TO
                        nullable: true
                        description: >-
                          State of the legal entity address, as a two-letter
                          code. Null when absent.
                      country:
                        type: string
                        enum:
                          - Brasil
                        nullable: true
                        description: Country of the legal entity address. Null when absent.
                      complement:
                        type: string
                        nullable: true
                        description: >-
                          Address complement of the legal entity address. Null
                          when absent.
                      customFields:
                        type: object
                        description: >-
                          Custom fields that can be associated with the entity.
                          The fields must be previously created in the system
                          before they can be used.
                        additionalProperties:
                          anyOf:
                            - type: string
                            - type: array
                              items:
                                type: string
                        default: {}
                        example:
                          customField1: value1
                          customField2:
                            - value2
                            - value3
                    required:
                      - id
                      - businessName
                      - taxId
                      - taxIdType
                      - customFields
                    additionalProperties: false
                required:
                  - id
                  - customerId
                  - archivedAt
                  - legalEntity
                additionalProperties: false
        '400':
          description: Error object returned to the client.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error
                  code:
                    type: string
                    description: A unique identifier for the type of error
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      Additional context about the error, such as invalid fields
                      or constraints. Each endpoint may include specific error
                      details in their documentation
                  causations:
                    type: array
                    description: >-
                      Optional array of error objects following the same
                      structure as the parent error. Only present when there's a
                      meaningful chain of related errors to expose
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: >-
                            A human-readable description of the underlying error
                            cause
                        code:
                          type: string
                          description: A unique identifier for the type of underlying error
                        details:
                          type: object
                          additionalProperties: true
                          description: Additional context about the underlying error
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - code
                  - message
                additionalProperties: false
        '404':
          description: Error object returned to the client when a resource is not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

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