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

# Preview prices

> Unit prices for a product at given quantities, for the current customer, as if it were the only item in the cart. Without `quantities`, returns the product's quantity breaks.



## OpenAPI

````yaml /api-reference/openapi.json get /price-preview
openapi: 3.1.0
info:
  title: Joinery REST API
  version: 1.0.0
  description: >-
    Endpoints added to WordPress by Joinery Core, under /wp-json/joinery/v1.
    Price preview is public; rule management needs a user with the
    manage_woocommerce capability.
  license:
    name: GPL-2.0-or-later
    identifier: GPL-2.0-or-later
servers:
  - url: https://{site}/wp-json/joinery/v1
    variables:
      site:
        default: example.com
        description: Your WordPress site's host.
security: []
tags:
  - name: Prices
    description: For storefronts, including headless.
  - name: Rules
    description: Manage pricing and reward rules.
paths:
  /price-preview:
    get:
      tags:
        - Prices
      summary: Preview prices
      description: >-
        Unit prices for a product at given quantities, for the current customer,
        as if it were the only item in the cart. Without `quantities`, returns
        the product's quantity breaks.
      operationId: previewPrice
      parameters:
        - name: product_id
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
          example: 10
        - name: quantities
          in: query
          required: false
          schema:
            type: string
            pattern: ^[0-9,]{0,60}$
          description: Up to 10 comma-separated quantities.
          example: 1,12,60
      responses:
        '200':
          description: Prices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricePreview'
        '400':
          description: Invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such product for sale.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - {}
        - applicationPassword: []
        - cookieNonce: []
components:
  schemas:
    PricePreview:
      type: object
      properties:
        product_id:
          type: integer
          example: 10
        currency_code:
          type: string
          example: USD
        currency_minor_unit:
          type: integer
          example: 2
        regular_price:
          $ref: '#/components/schemas/Money'
        prices:
          type: array
          items:
            type: object
            properties:
              quantity:
                type: integer
                example: 12
              price:
                $ref: '#/components/schemas/Money'
              percent_saving:
                type: number
                example: 10
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        data:
          type: object
          properties:
            status:
              type: integer
    Money:
      type: string
      description: >-
        Integer amount in minor units, as a string ("1080" = 10.80 with
        currency_minor_unit 2).
      example: '1080'
  securitySchemes:
    applicationPassword:
      type: http
      scheme: basic
      description: >-
        A WordPress application password (Users → Profile → Application
        passwords).
    cookieNonce:
      type: apiKey
      in: header
      name: X-WP-Nonce
      description: >-
        The logged-in cookie plus a wp_rest nonce, for requests from wp-admin or
        the same site.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.