> ## 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.

# Switch Cart Market

> Change the cart's market, updating its currency and exchange rate. Shipping is cleared and every line item is repriced in the new market's currency. Returns the recalculated cart.



## OpenAPI

````yaml /api-reference/openapi.json post /carts/{cartId}/market
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:
  /carts/{cartId}/market:
    parameters:
      - name: cartId
        in: path
        required: true
        description: The unique identifier for the cart
        schema:
          type: string
          format: uuid
        example: 893ff86d-4453-4134-9f62-5c9b7a70d74e
    post:
      tags:
        - Carts
      summary: Switch Cart Market
      description: >-
        Change the cart's market, updating its currency and exchange rate.
        Shipping is cleared and every line item is repriced in the new market's
        currency. Returns the recalculated cart.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - marketId
              properties:
                marketId:
                  type: string
                  format: uuid
                  description: The identifier of the market to switch the cart to.
            example:
              marketId: 0c9a1b2d-3e4f-5061-7283-94a5b6c7d8e9
      responses:
        '200':
          description: >-
            Market switched. Returns the recalculated cart in the new market's
            currency.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Cart'
              example:
                data:
                  id: 893ff86d-4453-4134-9f62-5c9b7a70d74e
                  cartCount: 2
                  subTotal: 5600
                  shipping: 0
                  tax: 0
                  grandTotal: 5600
                  currency:
                    code: USD
                    symbol: $
                  market:
                    id: 0c9a1b2d-3e4f-5061-7283-94a5b6c7d8e9
                    name: United States
                    currencyCode: USD
                    currencySymbol: $
        '404':
          description: Cart not found, or the market is not found or unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Market not found or not available.
        '422':
          description: The market_id was not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Market ID is required.
components:
  schemas:
    Cart:
      type: object
      description: >-
        A storefront shopping cart with its items, totals and applied discounts.
        Monetary amounts are expressed in the cart currency's minor units (e.g.
        pence/cents).
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the cart.
        cartCount:
          type: integer
          description: Total quantity of items in the cart.
        customerId:
          type: string
          format: uuid
          nullable: true
          description: Identifier of the customer associated with the cart, if any.
        email:
          type: string
          format: email
          nullable: true
          description: Email address associated with the cart.
        billingAddress:
          type: object
          description: Billing address details.
        shippingAddress:
          type: object
          description: Shipping address details.
        shippingMethod:
          type: object
          nullable: true
          description: The selected shipping method.
        shippingMethodId:
          type: string
          format: uuid
          nullable: true
          description: Identifier of the selected shipping method.
        deliveryInstructions:
          type: string
          nullable: true
          description: Delivery instructions for the order.
        requiresShipping:
          type: boolean
          description: Whether the cart contains any shippable items.
        items:
          type: array
          description: The line items in the cart.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Line item identifier.
              productType:
                type: string
                description: The type of product.
              name:
                type: string
                description: Product name.
              quantity:
                type: integer
                description: Quantity of this line item.
              price:
                type: number
                description: Unit price in minor currency units.
              originalPrice:
                type: number
                nullable: true
                description: >-
                  Original unit price before any discount, in minor currency
                  units.
              lineTotal:
                type: number
                description: Total price for this line, in minor currency units.
              isFreeItem:
                type: boolean
                description: Whether this line was added as a free item.
        giftMessage:
          type: string
          nullable: true
          description: Optional gift message.
        discounts:
          type: array
          description: Discounts applied to the cart.
          items:
            type: object
        subTotal:
          type: number
          description: >-
            Subtotal before discounts, shipping and tax, in minor currency
            units.
        discount:
          type: number
          description: Total discount amount, in minor currency units.
        pointsToRedeem:
          type: integer
          description: Number of reward points currently applied to the cart.
        pointsDiscountValue:
          type: number
          description: >-
            Monetary value of the applied points discount, in minor currency
            units.
        shipping:
          type: number
          description: Shipping cost, in minor currency units.
        tax:
          type: number
          description: Tax amount, in minor currency units.
        grandTotal:
          type: number
          description: Final total payable, in minor currency units.
        currency:
          type: object
          description: The cart's currency.
          properties:
            code:
              type: string
              description: ISO currency code.
            symbol:
              type: string
              description: Currency symbol.
        market:
          type: object
          nullable: true
          description: The market the cart is currently in.
          properties:
            id:
              type: string
              format: uuid
              description: Market identifier.
            name:
              type: string
              description: Market name.
            currencyCode:
              type: string
              description: Market currency code.
            currencySymbol:
              type: string
              description: Market currency symbol.
        attribution:
          type: object
          nullable: true
          description: Marketing attribution data.
        createdAt:
          type: string
          format: date-time
          description: When the cart was created.
        updatedAt:
          type: string
          format: date-time
          description: When the cart was last updated.
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message
  securitySchemes:
    tenantAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your API token.
      bearerFormat: JWT

````