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

# Calculate a configured subscription price

> Prices a configured pick & mix subscription for a given billing frequency and set of selected items. Item prices use the effective price (sale, subscriber or list price) and are converted to the active market's currency. Returns the raw and formatted subtotal plus currency information.



## OpenAPI

````yaml /api-reference/openapi.json post /subscription-packages/calculate-price
openapi: 3.0.0
info:
  title: Marzipan API
  version: 1.0.0
servers:
  - url: https://api.marzipan.co/v1
security:
  - tenantAuth: []
tags:
  - name: Account
    description: >-
      Account management endpoints including registration, login, and user
      details
  - name: Carts
    description: Shopping cart management endpoints
  - name: Products
    description: Product catalog and search endpoints
  - name: Subscriptions
    description: Subscription management and renewal endpoints
  - name: CMS
    description: Content management system endpoints
  - name: Messaging
    description: Message and communication endpoints
  - name: Search
    description: Search functionality endpoints
  - name: Settings
    description: >-
      Storefront settings and market detection used to configure the web
      components and checkout.
  - name: Analytics
    description: Storefront visit and attribution tracking.
  - name: Rewards
    description: >-
      Loyalty and rewards programme endpoints for the authenticated customer,
      covering points balance, tier status, perks, exclusive products and
      transaction history.
  - name: Forms
    description: Render and submit dynamic storefront forms defined in the CMS.
  - name: Events
    description: >-
      Check event availability, browse occurrences and recurring dates, generate
      ticket QR codes, and manage event waitlists (join, leave, check status,
      and claim promoted spots).
paths:
  /subscription-packages/calculate-price:
    post:
      tags:
        - Subscriptions
      summary: Calculate a configured subscription price
      description: >-
        Prices a configured pick & mix subscription for a given billing
        frequency and set of selected items. Item prices use the effective price
        (sale, subscriber or list price) and are converted to the active
        market's currency. Returns the raw and formatted subtotal plus currency
        information.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - productId
                - frequency
                - items
              properties:
                productId:
                  type: string
                  format: uuid
                  description: The id of the pick & mix subscription product.
                frequency:
                  type: integer
                  enum:
                    - 1
                    - 3
                    - 6
                    - 12
                  description: Billing frequency in months.
                items:
                  type: array
                  minItems: 1
                  description: The selected items and their quantities.
                  items:
                    type: object
                    required:
                      - id
                      - quantity
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The id of the selected item product.
                      quantity:
                        type: integer
                        minimum: 1
                        maximum: 10
                        description: Quantity of this item.
            example:
              productId: 2c1d0e9f-8a7b-4c6d-9e5f-1a2b3c4d5e6f
              frequency: 3
              items:
                - id: 9b2f1c4e-1a2b-4c3d-8e9f-0a1b2c3d4e5f
                  quantity: 2
      responses:
        '200':
          description: The calculated price for the configuration.
          content:
            application/json:
              schema:
                type: object
                properties:
                  priceRaw:
                    type: integer
                    description: Subtotal in the currency's minor units (e.g. pence).
                  priceFormatted:
                    type: string
                    description: >-
                      Human-readable formatted subtotal including currency
                      symbol.
                  currency:
                    type: object
                    properties:
                      code:
                        type: string
                        description: ISO currency code.
                      symbol:
                        type: string
                        description: Currency symbol.
              example:
                priceRaw: 1700
                priceFormatted: £17.00
                currency:
                  code: GBP
                  symbol: £
        '400':
          description: >-
            The product is not a pick & mix subscription, or the selected
            frequency is not available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Product is not a pick & mix subscription
        '422':
          description: The submitted data failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              example:
                message: The frequency field is required.
                errors:
                  frequency:
                    - The frequency field is required.
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message
    ValidationError:
      type: object
      properties:
        message:
          type: string
          description: Validation error message
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field-specific validation errors
      required:
        - message
        - errors
  securitySchemes:
    tenantAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your API token.
      bearerFormat: JWT

````