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

# Create product



## OpenAPI

````yaml POST /products/
openapi: 3.0.3
info:
  title: Piriod API
  version: 1.0.0
  description: >
    Piriod API for billing, payments, procurement and collections.


    All requests require:

    - `Authorization: Token <api_token>` header.

    - `x-simple-workspace: <workspace_id>` header (the account/workspace
    identifier).

    - Optionally `x-piriod-test-mode: true` to operate against test-mode data.


    See the Documentation tab for getting started, integration flows,
    authentication,

    error handling and pagination/filtering guides.
servers:
  - url: https://api.piriod.com
    description: Production
security:
  - TokenAuth: []
paths:
  /products/:
    post:
      tags:
        - Billing
      summary: Create product
      parameters:
        - $ref: '#/components/parameters/WorkspaceHeader'
        - $ref: '#/components/parameters/TestModeHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Product'
      responses:
        '201':
          description: Product created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/ValidationFailed'
components:
  parameters:
    WorkspaceHeader:
      name: x-simple-workspace
      in: header
      required: true
      schema:
        type: string
      description: Workspace (account) identifier. Required for every request.
      example: acc_01H8XYZ123ABC
    TestModeHeader:
      name: x-piriod-test-mode
      in: header
      required: false
      schema:
        type: boolean
        default: false
      description: Whether to operate against test-mode data. Defaults to `false`.
  schemas:
    Product:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
          maxLength: 80
        unit_label:
          type: string
          maxLength: 12
        status:
          type: string
          enum:
            - active
            - archived
          default: active
        archived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
        plans:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/Plan'
        test_mode:
          type: boolean
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        updated:
          type: string
          format: date-time
          readOnly: true
      required:
        - name
        - unit_label
    Plan:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        product:
          type: string
          description: Product ID.
        sku:
          type: string
          maxLength: 32
          nullable: true
        name:
          type: string
          maxLength: 56
        description:
          type: string
          maxLength: 200
        frequency:
          type: string
          description: Frequency ID (e.g. `monthly`).
        currency:
          type: string
          description: ISO currency code.
        amount:
          type: number
        exempt:
          type: boolean
          default: false
        usage_scheme:
          type: string
          enum:
            - licensed
            - metered
          default: licensed
        usage_aggregation:
          type: string
          enum:
            - last_record
            - max
            - sum
          nullable: true
        tiers_mode:
          type: string
          enum:
            - package
            - volume
            - graduated
            - package_overage
            - unit
            - range
          nullable: true
          description: |
            Pricing mode for tiered plans. `unit` and `range` are deprecated
            aliases of `volume` and `package` respectively.
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/PlanTier'
        unit_label:
          type: string
          maxLength: 4
          nullable: true
        status:
          type: string
          enum:
            - active
            - archived
          default: active
        archived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        updated:
          type: string
          format: date-time
          readOnly: true
      required:
        - product
        - name
        - description
        - frequency
        - currency
        - amount
    ValidationError:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      description: |
        Field-keyed error map. The special key `non_field_errors` carries
        errors that are not bound to a specific field.
      example:
        name:
          - This field is required.
        non_field_errors:
          - x-simple-workspace header is required.
    PlanTier:
      type: object
      properties:
        amount:
          type: number
        amount_scheme:
          type: string
          enum:
            - flat
            - per_unit
          default: flat
        quantity_from:
          type: integer
        quantity_to:
          type: integer
          nullable: true
        unit_scheme:
          type: string
          enum:
            - all_units
            - tier_units
            - overage
          nullable: true
      required:
        - amount
        - quantity_from
  responses:
    ValidationFailed:
      description: Request body or query parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |
        Use header `Authorization: Token <api_token>`.
        API tokens are obtained from the Piriod dashboard.

````