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

# Create package



## OpenAPI

````yaml /api-reference/openapi.json post /package/create
openapi: 3.1.0
info:
  title: BillingServ API V2
  description: >-
    Resources and tools for developers to integrate with the BillingServ v2 API.
    v1 is deprecated; use the v2 base URL and bearer-token authentication unless
    an endpoint states otherwise.
  version: '2.0'
servers:
  - url: https://demo.onlinebillingform.com/api/v2
    description: BillingServ demo API
security:
  - bearerAuth: []
tags:
  - name: Customer
  - name: Package
  - name: Group
  - name: Country
  - name: County
  - name: VPN
  - name: Invoice
  - name: Order
  - name: Module
  - name: Report
  - name: Marketing
  - name: Setting
  - name: Checkout
  - name: Usage
  - name: Support
  - name: Licensing
  - name: Webhooks
    description: Outbound events sent by BillingServ to a configured customer endpoint.
paths:
  /package/create:
    post:
      tags:
        - Package
      summary: Create package
      operationId: POST_package_create
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                group_id:
                  type: integer
                name:
                  type: string
                description:
                  type: string
                tax:
                  type: number
                url:
                  type: string
                prorate:
                  type: string
                  enum:
                    - 'Y'
                    - 'N'
                trial:
                  type: string
                options:
                  type: array
                  items:
                    type: string
                keep:
                  type: array
                  items:
                    type: string
                files:
                  type: string
                  format: binary
                product_images:
                  type: string
                  format: binary
                cycle.cycle:
                  type: array
                  items:
                    type: string
                cycle.price:
                  type: array
                  items:
                    type: string
                cycle.setup:
                  type: array
                  items:
                    type: string
                featured:
                  type: string
                  enum:
                    - '0'
                    - '1'
                upgrade_paths:
                  type: array
                  items:
                    type: string
                cycle.id:
                  type: array
                  items:
                    type: string
                upgrade_paths.*.target_package_id:
                  type: integer
                  description: Target package id for upgrade path
                upgrade_paths.*.sort_order:
                  type: array
                  items:
                    type: string
                  description: Optional upgrade path sort order
                theme:
                  type: integer
                  enum:
                    - 1
                    - 2
                  description: >-
                    Order page theme: 1 = ecommerce view, 2 = simple. Defaults
                    to 2 on create.
                qty:
                  type: integer
                  minimum: 0
                  description: Stock quantity
                is_outofstock:
                  type: string
                  enum:
                    - '0'
                    - '1'
                  description: Whether the package is marked out of stock
                digital_delivery:
                  $ref: '#/components/schemas/DigitalDeliverySettings'
                  description: >-
                    For multipart clients, send nested fields using bracket
                    notation such as `digital_delivery[delivery_enabled]`.
              additionalProperties: true
              required:
                - group_id
                - name
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
              example:
                success: true
                digital_delivery:
                  delivery_enabled: true
                  download_policy: cap_limited
                  max_downloads: 5
                  link_expiry_hours: null
                  ip_locked: true
                  watermark_pdfs: true
                  licensing_enabled: true
                  activation_limit: 1
                  customer_license_management: true
                  maximum_reissues: 3
                  enforce_domain: true
                  enforce_ip: false
                  enforce_installation_path: true
                  license_key_prefix: APP
                  license_key_length: 20
                  offline_cache_minutes: 5
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                errors: Invalid API Key
        '403':
          description: Authenticated key does not have permission for this endpoint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                errors: Insufficient permissions for this endpoint.
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
              example:
                success: false
                errors:
                  id:
                    - The id field is required.
      security:
        - bearerAuth: []
components:
  schemas:
    DigitalDeliverySettings:
      type: object
      description: >-
        Digital download and software licensing configuration for the package.
        Omitted properties are normalized to their documented defaults.
      properties:
        delivery_enabled:
          type: boolean
          default: false
        download_policy:
          type: string
          enum:
            - open
            - cap_limited
            - time_limited
          default: open
        max_downloads:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Used when `download_policy` is `cap_limited`.
        link_expiry_hours:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            Hours after the first download; used when `download_policy` is
            `time_limited`.
        ip_locked:
          type: boolean
          readOnly: true
          description: Always enabled by the server when digital downloads are enabled.
        watermark_pdfs:
          type: boolean
          default: false
        licensing_enabled:
          type: boolean
          default: false
        activation_limit:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Null permits unlimited installations.
        customer_license_management:
          type: boolean
          default: false
        maximum_reissues:
          type:
            - integer
            - 'null'
          minimum: 1
          description: >-
            Maximum customer-initiated reissues; null permits unlimited
            reissues.
        enforce_domain:
          type: boolean
          default: true
        enforce_ip:
          type: boolean
          default: false
        enforce_installation_path:
          type: boolean
          default: true
        license_key_prefix:
          type: string
          maxLength: 12
          pattern: ^[A-Za-z0-9]*$
        license_key_length:
          type: integer
          minimum: 12
          maximum: 64
          default: 20
        offline_cache_minutes:
          type: integer
          minimum: 1
          maximum: 1440
          default: 5
      additionalProperties: false
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errors:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
            - type: object
              additionalProperties: true
      additionalProperties: true
    ValidationErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errors:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
              additionalProperties: true
            - type: string
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Use `Authorization: Bearer <live_api_key>`.'

````