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

# Buy again

> Add the reorderable items from a previous order back into the authenticated customer's cart. Subscription and balance-payment line items are excluded.



## OpenAPI

````yaml /api-reference/openapi.json post /account/orders/{orderId}/buy-again
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:
  /account/orders/{orderId}/buy-again:
    parameters:
      - name: orderId
        in: path
        required: true
        description: The public order reference (order_id)
        schema:
          type: string
    post:
      tags:
        - Account
      summary: Buy again
      description: >-
        Add the reorderable items from a previous order back into the
        authenticated customer's cart. Subscription and balance-payment line
        items are excluded.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  cartId:
                    type: string
                    format: uuid
                  itemsAdded:
                    type: integer
                  itemsSkipped:
                    type: integer
                  skippedReasons:
                    type: array
                    items:
                      type: string
                  redirectUrl:
                    type: string
                  cart:
                    type: object
                    description: The updated cart resource
              example:
                success: true
                cartId: b2c3d4e5-6f70-8192-a3b4-c5d6e7f80912
                itemsAdded: 2
                itemsSkipped: 1
                skippedReasons:
                  - '''Limited Edition Truffles'' is no longer available'
                redirectUrl: /cart
                cart: {}
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Unauthenticated.
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Order not found
        '422':
          description: No items could be reordered
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  itemsAdded:
                    type: integer
                  itemsSkipped:
                    type: integer
              example:
                success: false
                message: No items from this order can be reordered.
                itemsAdded: 0
                itemsSkipped: 2
      security:
        - accountAuth: []
components:
  schemas:
    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
    accountAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is the account token returned from the `Login` endpoint.

````