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

# Create Cart Ref

> Fotografa il carrello del server e risponde col codice (§2.2, §5.1).

404 `whatsapp.disabled` (modulo spento o pulsante del carrello non
previsto), 422 `whatsapp.cart_empty` / `whatsapp.cart_too_large` (> 100
righe), 429 per IP (10/minuto) o `whatsapp.daily_limit` (200 al giorno per
IP, 5.000 per negozio): la vetrina apre comunque il messaggio, senza codice.



## OpenAPI

````yaml https://api.vellaro.io/openapi/storefront.json post /api/v1/whatsapp/cart-refs
openapi: 3.1.0
info:
  title: Vellaro Storefront API
  description: >-
    The API of storefronts and mobile apps. The store comes from the publishable
    key in the `X-Vellaro-Key` header (or from the store's domain); the
    customer's endpoints also take the customer's token as `Authorization:
    Bearer <access_token>`.
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags:
  - name: Authentication
    description: >-
      Customer sign-up and login, tokens, password reset, email verification,
      Google and Apple login, two-factor authentication.
  - name: Catalog
    description: Products, categories and brands, with filters, sorting and pagination.
  - name: Search
    description: Full-text product search and suggestions as you type.
  - name: Cart
    description: >-
      The cart of a guest (`X-Cart-Token`) or of the logged-in customer, and the
      extra warranty offered on a product page.
  - name: Checkout & orders
    description: >-
      Checkout, the customer's orders and reorder, «Order on WhatsApp» (cart
      codes, clicks).
  - name: Payments
    description: >-
      The store's payment methods, paying an order again, and the confirmation
      steps of PayPal, PokPay and Iute.
  - name: Account
    description: >-
      The logged-in customer: profile, addresses, wishlist, digital downloads,
      subscriptions, affiliate account.
  - name: Reviews & questions
    description: Product reviews and product questions.
  - name: AI chat
    description: 'The store''s AI shopping assistant: conversations, messages, feedback.'
  - name: Content
    description: CMS pages, menus, banners, flipbooks and information pages.
  - name: Marketing & contact
    description: >-
      Newsletter sign-up and email links, the contact form, campaign click
      tracking.
  - name: Store
    description: >-
      The store for the storefront: brand, public settings, languages,
      translations, currencies, physical stores, theme.
  - name: Devices
    description: Push-notification devices of the mobile app.
paths:
  /api/v1/whatsapp/cart-refs:
    post:
      tags:
        - Checkout & orders
      summary: Create Cart Ref
      description: >-
        Fotografa il carrello del server e risponde col codice (§2.2, §5.1).


        404 `whatsapp.disabled` (modulo spento o pulsante del carrello non

        previsto), 422 `whatsapp.cart_empty` / `whatsapp.cart_too_large` (> 100

        righe), 429 per IP (10/minuto) o `whatsapp.daily_limit` (200 al giorno
        per

        IP, 5.000 per negozio): la vetrina apre comunque il messaggio, senza
        codice.
      operationId: create_cart_ref_api_v1_whatsapp_cart_refs_post
      parameters:
        - name: X-Cart-Token
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Cart-Token
        - name: cx_cart
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cx Cart
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/CartRefIn'
                - type: 'null'
              title: Body
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_CartRefOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CartRefIn:
      properties:
        locale:
          anyOf:
            - type: string
              pattern: ^[a-z]{2}(-[A-Z]{2})?$
            - type: 'null'
          title: Locale
        display_currency:
          anyOf:
            - type: string
              pattern: ^[A-Za-z]{3}$
            - type: 'null'
          title: Display Currency
      type: object
      title: CartRefIn
      description: |-
        POST /whatsapp/cart-refs: il carrello arriva da X-Cart-Token/cookie o
        dall'utente, MAI dal corpo.
    ApiResponse_CartRefOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/CartRefOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[CartRefOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CartRefOut:
      properties:
        code:
          type: string
          title: Code
        display_code:
          type: string
          title: Display Code
        expires_at:
          type: string
          format: date-time
          title: Expires At
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
        currency:
          type: string
          title: Currency
        item_count:
          type: integer
          title: Item Count
        lines:
          items:
            $ref: '#/components/schemas/CartRefLineOut'
          type: array
          title: Lines
      type: object
      required:
        - code
        - display_code
        - expires_at
        - subtotal
        - currency
        - item_count
        - lines
      title: CartRefOut
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CartRefLineOut:
      properties:
        variant_id:
          type: string
          format: uuid
          title: Variant Id
        qty:
          type: integer
          title: Qty
        unit_price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Unit Price
        line_total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Line Total
      type: object
      required:
        - variant_id
        - qty
        - unit_price
        - line_total
      title: CartRefLineOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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