Skip to content
Navigation

Quote a cart

Prices a cart exactly as the order will, and tells you whether it can check out. Always 200 for a well-formed request: problems such as an invalid coupon or a missed minimum are reported inside the response (coupon.valid, minimum, canCheckout).

The quote is a preview: Unipage recomputes every amount when the order is placed. Promotional offers and tips are not previewed.

POST
https://api.unipage.eu/storefront/v1/cart/quote

Authorization

  • publicKey
    optional
    API key in header
  • secretKey
    optional
    HTTP

Request body JSON required

  • orderType
    TAKEOUT
    or
    DELIVERY
    required
  • lines
    array of
    object
    required
    • productId
      string
      required
    • quantity
      integer
      required
      minimum: 1
    • notes
      optional
      string
      maxLength: 255
    • options
      optional
      array of
      object
      • groupId
        string
        required
      • optionId
        string
        required
      • quantity
        optional
        integer

        Only matters for AMOUNT groups.

        default: 1
  • delivery
    optional
    object

    The delivery zone, for DELIVERY.

    • zoneId
      optional
      string
  • coupon
    optional
    string
  • slotAt
    optional
    integer

    Send it once the shopper picked a slot, so the prices and availability are the ones of that moment. POST /orders always uses its own slotAt.

Returns

200

The quote.

JSON
  • lines
    optional
    array of
    object
    • index
      optional
      integer

      Position of the line in the request.

    • productId
      optional
      string
    • name
      optional
      string
    • quantity
      optional
      integer
    • unitPrice
      optional
      number
    • optionsLabel
      optional
      string
    • total
      optional
      number
    • errors
      optional
      array of
      string
  • subtotal
    optional
    number
  • charges
    optional
    array of
    object

    Fixed charges the restaurant adds to every order of this type (a packaging or bag fee, for example). They are part of total; show them as separate lines.

    • name
      optional
      string
    • amount
      optional
      number
  • deliveryCost
    optional
    number
  • serviceCost
    optional
    number
  • couponDiscount
    optional
    number
  • coupon
    optional
    object | null

    null when none was sent.

    • code
      optional
      string
    • valid
      optional
      boolean
    • message
      optional
      string
  • total
    optional
    number

    subtotal + charges + deliveryCost + serviceCost - couponDiscount.

  • minimum
    optional
    object | null

    null when no minimum applies.

    • amount
      optional
      number
    • missing
      optional
      number
  • errors
    optional
    array of
    string

    Every reason canCheckout is false that is not a line error.

  • canCheckout
    optional
    boolean

401

A missing, unknown or revoked key (UNAUTHENTICATED).
JSON
  • error
    object
    required
    • code
      UNAUTHENTICATED
      or
      FORBIDDEN
      or
      NOT_FOUND
      or
      METHOD_NOT_ALLOWED
      or
      VALIDATION
      or
      SLOT_UNAVAILABLE
      +6 more
      required
    • message
      string
      required

      Human readable.

    • fields
      optional
      map of
      string

      Only present when the error belongs to specific request fields.

403

A public key on a secret route, or used from an origin that is not registered for it (FORBIDDEN).
JSON
  • error
    object
    required
    • code
      UNAUTHENTICATED
      or
      FORBIDDEN
      or
      NOT_FOUND
      or
      METHOD_NOT_ALLOWED
      or
      VALIDATION
      or
      SLOT_UNAVAILABLE
      +6 more
      required
    • message
      string
      required

      Human readable.

    • fields
      optional
      map of
      string

      Only present when the error belongs to specific request fields.

422

The request is not valid, see fields (VALIDATION).
JSON
  • error
    object
    required
    • code
      UNAUTHENTICATED
      or
      FORBIDDEN
      or
      NOT_FOUND
      or
      METHOD_NOT_ALLOWED
      or
      VALIDATION
      or
      SLOT_UNAVAILABLE
      +6 more
      required
    • message
      string
      required

      Human readable.

    • fields
      optional
      map of
      string

      Only present when the error belongs to specific request fields.

429

Too many requests (RATE_LIMITED). Wait Retry-After seconds.
JSON
  • error
    object
    required
    • code
      UNAUTHENTICATED
      or
      FORBIDDEN
      or
      NOT_FOUND
      or
      METHOD_NOT_ALLOWED
      or
      VALIDATION
      or
      SLOT_UNAVAILABLE
      +6 more
      required
    • message
      string
      required

      Human readable.

    • fields
      optional
      map of
      string

      Only present when the error belongs to specific request fields.

Type to search…

↑↓ navigate↵ selectEsc close