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

# Create a product

> Creates a new product. Products are the billable unit on subscription items and define whether pricing is fixed or metered, the payment terms, the billing frequency, the SKU for downstream ERP systems, and the revenue allocation method. Metered products must be associated with one or more metrics.



## OpenAPI

````yaml /api-reference/specs/2026-04-01.json post /products
openapi: 3.1.0
info:
  description: >-
    Alguna is the AI-native quote-to-revenue platform for B2B companies: CPQ,
    subscription and usage-based billing, invoicing, payment collection, and
    revenue recognition in one system of record. The API operates on one
    versioned agreement per customer: quotes, subscriptions and their versions,
    usage, invoices, payments, and revenue schedules read from it. Official
    SDKs: TypeScript (@alguna/sdk), Python (alguna), Go
    (github.com/alguna-io/alguna-go), Rust (alguna), and the alguna CLI
    (@alguna/cli).
  title: Alguna Public API
  version: '2026-04-01'
servers:
  - url: https://api.alguna.io
    x-fern-server-name: Production
security:
  - bearerAuth: []
tags:
  - name: Billing Events and Metrics
  - name: Checkout Sessions
  - name: Credit Notes
  - name: Credits
  - name: Customer Portal Sessions
  - name: Customers
  - name: Feedback
  - name: Insights
  - name: Integrations
  - name: Invoices
  - name: Merchants
  - name: Payments
  - name: Plans
  - name: Product Bundles
  - name: Products
  - name: Quotes
  - name: Refunds
  - name: Revenue Schedules
  - name: Subscription Changes
  - name: Subscription Versions
  - name: Subscriptions
  - name: Tags
  - name: Tax
  - name: Users
  - name: Wallet Grants
  - name: Wallets
paths:
  /products:
    post:
      tags:
        - Products
      summary: Create a product
      description: >-
        Creates a new product. Products are the billable unit on subscription
        items and define whether pricing is fixed or metered, the payment terms,
        the billing frequency, the SKU for downstream ERP systems, and the
        revenue allocation method. Metered products must be associated with one
        or more metrics.
      operationId: create-product
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
        - in: header
          name: Idempotency-Key
          schema:
            description: >-
              A unique string that makes a retried write safe. If you send the
              same request with the same key within 24 hours, the API returns
              the stored response and does not run the request again. A 5xx or
              429 response is not stored, so a retry with that key runs the
              request again.
            example: ik_a1b2c3d4e5f6
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
          description: Success
          headers:
            Idempotency-Key:
              description: Echo of the idempotency key provided in the request
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                Whether this response was replayed from a previous request
                (true) or freshly executed (false)
              schema:
                type: boolean
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/GatewayErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden — the organization does not have access to this feature
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Conflict — a request with this idempotency key is currently being
            processed
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying with the same idempotency key.
                Sent only when a request with this key is still being processed;
                a 409 without it is a conflict that a retry will not resolve.
              schema:
                type: integer
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '502':
          description: >-
            Bad Gateway — sent by the infrastructure in front of the API; the
            body is not JSON. Safe to retry.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Service Unavailable — a dependency is temporarily unavailable. Retry
            with backoff.
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Gateway Timeout — the request did not finish in time. Retry with
            backoff; use an idempotency key for writes.
components:
  schemas:
    CreateProductRequest:
      properties:
        billing_frequency:
          allOf:
            - $ref: '#/components/schemas/BillingFrequency'
          description: >-
            How often the product is billed. Required for fixed products;
            metered products are always recurring
          example: recurring
          nullable: true
        description:
          description: A brief description of the product
          example: Monthly platform access fee
          type: string
        fee_type:
          allOf:
            - $ref: '#/components/schemas/PricingClass'
          description: Whether the product is fixed-price or usage-based
          example: fixed
        metric_ids:
          description: Identifiers for metrics to associate with a metered product
          items:
            type: string
          type: array
        name:
          description: The name of the product
          example: Platform Fee
          type: string
        payment_terms:
          allOf:
            - $ref: '#/components/schemas/BillingDirection'
          description: >-
            When the product is billed relative to the billing period. Metered
            products must be billed in arrears
          example: arrears
        revenue_allocation_method:
          allOf:
            - $ref: '#/components/schemas/RevenueAllocationMethod'
          description: How revenue is allocated across time periods within a billing cycle
          example: straight_line
          nullable: true
        sku:
          description: >-
            Stock keeping unit code used in external ERP or revenue recognition
            systems
          example: PLATFORM_FEE
          nullable: true
          type: string
        tag_ids:
          description: Identifiers for tags to associate with this product
          items:
            type: string
          type: array
        tax_code:
          description: >-
            Canonical (provider-neutral) tax code. Omit for 'general'
            (standard-rated).
          example: txcd_business_saas
          nullable: true
          type: string
        unit_label_plural:
          description: >-
            Custom plural term for multiple units of the product (e.g. 'API
            calls'). Falls back to 'units' when omitted
          example: API calls
          nullable: true
          type: string
        unit_label_singular:
          description: >-
            Custom singular term for one unit of the product (e.g. 'API call').
            Falls back to 'unit' when omitted
          example: API call
          nullable: true
          type: string
      required:
        - fee_type
        - name
        - payment_terms
      type: object
    ProductResponse:
      properties:
        billing_frequency:
          allOf:
            - $ref: '#/components/schemas/BillingFrequency'
          description: How often the product is billed
          example: recurring
          nullable: true
        created_at:
          description: Timestamp when the product was created
          example: '2026-04-01T10:00:00Z'
          format: date-time
          type: string
        description:
          description: A brief description of the product
          example: Monthly platform access fee
          type: string
        fee_type:
          allOf:
            - $ref: '#/components/schemas/PricingClass'
          description: Whether the product is fixed-price or usage-based
          example: fixed
        id:
          description: Unique identifier for the product
          example: prod_01H1VECT
          type: string
        metric_ids:
          description: Identifiers for associated metrics. Applicable for metered products
          example:
            - mtr_01H2ABC
          items:
            type: string
          type: array
        name:
          description: The name of the product
          example: Platform Fee
          type: string
        payment_terms:
          allOf:
            - $ref: '#/components/schemas/BillingDirection'
          description: When the product is billed relative to the billing period
          example: arrears
        revenue_allocation_method:
          allOf:
            - $ref: '#/components/schemas/RevenueAllocationMethod'
          description: How revenue is allocated across time periods within a billing cycle
          example: straight_line
        sku:
          description: >-
            Stock keeping unit code used in external ERP or revenue recognition
            systems
          example: PLATFORM_FEE
          nullable: true
          type: string
        tag_ids:
          description: Identifiers for tags associated with this product
          example:
            - tag_01H3DEF
          items:
            type: string
          type: array
        tax_code:
          description: Canonical (provider-neutral) tax code; omitted behaves as 'general'
          example: saas
          nullable: true
          type: string
        unit_label_plural:
          description: >-
            Custom plural term for multiple units of the product (e.g. 'API
            calls'). Falls back to 'units' when omitted
          example: API calls
          nullable: true
          type: string
        unit_label_singular:
          description: >-
            Custom singular term for one unit of the product (e.g. 'API call').
            Falls back to 'unit' when omitted
          example: API call
          nullable: true
          type: string
        updated_at:
          description: Timestamp when the product was last updated
          example: '2026-04-01T12:30:00Z'
          format: date-time
          type: string
      required:
        - created_at
        - description
        - fee_type
        - id
        - name
        - payment_terms
        - revenue_allocation_method
        - updated_at
      type: object
    ErrorResponse:
      description: The body of every error the API returns.
      properties:
        code:
          description: >-
            Machine-readable error code, such as `not_found` or
            `invoice_already_issued`. New codes may be added at any time, so
            handle a code you do not know by its HTTP status.
          type: string
        detail:
          description: Explanation of what went wrong
          type: string
        request_id:
          description: >-
            Identifies the request, as the `X-Request-Id` response header does.
            Quote it when contacting support.
          type: string
        status:
          description: HTTP status code of the response
          format: int64
          type: integer
        title:
          description: >-
            HTTP status text. Sent only by version, idempotency and
            credit-refusal errors.
          type: string
        type:
          description: Always `about:blank`. Sent only by version and idempotency errors.
          type: string
      required:
        - status
        - detail
      type: object
    GatewayErrorResponse:
      description: >-
        Returned by the API gateway when a request carries no valid API key,
        before the API handles it.
      properties:
        code:
          description: Machine-readable error code, e.g. `unauthenticated`
          type: string
        details:
          nullable: true
          type: object
        message:
          description: Explanation of what went wrong
          type: string
      required:
        - code
        - message
      type: object
    BillingFrequency:
      enum:
        - recurring
        - one-off
      type: string
    PricingClass:
      enum:
        - fixed
        - metered
      type: string
    BillingDirection:
      enum:
        - advance
        - arrears
      type: string
    RevenueAllocationMethod:
      enum:
        - straight_line
        - usage_based
        - contract_level_straight_line
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http
      x-fern-bearer:
        env: ALGUNA_API_KEY
        name: apiKey

````

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