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

# 创建价格

> Create a price for an existing product under your current merchant account.



## OpenAPI

````yaml POST /price
openapi: 3.1.0
info:
  title: Clink API
  description: >-
    Official API documentation for Clink's payment processing platform. This API
    enables merchants to create and manage payment sessions, handle
    subscriptions, and process transactions.
  version: 1.0.0
servers:
  - url: https://uat-api.clinkbill.com/api/
security:
  - ApiKeyAuth: []
paths:
  /price:
    post:
      summary: Create Price
      description: >-
        Create a price for an existing product under your current merchant
        account.
      operationId: createPrice
      parameters:
        - $ref: '#/components/parameters/TimestampHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceCreateApiRequest'
            examples:
              recurringPrice:
                summary: Recurring price
                value:
                  productId: prd_xxxxx
                  currency: USD
                  unitAmount: 29.99
                  priceType: recurring
                  recurringDetails:
                    interval: month
                    intervalCount: 1
                    trialPeriodDays: 7
                    pricingModel: flat_rate
                  isDefaultPrice: true
              oneTimePrice:
                summary: One-time price
                value:
                  productId: prd_xxxxx
                  currency: USD
                  unitAmount: 19.99
                  priceType: one_time
      responses:
        '200':
          description: Price created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RPriceApiVo'
            '*/*':
              schema:
                $ref: '#/components/schemas/RPriceApiVo'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                type: string
components:
  parameters:
    TimestampHeader:
      name: X-Timestamp
      in: header
      required: true
      description: >-
        Current timestamp in milliseconds since Unix epoch (required for request
        signing)
      schema:
        type: string
        example: '1783513683000'
  schemas:
    PriceCreateApiRequest:
      type: object
      description: Parameters required to create a price by API
      required:
        - productId
        - currency
        - unitAmount
        - priceType
      properties:
        productId:
          type: string
          description: Unique identifier of the product
        currency:
          type: string
          description: Three-letter ISO currency code
          enum:
            - USD
            - EUR
            - JPY
            - GBP
            - AUD
            - CAD
            - CNY
            - HKD
            - SGD
            - KRW
            - AED
            - THB
            - IDR
            - PHP
            - MYR
            - BRL
            - INR
        unitAmount:
          type: number
          description: Unit amount for one-time or recurring base price
          example: 29.99
        priceType:
          type: string
          description: Price type
          enum:
            - one_time
            - recurring
        recurringDetails:
          $ref: '#/components/schemas/RecurringDetails'
        priority:
          type: integer
          format: int32
          description: Regional pricing priority. Lower values have higher priority.
        isDefaultPrice:
          type: boolean
          description: Whether this price should be the product default price
    RPriceApiVo:
      type: object
      properties:
        code:
          type: integer
          description: Response status code, 200 when success
          format: int32
        msg:
          type: string
          description: Brief description of what happened, 'success' when happy case
        data:
          $ref: '#/components/schemas/PlatformPriceApiVo'
      description: Body of the response message
    RecurringDetails:
      type: object
      properties:
        interval:
          type: string
          description: >-
            Units used per subscription period. Supported values: day, week,
            month, year, quarter, half_year, custom.
          enum:
            - day
            - week
            - month
            - year
            - quarter
            - half_year
            - custom
          refType: null
        trialPeriodDays:
          type: integer
          description: Number of days customers can use for free
          format: int32
          refType: null
        pricingModel:
          type: string
          description: The pricing model used for this subscription
          enum:
            - flat_rate
            - per_seat
            - tiered
            - usage_based
          refType: null
        transformQuantity:
          $ref: '#/components/schemas/TransformQuantity'
          refType: TransformQuantity
        intervalCount:
          type: integer
          description: >-
            Number of interval units per billing cycle. For custom intervals,
            this value represents the number of days.
          format: int32
          refType: null
      description: Details of the Subscription
    PlatformPriceApiVo:
      type: object
      properties:
        priceId:
          type: string
          description: Unique identifier of the price
          refType: null
        priceSnapshotId:
          type: string
          description: >-
            Current active price snapshot ID. Returns null when no active
            snapshot exists.
          refType: null
        productId:
          type: string
          description: Unique identifier of the product
          refType: null
        currency:
          type: string
          description: ISO currency code for subscription pricing
          enum:
            - USD
            - EUR
            - JPY
            - GBP
            - AUD
            - CAD
            - CNY
            - HKD
            - SGD
            - KRW
            - AED
            - THB
            - IDR
            - PHP
            - MYR
            - BRL
            - INR
          refType: null
        unitAmount:
          type: number
          description: Per-unit price amount
          refType: null
        priceType:
          type: string
          description: the type of the price
          enum:
            - one_time
            - recurring
          refType: null
        recurring:
          $ref: '#/components/schemas/RecurringDetails'
          refType: RecurringDetails
        active:
          type: boolean
          description: Is it available for purchase
          refType: null
        createTime:
          type: integer
          description: Unix timestamp when the price was created
          format: int64
          refType: null
    TransformQuantity:
      type: object
      properties:
        divideBy:
          type: integer
          description: Unit conversion ratio, such as converted at 1024
          format: int32
          refType: null
        round:
          type: string
          description: After division, round the result up or down
          enum:
            - up
            - down
            - ceiling
            - floor
            - half_up
            - half_down
            - half_even
            - unnecessary
          refType: null
      description: Define the rules for converting this unit
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your secret API key obtained from the Clink dashboard (Developers
        section)

````