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

# Save organization billing details

> Replaces billing details for future fiscal documents. Existing prepared or issued documents retain their recipient snapshot. A complete profile finishes the billing-details onboarding step and allows waiting fiscal workflows to proceed.

<Info>
  Requires the IAM action **`billing:UpdateBillingProfile`**. See [BILLING permissions](/billing/permissions) for the full list, what each one covers, and an example policy.
</Info>


## OpenAPI

````yaml /api-reference/specs/billing.yaml put /v1/profile
openapi: 3.0.3
info:
  title: Basaltic Billing API
  version: 1.0.0
  description: |
    Prices, metered usage, invoices, payments and credits for the organization.
    The price catalog (`/v1/prices`) is public; other operations require
    organization policy grants for billing actions.

    Includes editable billing profiles and fiscal invoice status/downloads.
    Settling an invoice and managing payment methods happen in the console.
  contact:
    name: Basaltic Support
    email: ping@basaltic.sh
  license:
    name: Proprietary
    url: https://basaltic.sh/terms
servers:
  - url: https://billing.basaltic.sh
    description: Global API endpoint
security:
  - BearerAuth: []
paths:
  /v1/profile:
    put:
      tags:
        - Billing
      summary: Save organization billing details
      description: >-
        Replaces billing details for future fiscal documents. Existing prepared
        or issued documents retain their recipient snapshot. A complete profile
        finishes the billing-details onboarding step and allows waiting fiscal
        workflows to proceed.
      operationId: updateBillingProfile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingProfile'
      responses:
        '200':
          description: Saved details, readiness and missing fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingProfile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    BillingProfile:
      type: object
      description: >-
        Organization billing recipient. Incomplete drafts are saved; ready
        becomes true only after all country-specific fields are valid. New
        onboarding completes after this step.
      properties:
        customer_type:
          type: string
          enum:
            - ''
            - individual
            - company
        company_name:
          type: string
          maxLength: 75
          description: Full legal name of the individual or company.
        country:
          type: string
          minLength: 2
          maxLength: 2
          description: ISO 3166-1 alpha-2 country code.
          example: BR
        tax_id:
          type: string
          description: >-
            CPF for a Brazilian individual or CNPJ for a Brazilian company.
            Check digits are validated.
        foreign_tax_id:
          type: string
          maxLength: 50
          description: Foreign identifier; not validated as a Brazilian document.
        no_tax_id_reason:
          type: string
          maxLength: 100
          description: Required for a foreign recipient without a tax identifier.
        email:
          type: string
          format: email
          maxLength: 75
          description: >-
            Billing email for fiscal invoice delivery. The onboarding form
            prefills this from the signed-in user's email.
        phone:
          type: string
          maxLength: 50
        street_name:
          type: string
          maxLength: 50
        street_number:
          type: string
          maxLength: 10
        complement:
          type: string
          maxLength: 30
        neighborhood:
          type: string
          maxLength: 30
        city:
          type: string
          maxLength: 100
        municipality_code:
          type: string
          description: >-
            Seven-digit IBGE municipality code, required for a Brazilian
            recipient.
          example: '3550308'
        state:
          type: string
          maxLength: 100
          description: Two-letter UF for Brazil; free-form state/province abroad.
        postal_code:
          type: string
          maxLength: 20
          description: >-
            Eight-digit CEP for Brazil; optional international postal code
            abroad.
        ready:
          type: boolean
          readOnly: true
        missing_fields:
          type: array
          readOnly: true
          items:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: Error code identifying the type of error
              example: INVALID_INPUT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameters
            request_id:
              type: string
              format: uuid
              description: Request ID for debugging
              example: 550e8400-e29b-41d4-a716-446655440000
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_INPUT
              message: Invalid request parameters
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Unauthorized:
      description: Authentication required or token invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Authentication required
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: ACCESS_DENIED
              message: You don't have permission to perform this action
              request_id: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        An OAuth 2.0 bearer token, sent as `Authorization: Bearer <token>`.
        This is the recommended way to authenticate.

        Get one by exchanging a service account's access key pair at
        `POST /v1/oauth/token` with `grant_type=client_credentials`. It is the
        standard client-credentials grant, so any OAuth-aware library will
        obtain and refresh it for you.

        ```
        curl -s -u "$KEY_ID:$SECRET" -d grant_type=client_credentials \
          https://iam.basaltic.sh/v1/oauth/token
        ```

        Tokens last an hour by default. The same access key pair is separately
        your AWS SigV4 credential for the S3-compatible object endpoint, which
        speaks nothing else.

````