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

# Update



## OpenAPI

````yaml /openapi.json patch /v0/customers/{id}
openapi: 3.1.0
info:
  title: Paygentic API
  version: 0.1.0
  description: >
    The Paygentic API provides a comprehensive platform for building and scaling
    monetization infrastructure.


    ## Authentication

    All API requests require authentication using an API key passed in the
    `Authorization` header:

    ```

    Authorization: Bearer YOUR_API_KEY

    ```


    ## Base URL

    All API requests should be made to:

    ```

    https://api.paygentic.io/v0

    ```
  contact:
    name: Paygentic Support
    email: support@paygentic.io
  license:
    name: Proprietary
servers:
  - url: https://api.paygentic.io
    description: Production API
  - url: https://api.sandbox.paygentic.io
    description: Sandbox API
security:
  - BearerAuth: []
tags:
  - name: Customers
    description: >-
      A `Customer` is an entity connected to a `Merchant` via a `Subscription`.
      This represents the merchant-facing perspective of `Consumers` who
      purchase their `Products`.
  - name: Billable Metrics
    description: >-
      A `Billable Metric` defines a measurable quantity tied to a `Product`'s
      consumption. Each metric stores details including its label, an
      explanatory description, and measurement units.
  - name: Grants
    description: >-
      Grants credit a customer's metered entitlement balance. Merchants can
      create grants directly or void existing ones.


      Use `GET /v1/entitlements?customerId={id}` or `GET
      /v1/entitlements?subscriptionId={id}` to find the metered entitlement `id`
      needed for these endpoints.
  - name: Features
    description: >-
      A `Feature` represents a specific capability or functionality provided by
      a `Product`. Features can be metered (usage-based), static (fixed
      allocation), or boolean (enabled/disabled).
  - name: Fees
    description: >-
      A `Fee` defines a recurring or one-time charge tied to a `Product`. Fees
      are linked to prices, and cadence is defined on the Price.
  - name: Plans
    description: >-
      A `Plan` links a collection of `Prices` to a `Product`. It functions as a
      pricing structure document for a particular feature set or service
      offering.
  - name: Prices
    description: >-
      A `Price` determines the monetary value for a single unit of a `Billable
      Metric`. Prices are exclusively grouped within a `Plan`.
  - name: Products
    description: >-
      A `Product` is an offering sold by a `Merchant`. It includes product
      metadata like title, summary, and pricing details. `Plans`, `Prices`, and
      `Subscriptions` are all associated with products.
  - name: Sources
    description: >-
      A `Source` is an external data provider capable of automatically creating
      usage events. Configuration occurs at the plan level, enabling data
      retrieval from third-party platforms such as Stripe to produce billable
      events.
  - name: Subscriptions
    description: >-
      A `Subscription` is a customer's commitment to purchase a `Product`
      following the terms of a `Plan` and its linked `Prices`.
  - name: Users
    description: >-
      A `User` is an entity granted access to an Organization's resources. All
      operations are performed by users.
  - name: Invoices V2
    description: >-
      Invoice V2 operations supporting billing cycles organized by time periods.
      Warning: v0 invoice endpoints are no longer supported.
  - name: Revenue
    description: Revenue data from invoices and payments
  - name: Profitability
    description: Per-customer profitability summaries
  - name: Test Clocks
    description: >-
      Test clocks provide programmable time control to simulate subscription and
      billing scenarios during testing.
  - name: Events
    description: Ingest raw metering events that are processed by the meters service.
  - name: Payments
    description: >-
      Create and manage one-off payments. A payment represents a single charge
      that a merchant wants to collect from a customer.
  - name: Payment Sessions
    description: >-
      Handle payment session lifecycle and processing across various entity
      types including invoices and subscriptions
  - name: Costs
    description: >-
      A Cost represents the operational or infrastructure expense of serving
      customers for a given product. Costs are metered (driven by event-based
      usage) and are tracked in parallel with billable metrics to give merchants
      visibility into both revenue and cost per customer.
  - name: ExternalReferences
    description: >-
      An `ExternalReference` links a Paygentic entity (e.g. an `Item`) to a
      record in an external system such as Salesforce or NetSuite. Multiple
      external records may map to the same Paygentic entity, but each external
      id is the *primary* reference of at most one entity per merchant.
  - name: Items
    description: >-
      An `Item` is the canonical "thing you sell" that external-system mappings
      point at. It is fully decoupled from the billing `Product` and holds no
      pricing/plan/metering, and it is CRM/ERP agnostic — which providers map to
      it lives entirely in its `ExternalReference` rows.
  - name: MerchantIntegrations
    description: >-
      A `MerchantIntegration` records a merchant's connection to an external
      provider. One connection per `(merchant, provider)` — re-connecting
      upserts in place.
  - name: Approvals
    description: Submit, decide, cancel, and read maker-checker approvals.
  - name: Orders
    description: Manage Orders, their line items, and billing schedules.
  - name: Billing Schedules
    description: >-
      Owner-polymorphic billing schedules with intervals and staged invoice
      projections. A BillingSchedule belongs to exactly one Order or one
      Subscription (XOR). Cadence lives on ScheduleIntervals
      (cadence-on-the-line).
paths:
  /v0/customers/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: The unique identifier of the customer.
        schema:
          $ref: '#/components/schemas/CustomerId'
    patch:
      tags:
        - Customers
      summary: Update
      operationId: updateCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                taxId:
                  type: string
                  nullable: true
                  description: >-
                    Business tax registration identifier. Sample values:
                    'GB123456789' for UK VAT, 'DE123456789' for German VAT,
                    'FR12345678901' for French VAT. Enables inter-company tax
                    handling and exemption from standard tax collection. Assign
                    null to delete the identifier.
                externalId:
                  type: string
                  nullable: true
                  maxLength: 255
                  description: >-
                    Merchant-defined identifier for this customer in their own
                    system. Set to null to clear.
                taxRates:
                  oneOf:
                    - type: number
                      description: >-
                        Single tax rate percentage applied across all plans and
                        metrics. Sample values: '8.5' represents 8.5% tax rate,
                        '12.1' represents 12.1% tax rate, '0' represents no tax
                      minimum: 0
                      maximum: 100
                    - $ref: '#/components/schemas/TaxRates'
                notificationSettings:
                  type: object
                  description: >-
                    Notification preferences for this customer. Only provided
                    fields are updated.
                  properties:
                    invoiceIssued:
                      type: boolean
                      description: Whether to send invoice issued emails to this customer.
                    invoicePaid:
                      type: boolean
                      description: Whether to send invoice paid emails to this customer.
                    renewalReminder:
                      type: boolean
                      description: >-
                        Whether to send renewal reminder emails to this
                        customer.
      responses:
        '200':
          description: Customer updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
              example:
                id: cus_n5o6p7q8r9s0t1u2
                object: customer
                consumerId: org_v3w4x5y6z7a8b9c0
                createdAt: '2024-01-20T09:15:00Z'
                merchantId: org_d1e2f3g4h5i6j7k8
                taxId: GB123456789
                taxRates:
                  default: 10
                updatedAt: '2024-03-12T16:30:00Z'
                validTaxAddress:
                  message: null
                  valid: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            Conflict. A customer with this externalId already exists for this
            merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CustomerId:
      type: string
      pattern: ^cus_[a-zA-Z0-9]+$
      description: Unique identifier for a customer
    TaxRates:
      type: object
      description: >-
        An object mapping plan IDs, metric IDs, or 'default' to a tax rate
        percentage (e.g., 13 for 13%)
      additionalProperties:
        type: number
        minimum: 0
        maximum: 100
    Customer:
      type: object
      required:
        - id
        - object
        - consumerId
        - merchantId
        - createdAt
        - updatedAt
        - validTaxAddress
      properties:
        id:
          $ref: '#/components/schemas/CustomerId'
        object:
          type: string
          enum:
            - customer
          default: customer
        consumerId:
          $ref: '#/components/schemas/OrganizationId'
        createdAt:
          type: string
          format: date-time
        merchantId:
          $ref: '#/components/schemas/OrganizationId'
        organization:
          type: object
          required:
            - id
            - name
          properties:
            id:
              type: string
            address:
              $ref: '#/components/schemas/Address'
            billingEmails:
              type: array
              items:
                type: string
                format: email
            name:
              type: string
            phone:
              type: string
        taxId:
          type: string
          description: >-
            Business tax registration identifier. Sample values: 'GB123456789'
            for UK VAT, 'DE123456789' for German VAT, 'FR12345678901' for French
            VAT. Enables inter-company tax handling and exemption from standard
            tax collection.
        externalId:
          type: string
          maxLength: 255
          description: Merchant-defined identifier for this customer in their own system.
        taxRates:
          $ref: '#/components/schemas/TaxRates'
        updatedAt:
          type: string
          format: date-time
        validTaxAddress:
          $ref: '#/components/schemas/ValidTaxAddress'
        notificationSettings:
          type: object
          required:
            - invoiceIssued
            - invoicePaid
            - renewalReminder
          properties:
            invoiceIssued:
              type: boolean
              description: Whether to send invoice issued emails to this customer.
            invoicePaid:
              type: boolean
              description: Whether to send invoice paid emails to this customer.
            renewalReminder:
              type: boolean
              description: Whether to send renewal reminder emails to this customer.
    Error:
      type: object
      required:
        - message
      properties:
        error:
          type: string
          description: >-
            Coarse HTTP error category (e.g. 'bad_request', 'forbidden'). Maps
            to the HTTP status code.
        message:
          type: string
          description: >-
            Human-readable error message. Clients must not parse this field
            programmatically.
        code:
          type: string
          examples:
            - TAX_NOT_ENABLED
            - PAYMENT_SESSION_EXPIRED
          description: >-
            Optional semantic business error code for machine-readable
            discrimination (e.g. 'TAX_NOT_ENABLED'). UPPER_SNAKE_CASE. Clients
            should check this field, not message.
        details:
          type: object
          description: Additional error details
          additionalProperties: true
      example:
        message: The requested resource was not found
        error: not_found
    OrganizationId:
      type: string
      pattern: ^org_[a-zA-Z0-9]+$
      description: Unique identifier for an organization
    Address:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
          minLength: 2
          maxLength: 2
          description: 2 character ISO 3166 country code
        zipCode:
          type: string
    ValidTaxAddress:
      type: object
      required:
        - valid
      properties:
        message:
          type: string
          description: >-
            Validation message if address is invalid. Sample values: 'Country is
            required for tax calculation', 'Invalid postal code format',
            'State/province required for this country'
        valid:
          type: boolean
          description: >-
            Whether the consumer address is valid for tax calculation when using
            Paygentic Tax
      description: >-
        Indicates whether the consumer address is valid for tax calculation when
        using Paygentic Tax. If valid=false, tax calculation will be skipped and
        internal invoice flow with default tax rate will be used.
    ValidationError:
      type: object
      required:
        - message
        - errors
      properties:
        error:
          type: string
          enum:
            - validation_error
          default: validation_error
          description: Error type indicating validation failure
        message:
          type: string
          description: Human-readable error message
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                description: The field that failed validation
              message:
                type: string
                description: Validation error message for this field
              code:
                type: string
                description: Validation error code
            required:
              - field
              - message
          description: Array of field-specific validation errors
      example:
        message: Validation failed
        error: validation_error
        errors:
          - field: email
            message: Invalid email format
            code: invalid_format
  responses:
    BadRequest:
      description: >-
        Bad Request - The request could not be understood or was missing
        required parameters
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/ValidationError'
    Unauthorized:
      description: Unauthorized - Authentication failed or user does not have permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden - Request is understood but refused
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found - The requested resource could not be found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error - Something went wrong on the server side
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key authentication

````