# Update a price

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/prices/{id}:
    post:
      summary: Update a price
      deprecated: false
      description: >+
        Updates the specified price by setting the values of the parameters
        passed. Any parameters not provided are left unchanged.

      tags:
        - API Reference/Prices
      parameters:
        - name: id
          in: path
          description: ''
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                  description: >-
                    Whether the price can be used for new purchases. Defaults to
                    true.
                metadata:
                  type: string
                  description: 'Set of key-value pairs that you can attach to an object. '
                nickname:
                  type: string
                  description: A brief description of the price, hidden from customers.
                lookup_key:
                  type: string
                  description: >-
                    A lookup key used to retrieve prices dynamically from a
                    static string. This may be up to 200 characters.
              x-apifox-orders:
                - active
                - metadata
                - nickname
                - lookup_key
              x-apifox-ignore-properties: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apifox-refs:
                  01GMQ4FT84ESB18AS6GN1AWVKF:
                    $ref: '#/components/schemas/Price'
                    x-apifox-overrides:
                      unit_amount_decimal: null
                      transform_quantity: null
                      tiers_mode: null
                      tax_behavior: null
                      recurring: null
                      custom_unit_amount: null
                x-apifox-orders:
                  - 01GMQ4FT84ESB18AS6GN1AWVKF
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object, like "price_xxxx".
                  object:
                    type: string
                    description: '''price'''
                  active:
                    type: boolean
                    description: Whether the price can be used for new purchases.
                  billing_scheme:
                    type: string
                    description: >-
                      Describes how to compute the price per period. Either
                      per_unit or tiered
                    enum:
                      - per_unit
                      - tiered
                    x-apifox-enum:
                      - value: per_unit
                        name: ''
                        description: only per_unit is supported now.
                      - value: tiered
                        name: ''
                        description: ''
                  created:
                    type: integer
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  currency:
                    type: string
                    description: 'Three-letter ISO currency code, in uppercase. '
                  livemode:
                    type: boolean
                    description: >-
                      Has the value true if the object exists in live mode or
                      the value false if the object exists in test mode.
                  lookup_key:
                    type: string
                    description: >-
                      A lookup key used to retrieve prices dynamically from a
                      static string. This may be up to 200 characters.
                  metadata:
                    type: object
                    properties: {}
                    x-apifox-orders: []
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                    x-apifox-ignore-properties: []
                  nickname:
                    type: string
                    description: A brief description of the price, hidden from customers.
                  product:
                    type: string
                    description: The ID of the product this price is associated with.
                  type:
                    type: string
                    description: >-
                      One of one_time or recurring depending on whether the
                      price is for a one-time purchase or a recurring
                      (subscription) purchase.
                    enum:
                      - one_time
                      - recurring
                    x-apifox-enum:
                      - value: one_time
                        name: ''
                        description: only one-time is supported now.
                      - value: recurring
                        name: ''
                        description: ''
                  unit_amount:
                    type: integer
                    description: >-
                      The unit amount in cents to be charged, represented as a
                      whole integer if possible. Only set if
                      billing_scheme=per_unit.
                  tiers:
                    type: array
                    items:
                      type: object
                      properties:
                        up_to:
                          type: string
                          description: >-
                            Specifies the upper bound of this tier. The lower
                            bound of a tier is the upper bound of the previous
                            tier adding one. Use inf to define a fallback tier.
                        flat_amount:
                          type: string
                          description: >-
                            The flat billing amount for an entire tier,
                            regardless of the number of units in the tier.
                        unit_amount:
                          type: string
                          description: >-
                            The per unit billing amount for each individual unit
                            for which this tier applies.
                      x-apifox-orders:
                        - up_to
                        - flat_amount
                        - unit_amount
                      x-apifox-ignore-properties: []
                    description: （未实现）
                x-apifox-ignore-properties:
                  - id
                  - object
                  - active
                  - billing_scheme
                  - created
                  - currency
                  - livemode
                  - lookup_key
                  - metadata
                  - nickname
                  - product
                  - type
                  - unit_amount
                  - tiers
          headers: {}
          x-apifox-name: OK
      security:
        - basic: []
      x-apifox-folder: API Reference/Prices
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/1296482/apis/api-55502235-run
components:
  schemas:
    Price:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object, like "price_xxxx".
        object:
          type: string
          description: '''price'''
        active:
          type: boolean
          description: Whether the price can be used for new purchases.
        billing_scheme:
          type: string
          description: >-
            Describes how to compute the price per period. Either per_unit or
            tiered
          enum:
            - per_unit
            - tiered
          x-apifox-enum:
            - value: per_unit
              name: ''
              description: only per_unit is supported now.
            - value: tiered
              name: ''
              description: ''
        created:
          type: integer
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        currency:
          type: string
          description: 'Three-letter ISO currency code, in uppercase. '
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        lookup_key:
          type: string
          description: >-
            A lookup key used to retrieve prices dynamically from a static
            string. This may be up to 200 characters.
        metadata:
          type: object
          properties: {}
          x-apifox-orders: []
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          x-apifox-ignore-properties: []
        nickname:
          type: string
          description: A brief description of the price, hidden from customers.
        product:
          type: string
          description: The ID of the product this price is associated with.
        type:
          type: string
          description: >-
            One of one_time or recurring depending on whether the price is for a
            one-time purchase or a recurring (subscription) purchase.
          enum:
            - one_time
            - recurring
          x-apifox-enum:
            - value: one_time
              name: ''
              description: only one-time is supported now.
            - value: recurring
              name: ''
              description: ''
        unit_amount:
          type: integer
          description: >-
            The unit amount in cents to be charged, represented as a whole
            integer if possible. Only set if billing_scheme=per_unit.
        custom_unit_amount:
          type: 'null'
          description: （未实现）
        recurring:
          type: object
          properties:
            interval:
              type: string
              description: >-
                The frequency at which a subscription is billed. One of day,
                week, month or year.
              enum:
                - day
                - week
                - month
                - year
              x-apifox-enum:
                - value: day
                  name: ''
                  description: ''
                - value: week
                  name: ''
                  description: ''
                - value: month
                  name: ''
                  description: ''
                - value: year
                  name: ''
                  description: ''
            interval_count:
              type: integer
              description: >-
                The number of intervals (specified in the interval attribute)
                between subscription billings. For example, interval=month and
                interval_count=3 bills every 3 months.
            usage_type:
              type: string
              description: Configures how the quantity per period should be determined.
              enum:
                - licensed
              x-apifox-enum:
                - value: licensed
                  name: ''
                  description: ''
          x-apifox-orders:
            - interval
            - interval_count
            - usage_type
          description: The recurring components of a price
          required:
            - interval
          x-apifox-ignore-properties: []
        tax_behavior:
          type: string
          description: （未实现）
        tiers_mode:
          type: 'null'
          description: （未实现）
        tiers:
          type: array
          items:
            type: object
            properties:
              up_to:
                type: string
                description: >-
                  Specifies the upper bound of this tier. The lower bound of a
                  tier is the upper bound of the previous tier adding one. Use
                  inf to define a fallback tier.
              flat_amount:
                type: string
                description: >-
                  The flat billing amount for an entire tier, regardless of the
                  number of units in the tier.
              unit_amount:
                type: string
                description: >-
                  The per unit billing amount for each individual unit for which
                  this tier applies.
            x-apifox-orders:
              - up_to
              - flat_amount
              - unit_amount
            x-apifox-ignore-properties: []
          description: （未实现）
        transform_quantity:
          type: 'null'
          description: （未实现）
        unit_amount_decimal:
          type: string
          description: （未实现）
      x-apifox-orders:
        - id
        - object
        - active
        - billing_scheme
        - created
        - currency
        - livemode
        - lookup_key
        - metadata
        - nickname
        - product
        - type
        - unit_amount
        - custom_unit_amount
        - recurring
        - tax_behavior
        - tiers_mode
        - tiers
        - transform_quantity
        - unit_amount_decimal
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://apitest.wooshpay.com
    description: 官网测试
security:
  - basic: []

```
