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

# Create customer

> Creates a new customer.

> [!NOTE]
>
> API v2 is in beta. Endpoints return the `X-Lago-Endpoint-Status: beta` header.


## OpenAPI

````yaml https://swagger.getlago.com/openapi-v2.yaml POST /customers
openapi: 3.1.0
info:
  title: Lago API v2 documentation
  description: >-
    Lago API v2. Documents native v2 endpoints for the product catalog, billing,
    customers, organizations, billing entities, billable metrics, events,
    features, privileges, entitlements, wallets, alerts, logs and webhook
    endpoints. Paginated lists use cursor pagination. Some lists, such as rates
    and phases, return the complete list without pagination. Native v2 endpoints
    use opt-in relationship expansions and structured error responses. Only the
    documented actions and expansions are supported. Some other /api/v2 paths
    still fall back to v1 controllers and are not described here.
  version: 2.0.0-beta
  license:
    name: AGPLv3
    url: https://github.com/getlago/lago-openapi/blob/main/LICENSE
  contact:
    email: tech@getlago.com
servers:
  - url: https://api.getlago.com/api/v2
    description: US Lago cluster
  - url: https://api.eu.getlago.com/api/v2
    description: EU Lago cluster
security:
  - bearerAuth: []
tags:
  - name: taxes
    description: Tax rates
  - name: product_categories
    description: product categories operations
  - name: products
    description: products operations
  - name: product_filters
    description: product filters operations
  - name: rate_cards
    description: rate cards operations
  - name: rate_card_rates
    description: rate card rates operations
  - name: catalog_plans
    description: catalog plans operations
  - name: plan_applied_rate_cards
    description: plan applied rate cards operations
  - name: plan_rate_phases
    description: plan rate phases operations
  - name: contract_applied_rate_cards
    description: contract applied rate cards operations
  - name: contract_rate_phases
    description: contract rate phases operations
  - name: contracts
    description: contracts operations
  - name: invoices
    description: invoices operations
  - name: fees
    description: fees operations
  - name: payments
    description: payments operations
  - name: payment_requests
    description: payment requests operations
  - name: payment_receipts
    description: payment receipts operations
  - name: credit_notes
    description: credit notes operations
  - name: customers
    description: customers operations
  - name: organizations
    description: Organization operations
  - name: billing_entities
    description: billing entities operations
  - name: billable_metrics
    description: billable metrics operations
  - name: events
    description: Event operations
  - name: activity_logs
    description: activity logs operations
  - name: api_logs
    description: api logs operations
  - name: security_logs
    description: security logs operations
  - name: webhook_endpoints
    description: webhook endpoints operations
  - name: features
    description: features operations
  - name: feature_privileges
    description: feature privileges operations
  - name: plan_wallets
    description: plan wallets operations
  - name: contract_wallets
    description: contract wallets operations
  - name: contract_wallet_transactions
    description: contract wallet transactions operations
  - name: plan_wallet_alerts
    description: plan wallet alerts operations
  - name: contract_wallet_alerts
    description: contract wallet alerts operations
  - name: contract_alerts
    description: contract alerts operations
  - name: plan_entitlements
    description: plan entitlements operations
  - name: contract_entitlements
    description: contract entitlements operations
externalDocs:
  description: Lago documentation
  url: https://getlago.com/docs
paths:
  /customers:
    post:
      tags:
        - customers
      summary: Create customer
      description: >-
        Creates a new customer. An existing external_id returns 422 rather than
        updating that customer. Billing and payment settings are top-level
        fields, not a billing_configuration object. Relationships are omitted
        from the response unless retrieved later with a supported expansion.

        Requires the product catalog to be enabled and customer write permission
        on the API key.
      operationId: createCustomer
      requestBody:
        required: true
        description: Request payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateInput'
      responses:
        '200':
          description: Successful response
          headers:
            X-Lago-Endpoint-Status:
              $ref: '#/components/headers/EndpointStatus'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    CustomerCreateInput:
      type: object
      description: Create customer.
      required:
        - customer
      properties:
        customer:
          allOf:
            - $ref: '#/components/schemas/CustomerBaseInput'
            - type: object
              required:
                - external_id
              properties:
                metadata:
                  type: array
                  items:
                    type: object
                    required:
                      - key
                      - value
    Customer:
      type: object
      description: customer response.
      required:
        - customer
      properties:
        customer:
          $ref: '#/components/schemas/CustomerEndpointObject'
    CustomerBaseInput:
      type: object
      minProperties: 1
      properties:
        external_id:
          type: string
          description: >-
            Unique customer identifier in your application. On update, changes
            are ignored if the customer has subscriptions, invoices, add-ons,
            wallets or currency-based coupons.
          example: customer_123
        name:
          type:
            - string
            - 'null'
          description: Name.
          example: example
        firstname:
          type:
            - string
            - 'null'
          description: Firstname.
          example: example
        lastname:
          type:
            - string
            - 'null'
          description: Lastname.
          example: example
        customer_type:
          type:
            - string
            - 'null'
          description: Type of customer.
          example: company
          enum:
            - company
            - individual
            - null
        account_type:
          type: string
          description: >-
            Account type. Requires revenue share to be enabled. On update,
            changes are ignored if the customer has subscriptions, invoices,
            add-ons, wallets or currency-based coupons.
          example: customer
          enum:
            - customer
            - partner
        email:
          type:
            - string
            - 'null'
          description: Email.
          example: billing@acme.example
        phone:
          type:
            - string
            - 'null'
          description: Phone.
          example: example
        url:
          type:
            - string
            - 'null'
          description: Url.
          example: example
        logo_url:
          type:
            - string
            - 'null'
          description: Logo url.
          example: example
        address_line1:
          type:
            - string
            - 'null'
          description: Address line1.
          example: example
        address_line2:
          type:
            - string
            - 'null'
          description: Address line2.
          example: example
        city:
          type:
            - string
            - 'null'
          description: City.
          example: example
        state:
          type:
            - string
            - 'null'
          description: State.
          example: example
        zipcode:
          type:
            - string
            - 'null'
          description: Zipcode.
          example: example
        country:
          type:
            - string
            - 'null'
          description: Country.
          example: example
        legal_name:
          type:
            - string
            - 'null'
          description: Legal name.
          example: example
        legal_number:
          type:
            - string
            - 'null'
          description: Legal number.
          example: example
        tax_identification_number:
          type:
            - string
            - 'null'
          description: Tax identification number.
          example: example
        currency:
          type:
            - string
            - 'null'
          description: Currency as an ISO 4217 code.
          example: USD
        timezone:
          type:
            - string
            - 'null'
          description: >-
            Timezone. Requires a premium license; otherwise the value is
            ignored.
          example: example
        finalize_zero_amount_invoice:
          type:
            - string
            - 'null'
          description: >-
            Whether to finalize zero-amount invoices. Null resets this setting
            to inherit.
          example: inherit
          enum:
            - inherit
            - skip
            - finalize
            - null
        skip_invoice_custom_sections:
          type: boolean
          description: Skip invoice custom sections.
          example: false
        external_salesforce_id:
          type:
            - string
            - 'null'
          description: External salesforce id.
          example: example
        billing_entity_code:
          type: string
          description: Code of the customer billing entity.
          example: main
        invoice_grace_period:
          type:
            - integer
            - 'null'
          description: >-
            Invoice grace period. Requires a premium license; otherwise the
            value is ignored.
          example: 1
        payment_provider:
          type:
            - string
            - 'null'
          description: Payment provider.
          example: example
        payment_provider_code:
          type:
            - string
            - 'null'
          description: Payment provider code.
          example: example
        provider_customer_id:
          type:
            - string
            - 'null'
          description: Customer identifier in the payment provider.
          example: cus_example
        provider_payment_methods:
          type:
            - array
            - 'null'
          description: Payment methods allowed by the provider.
          items:
            type: string
            description: Payment method type.
            example: card
        document_locale:
          type:
            - string
            - 'null'
          description: Document locale.
          example: example
        periodic_invoice_issuing_date_anchor:
          type:
            - string
            - 'null'
          description: Date used to issue periodic invoices.
          example: current_period_end
          enum:
            - current_period_end
            - next_period_start
            - null
        periodic_invoice_issuing_date_adjustment:
          type:
            - string
            - 'null'
          description: Adjustment applied to periodic invoice issuing dates.
          example: keep_anchor
          enum:
            - keep_anchor
            - align_with_finalization_date
            - null
        sync:
          type: boolean
          description: >-
            Whether to run payment-provider synchronization before returning the
            response rather than in a background job.
          example: false
        sync_with_provider:
          type: boolean
          description: >-
            Whether to create or synchronize the customer with the selected
            payment provider.
          example: false
        shipping_address:
          $ref: '#/components/schemas/ShippingAddressInput'
        tax_codes:
          type: array
          description: Tax codes to assign. An empty array removes the assignments.
          items:
            type: string
            description: Tax codes to assign. An empty array removes the assignments.
            example: vat
        invoice_custom_section_codes:
          type: array
          description: >-
            Invoice custom section codes to assign. An empty array removes the
            assignments.
          items:
            type: string
            description: >-
              Invoice custom section codes to assign. An empty array removes the
              assignments.
            example: legal
        metadata:
          type: array
          description: >-
            Customer metadata. At most five entries. On update, this is a full
            replacement. Include id for each existing entry to keep or update
            it. Entries without id are created, not matched by key. Omitted
            entries are deleted.
          items:
            type: object
            description: >-
              Customer metadata entry. For a new entry, key and value are
              required. For an existing entry, send its id and any fields to
              change.
            properties:
              id:
                type:
                  - string
                  - 'null'
                description: Existing metadata identifier.
                example: 1a901a90-1a90-1a90-1a90-1a901a901a90
                format: uuid
              key:
                type: string
                description: Metadata key.
                example: reference
                maxLength: 20
              value:
                type: string
                description: Metadata value.
                example: '123'
                maxLength: 100
              display_on_invoice:
                type: boolean
                description: >-
                  Whether to display the value on invoices. Defaults to false
                  when omitted, including when updating an existing entry.
                example: false
                default: false
            anyOf:
              - required:
                  - id
                properties:
                  id:
                    type: string
              - required:
                  - key
                  - value
          maxItems: 5
        integration_customers:
          type: array
          description: >-
            Integration mappings. Only one entry per integration type is
            accepted. On update, this is a full replacement. Include id for each
            existing mapping to keep or update it. Omitted mappings are deleted.
          items:
            type: object
            description: Customer integration mapping.
            required:
              - integration_type
            properties:
              id:
                type:
                  - string
                  - 'null'
                description: Existing mapping identifier.
                example: 1a901a90-1a90-1a90-1a90-1a901a901a90
                format: uuid
              code:
                type: string
                description: Mapping code.
                example: default
              external_customer_id:
                type: string
                description: Customer identifier in the integration.
                example: customer_123
              integration_type:
                type: string
                description: Integration type.
                example: netsuite
                enum:
                  - netsuite
                  - okta
                  - anrok
                  - avalara
                  - xero
                  - hubspot
                  - salesforce
              integration_code:
                type: string
                description: Integration code.
                example: anrok
              subsidiary_id:
                type: string
                description: Provider subsidiary identifier.
                example: subsidiary_123
              sync_with_provider:
                type: boolean
                description: Whether to synchronize the mapping with the provider.
                example: false
              targeted_object:
                type: string
                description: Object targeted in the integration.
                example: customer
    CustomerEndpointObject:
      allOf:
        - $ref: '#/components/schemas/CustomerObject'
        - type: object
          required:
            - shipping_address
          properties:
            shipping_address:
              $ref: '#/components/schemas/ShippingAddressObject'
              description: Shipping address of the customer.
            metadata:
              type: array
              description: Customer metadata. Included only with expands[]=metadata.
              items:
                $ref: '#/components/schemas/CustomerMetadataObject'
            taxes:
              type: array
              description: Customer taxes. Included only with expands[]=taxes.
              items:
                $ref: '#/components/schemas/TaxObject'
            integration_customers:
              type: array
              description: >-
                Integration mappings. Included only with
                expands[]=integration_customers.
              items:
                $ref: '#/components/schemas/IntegrationCustomerObject'
    ApiError:
      type: object
      required:
        - code
        - details
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]*$
          description: >-
            Code identifying the failure. The HTTP status is carried by the
            response, not the body.
          example: validation_errors
        details:
          type: array
          description: >-
            Details of the failure. The array is empty when no field details are
            available.
          items:
            type: object
            required:
              - code
              - field
              - meta
            properties:
              code:
                type: string
                pattern: ^[a-z][a-z0-9_]*$
                description: >-
                  Code identifying the field error or the reason a request
                  parameter was rejected.
                example: value_is_mandatory
              field:
                type: string
                description: >-
                  Request field or parameter. Nested fields use dots and
                  zero-based array indexes. A resource-level failure uses base.
                example: name
              meta:
                type: object
                description: >-
                  Information about the failure, such as the missing resource,
                  allowed values or bounds. The object is empty when no metadata
                  is available.
                additionalProperties: true
                example: {}
                properties:
                  min:
                    type: integer
                    description: Inclusive minimum value.
                    example: 0
                  max:
                    type: integer
                    description: Inclusive maximum value.
                    example: 100
                  min_length:
                    type: integer
                    description: Minimum string length, in characters.
                    example: 1
                  max_length:
                    type: integer
                    description: Maximum string length, in characters.
                    example: 255
                  max_items:
                    type: integer
                    description: Maximum number of items.
                    example: 100
                  allowed_values:
                    type: array
                    description: Values accepted for the field.
                    items:
                      type: string
                      description: Allowed value.
                      example: draft
                  invalid_values:
                    type: array
                    description: Values rejected by request validation.
                    items:
                      type: string
                      description: Rejected value.
                      example: unknown
                  value:
                    type: string
                    description: Query parameter value received.
                    example: unknown
                  resource:
                    type: string
                    description: Resource that could not be found.
                    example: customer
                  provider_name:
                    type: string
                    description: Name of the provider that failed.
                    example: stripe
                  provider_code:
                    type: string
                    description: Code of the provider connection.
                    example: stripe_eu
                  provider_error_code:
                    type: string
                    description: Error code returned by the provider.
                    example: resource_missing
    ShippingAddressInput:
      type: object
      description: Shipping address.
      required: []
      properties:
        address_line1:
          type:
            - string
            - 'null'
          description: Address line1.
          example: example
        address_line2:
          type:
            - string
            - 'null'
          description: Address line2.
          example: example
        city:
          type:
            - string
            - 'null'
          description: City.
          example: example
        zipcode:
          type:
            - string
            - 'null'
          description: Zipcode.
          example: example
        state:
          type:
            - string
            - 'null'
          description: State.
          example: example
        country:
          type:
            - string
            - 'null'
          description: Country.
          example: FR
    CustomerObject:
      type: object
      description: Customer.
      required:
        - lago_id
        - billing_entity_code
        - external_id
        - account_type
        - name
        - firstname
        - lastname
        - customer_type
        - sequential_id
        - slug
        - country
        - address_line1
        - address_line2
        - state
        - zipcode
        - email
        - city
        - url
        - phone
        - logo_url
        - legal_name
        - legal_number
        - currency
        - tax_identification_number
        - timezone
        - applicable_timezone
        - external_salesforce_id
        - finalize_zero_amount_invoice
        - skip_invoice_custom_sections
        - invoice_grace_period
        - periodic_invoice_issuing_date_anchor
        - periodic_invoice_issuing_date_adjustment
        - payment_provider
        - payment_provider_code
        - provider_customer_id
        - provider_payment_methods
        - document_locale
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        billing_entity_code:
          type: string
          description: Code of the customer billing entity.
          example: main
        external_id:
          type: string
          description: Unique customer identifier in your application.
          example: customer_123
        account_type:
          type: string
          description: Account type.
          example: customer
          enum:
            - customer
            - partner
        name:
          type:
            - string
            - 'null'
          description: Name.
          example: example
        firstname:
          type:
            - string
            - 'null'
          description: Firstname.
          example: example
        lastname:
          type:
            - string
            - 'null'
          description: Lastname.
          example: example
        customer_type:
          type:
            - string
            - 'null'
          description: Type of customer.
          example: company
          enum:
            - company
            - individual
            - null
        sequential_id:
          type:
            - integer
            - 'null'
          description: Sequential id.
          example: 100
        slug:
          type:
            - string
            - 'null'
          description: Slug.
          example: example
        country:
          type:
            - string
            - 'null'
          description: Country.
          example: example
        address_line1:
          type:
            - string
            - 'null'
          description: Address line1.
          example: example
        address_line2:
          type:
            - string
            - 'null'
          description: Address line2.
          example: example
        state:
          type:
            - string
            - 'null'
          description: State.
          example: example
        zipcode:
          type:
            - string
            - 'null'
          description: Zipcode.
          example: example
        email:
          type:
            - string
            - 'null'
          description: Email.
          example: billing@acme.example
        city:
          type:
            - string
            - 'null'
          description: City.
          example: example
        url:
          type:
            - string
            - 'null'
          description: Url.
          example: example
        phone:
          type:
            - string
            - 'null'
          description: Phone.
          example: example
        logo_url:
          type:
            - string
            - 'null'
          description: Logo url.
          example: example
        legal_name:
          type:
            - string
            - 'null'
          description: Legal name.
          example: example
        legal_number:
          type:
            - string
            - 'null'
          description: Legal number.
          example: example
        currency:
          type:
            - string
            - 'null'
          description: Currency as an ISO 4217 code.
          example: USD
        tax_identification_number:
          type:
            - string
            - 'null'
          description: Tax identification number.
          example: example
        timezone:
          type:
            - string
            - 'null'
          description: Timezone.
          example: example
        applicable_timezone:
          type: string
          description: Timezone used for customer billing.
          example: Europe/Paris
        external_salesforce_id:
          type:
            - string
            - 'null'
          description: External salesforce id.
          example: example
        finalize_zero_amount_invoice:
          type: string
          description: Whether invoices with a zero amount are finalized.
          example: inherit
          enum:
            - inherit
            - skip
            - finalize
        skip_invoice_custom_sections:
          type: boolean
          description: Skip invoice custom sections.
          example: false
        invoice_grace_period:
          type:
            - integer
            - 'null'
          description: Invoice grace period.
          example: 1
        periodic_invoice_issuing_date_anchor:
          type:
            - string
            - 'null'
          description: Anchor used to determine the issuing date of periodic invoices.
          example: current_period_end
        periodic_invoice_issuing_date_adjustment:
          type:
            - string
            - 'null'
          description: Adjustment applied to the periodic invoice issuing date.
          example: keep_anchor
        payment_provider:
          type:
            - string
            - 'null'
          description: Payment provider.
          example: example
        payment_provider_code:
          type:
            - string
            - 'null'
          description: Payment provider code.
          example: example
        provider_customer_id:
          type:
            - string
            - 'null'
          description: Customer identifier in the payment provider.
          example: cus_example
        provider_payment_methods:
          type:
            - array
            - 'null'
          description: Payment methods allowed by the provider.
          items:
            type: string
            description: Payment method type.
            example: card
        document_locale:
          type:
            - string
            - 'null'
          description: Document locale.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        x402_agent_address:
          type:
            - string
            - 'null'
          description: Agent address. Present only when x402 payments are enabled.
          example: '0x0000000000000000000000000000000000000000'
    ShippingAddressObject:
      type: object
      description: Shipping address.
      required:
        - address_line1
        - address_line2
        - city
        - zipcode
        - state
        - country
      properties:
        address_line1:
          type:
            - string
            - 'null'
          description: Address line1.
          example: example
        address_line2:
          type:
            - string
            - 'null'
          description: Address line2.
          example: example
        city:
          type:
            - string
            - 'null'
          description: City.
          example: example
        zipcode:
          type:
            - string
            - 'null'
          description: Zipcode.
          example: example
        state:
          type:
            - string
            - 'null'
          description: State.
          example: example
        country:
          type:
            - string
            - 'null'
          description: Country.
          example: FR
    CustomerMetadataObject:
      type: object
      description: Customer Metadata.
      required:
        - lago_id
        - key
        - value
        - display_on_invoice
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        key:
          type: string
          description: Key.
          example: example
        value:
          type: string
          description: Value.
          example: example
        display_on_invoice:
          type: boolean
          description: Whether this value is displayed on invoices.
          example: false
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
    TaxObject:
      type: object
      required:
        - lago_id
        - name
        - code
        - rate
        - description
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          format: uuid
          description: Unique identifier of the tax, created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        name:
          type: string
          description: Name of the tax.
          example: VAT
        code:
          type: string
          description: Unique code of the tax within the organization.
          example: standard_vat
        rate:
          type: number
          description: Percentage rate of the tax, returned as a JSON number.
          example: 20
        description:
          type:
            - string
            - 'null'
          description: Internal description of the tax.
          example: Standard VAT
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          format: date-time
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T09:30:00.123456Z'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            UTC deletion timestamp, with microsecond precision. It is null until
            the tax is deleted.
          example: null
      example:
        lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90
        name: VAT
        code: standard_vat
        rate: 20
        description: Standard VAT
        created_at: '2022-04-29T08:59:51.123456Z'
        updated_at: '2022-04-29T09:30:00.123456Z'
        deleted_at: null
    IntegrationCustomerObject:
      type: object
      description: >-
        Customer mapping to an integration. Provider-specific settings are
        included as additional top-level fields.
      required:
        - lago_id
        - external_customer_id
        - type
        - integration_code
        - code
        - is_default
        - category
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_customer_id:
          type:
            - string
            - 'null'
          description: Customer identifier in the integration.
          example: customer_123
        type:
          type:
            - string
            - 'null'
          description: Integration type.
          example: netsuite
          enum:
            - netsuite
            - anrok
            - avalara
            - xero
            - hubspot
            - salesforce
            - quickbooks
            - null
        integration_code:
          type:
            - string
            - 'null'
          description: Integration code.
          example: anrok
        code:
          type:
            - string
            - 'null'
          description: Mapping code.
          example: default
        is_default:
          type: boolean
          description: Whether this mapping is the default.
          example: false
        category:
          type:
            - string
            - 'null'
          description: Integration category.
          example: payment
          enum:
            - payment
            - tax
            - accounting
            - crm
            - null
      additionalProperties: true
  headers:
    EndpointStatus:
      description: Indicates that the endpoint is in beta.
      schema:
        type: string
        enum:
          - beta
        example: beta
  responses:
    BadRequest:
      description: Invalid request body, pagination or relationship expansion
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: invalid_expand
            details:
              - code: malformed
                field: expands
                meta:
                  allowed_values: []
    Unauthorized:
      description: Missing or invalid API key
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: unauthorized
            details: []
    Forbidden:
      description: Feature unavailable or insufficient API permissions
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: feature_unavailable
            details: []
    NotFound:
      description: Unknown resource or resource from another organization
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: resource_not_found
            details:
              - code: resource_not_found
                field: base
                meta:
                  resource: resource_name
    UnprocessableEntity:
      description: Invalid fields or filters
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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