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

# Update Price by ID for a Product

> The "Update Price by ID for a Product" API allows modifying information for a specific price associated with a particular product using its unique identifier. Use this endpoint to update details for a single price based on the provided price ID and product ID.



## OpenAPI

````yaml /api-reference/products/openapi.json put /products/{productId}/price/{priceId}
openapi: 3.0.0
info:
  title: Products API
  description: Documentation for products API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Products
    description: Documentation for products API
  - name: Prices
    description: Documentation for products API
  - name: Store
    description: Documentation for products API
  - name: Collections
    description: Documentation for products API
  - name: Reviews
    description: Documentation for products API
paths:
  /products/{productId}/price/{priceId}:
    put:
      tags:
        - Prices
      summary: Update Price by ID for a Product
      description: >-
        The "Update Price by ID for a Product" API allows modifying information
        for a specific price associated with a particular product using its
        unique identifier. Use this endpoint to update details for a single
        price based on the provided price ID and product ID.
      operationId: update-price-by-id-for-product
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: productId
          required: true
          in: path
          description: ID of the product that needs to be used
          schema:
            example: 6578278e879ad2646715ba9c
            type: string
        - name: priceId
          required: true
          in: path
          description: ID of the price that needs to be returned
          schema:
            example: 6578278e879ad2646715ba9c
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePriceDto'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePriceResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - Location-Access:
            - products/prices.write
        - Agency-Access:
            - products/prices.write
components:
  schemas:
    UpdatePriceDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the price.
          example: Price Name
        type:
          type: string
          description: The type of the price.
          example: one_time
          enum:
            - one_time
            - recurring
        currency:
          type: string
          description: The currency of the price.
          example: USD
        amount:
          type: number
          description: 'The amount of the price. ( min: 0 )'
          example: 99.99
        recurring:
          $ref: '#/components/schemas/RecurringDto'
        description:
          type: string
          description: A brief description of the price.
        membershipOffers:
          description: An array of membership offers associated with the price.
          type: array
          items:
            $ref: '#/components/schemas/MembershipOfferDto'
        trialPeriod:
          type: number
          description: The trial period duration in days (if applicable).
          example: 7
        totalCycles:
          type: number
          description: 'The total number of billing cycles for the price. ( min: 1 )'
          example: 12
        setupFee:
          type: number
          description: The setup fee for the price.
          example: 10.99
        variantOptionIds:
          description: An array of variant option IDs associated with the price.
          example:
            - option_id_1
            - option_id_2
          type: array
          items:
            type: string
        compareAtPrice:
          type: number
          description: The compare at price for the price.
          example: 19.99
        locationId:
          type: string
          description: The unique identifier of the location associated with the price.
          example: 6578278e879ad2646715ba9c
        userId:
          type: string
          description: The unique identifier of the user who created the price.
          example: 6578278e879ad2646715ba9c
        meta:
          $ref: '#/components/schemas/PriceMetaDto'
        trackInventory:
          type: boolean
          description: Need to track inventory stock quantity
          example: true
        availableQuantity:
          type: number
          description: Available inventory stock quantity
          example: 5
        allowOutOfStockPurchases:
          type: boolean
          description: Continue selling when out of stock
          example: true
        sku:
          type: string
          description: The unique identifier of the SKU associated with the price
          example: sku_123
        shippingOptions:
          $ref: '#/components/schemas/ShippingOptionsDto'
        isDigitalProduct:
          type: boolean
          description: Is the product a digital product
          example: true
        digitalDelivery:
          description: Digital delivery options
          type: array
          items:
            type: string
      required:
        - name
        - type
        - currency
        - amount
        - locationId
    UpdatePriceResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: The unique identifier for the price.
          example: 655b33aa2209e60b6adb87a7
        membershipOffers:
          description: An array of membership offers associated with the price.
          type: array
          items:
            $ref: '#/components/schemas/MembershipOfferDto'
        variantOptionIds:
          description: An array of variant option IDs associated with the price.
          example:
            - h4z7u0im2q8
            - h3nst2ltsnn
          type: array
          items:
            type: string
        locationId:
          type: string
          description: The unique identifier for the location.
          example: 3SwdhCsvxI8Au3KsPJt6
        product:
          type: string
          description: The unique identifier for the associated product.
          example: 655b33a82209e60b6adb87a5
        userId:
          type: string
          description: The unique identifier for the user.
          example: 6YAtzfzpmHAdj0e8GkKp
        name:
          type: string
          description: The name of the price.
          example: Red / S
        type:
          type: string
          description: The type of the price (e.g., one_time).
          example: one_time
          enum:
            - one_time
            - recurring
        currency:
          type: string
          description: The currency code for the price.
          example: INR
        amount:
          type: number
          description: The amount of the price.
          example: 199999
        recurring:
          $ref: '#/components/schemas/RecurringDto'
        createdAt:
          format: date-time
          type: string
          description: The creation timestamp of the price.
          example: '2023-11-20T10:23:38.645Z'
        updatedAt:
          format: date-time
          type: string
          description: The last update timestamp of the price.
          example: '2024-01-23T09:57:04.852Z'
        compareAtPrice:
          type: number
          description: The compare-at price for comparison purposes.
          example: 2000000
        trackInventory:
          type: boolean
          description: Indicates whether inventory tracking is enabled.
          example: null
        availableQuantity:
          type: number
          description: Available inventory stock quantity
          example: 5
        allowOutOfStockPurchases:
          type: boolean
          description: Continue selling when out of stock
          example: true
      required:
        - _id
        - name
        - type
        - currency
        - amount
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    RecurringDto:
      type: object
      properties:
        interval:
          type: string
          description: The interval at which the recurring event occurs.
          example: day
          enum:
            - day
            - month
            - week
            - year
        intervalCount:
          type: number
          description: The number of intervals between each occurrence of the event.
          example: 1
      required:
        - interval
        - intervalCount
    MembershipOfferDto:
      type: object
      properties:
        label:
          type: string
          description: Membership offer label
          example: top_50
        value:
          type: string
          description: Membership offer label
          example: '50'
        _id:
          type: string
          description: The unique identifier for the membership offer.
          example: 655b33aa2209e60b6adb87a7
      required:
        - label
        - value
        - _id
    PriceMetaDto:
      type: object
      properties:
        source:
          type: string
          description: The source of the price.
          enum:
            - stripe
            - woocommerce
            - shopify
            - printify
          example: stripe
        sourceId:
          type: string
          description: The id of the source of the price from where it is imported
          example: '123'
        stripePriceId:
          type: string
          description: The Stripe price ID associated with the price.
          example: price_123
        internalSource:
          type: string
          description: The internal source of the price.
          enum:
            - agency_plan
            - funnel
            - membership
            - communities
            - gokollab
            - calendar
            - recurring_donation
          example: agency_plan
      required:
        - source
        - stripePriceId
        - internalSource
    ShippingOptionsDto:
      type: object
      properties:
        weight:
          $ref: '#/components/schemas/WeightOptionsDto'
        dimensions:
          $ref: '#/components/schemas/PriceDimensionsDto'
    WeightOptionsDto:
      type: object
      properties:
        value:
          type: number
          description: Actual weight of the product
          example: 10
        unit:
          type: string
          description: Weight unit of the product
          example: kg
          enum:
            - kg
            - lb
            - g
            - oz
      required:
        - value
        - unit
    PriceDimensionsDto:
      type: object
      properties:
        height:
          type: number
          description: Height of the price
          example: 10
        width:
          type: number
          description: Width of the price
          example: 10
        length:
          type: number
          description: Length of the price
          example: 10
        unit:
          type: string
          description: Unit of the price dimensions
          example: cm
          enum:
            - cm
            - in
            - m
      required:
        - height
        - width
        - length
        - unit

````