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

# Create a price

> Creates a price for a product. Requires internal-user privileges. The product must already exist, and the price must be unique within the product (a recurring price is unique by amount, currency, and interval; a one-time price is unique by amount and currency).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/prices
openapi: 3.0.0
info:
  contact: {}
  title: Assembly API
  version: 0.0.1
servers:
  - url: https://api.assembly.com
security: []
paths:
  /v1/prices:
    post:
      tags:
        - Prices
      summary: Create a price
      description: >-
        Creates a price for a product. Requires internal-user privileges. The
        product must already exist, and the price must be unique within the
        product (a recurring price is unique by amount, currency, and interval;
        a one-time price is unique by amount and currency).
      operationId: create-a-price
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/price.CreatePriceInput'
        description: Price to create
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/price.Price'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: >-
            Invalid request body, unknown product, invalid billing period, or
            negative amount
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: A matching price already exists for the product
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Unexpected server error
      security:
        - APIKeyHeader: []
components:
  schemas:
    price.CreatePriceInput:
      properties:
        amount:
          description: >-
            Amount is the price amount in the currency's smallest unit (e.g.
            cents).
          example: 5000
          type: integer
        currency:
          default: usd
          description: Currency is the ISO currency code.
          example: usd
          type: string
        interval:
          allOf:
            - $ref: '#/components/schemas/billingutils.BillingPeriodType'
          description: Interval is the billing period for recurring prices.
          enum:
            - day
            - week
            - month
            - quarterly
            - biannually
            - year
            - semiannually
          example: month
        intervalCount:
          description: IntervalCount is the number of intervals between billings.
          example: 1
          type: integer
        productId:
          description: ProductId is the product this price belongs to.
          example: d1f8c9e2-3b4a-4c5d-9e6f-7a8b9c0d1e2f
          format: uuid
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/price.PriceType'
          description: Type is whether the price is one-time or recurring.
          enum:
            - oneTime
            - recurring
          example: recurring
      required:
        - amount
        - productId
      type: object
    price.Price:
      properties:
        amount:
          description: >-
            Amount is the price amount in the smallest currency unit (e.g.
            cents).
          example: 5000
          type: integer
        createdAt:
          type: string
        creatorId:
          type: string
        currency:
          default: usd
          description: >-
            Currency is the ISO-4217 currency code. Defaults to usd when
            omitted.
          example: usd
          type: string
        data:
          type: string
        id:
          type: string
        identityId:
          type: string
        interval:
          allOf:
            - $ref: '#/components/schemas/billingutils.BillingPeriodType'
          description: Interval is the recurring billing period. Omit for one-time prices.
          enum:
            - day
            - week
            - month
            - quarterly
            - biannually
            - year
            - semiannually
          example: month
        intervalCount:
          description: >-
            IntervalCount is the number of intervals between billings for a
            recurring price.
          example: 1
          nullable: true
          type: integer
        isUsed:
          description: >-
            IsUsed indicates whether the price is already referenced by a
            subscription or invoice and therefore cannot be deleted.
          example: false
          type: boolean
        object:
          type: string
        portalId:
          description: PortalID is the ID of the portal that owns this price.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
          type: string
        previousAttributes:
          additionalProperties: true
          type: object
        productId:
          description: ProductId is the ID of the product this price belongs to.
          example: d1f8c9e2-3b4a-4c5d-9e6f-7a8b9c0d1e2f
          format: uuid
          type: string
        ref:
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/price.PriceType'
          description: >-
            Type is a computed field and should not be used in any logic on BE
            or Webapp
          enum:
            - oneTime
            - recurring
          example: recurring
        updatedAt:
          type: string
      type: object
    dispatcher.Error:
      properties:
        code:
          type: string
        data: {}
        message:
          type: string
      type: object
    billingutils.BillingPeriodType:
      enum:
        - day
        - week
        - month
        - quarterly
        - biannually
        - year
        - semiannually
      type: string
      x-enum-varnames:
        - BillingPeriodTypeDay
        - BillingPeriodTypeWeek
        - BillingPeriodTypeMonth
        - BillingPeriodTypeQuarter
        - BillingPeriodTypeBiannual
        - BillingPeriodTypeYear
        - BillingPeriodTypeSemiAnnually
    price.PriceType:
      enum:
        - oneTime
        - recurring
      type: string
      x-enum-varnames:
        - PriceTypeOneTime
        - PriceTypeRecurring
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-KEY
      type: apiKey

````