Ucommerce
  • Ucommerce Next Gen
    • Getting Started
      • Prerequisites
      • Licensing
      • Ucommerce Templates
      • Headless Template
      • MVC Template
    • Headless
      • Postman Collection
      • Headless API Authentication
        • Token endpoint - Authorization Header
        • Authorization Scopes
        • Refreshing the Access Token
      • Reference
        • Cart
        • Cart / Order Line Items
        • Shipment
        • Billing
        • Promotion Codes
        • Price Groups
        • Payment Methods
        • Countries
        • Shipping Methods
        • Catalogs
        • Cart Custom Properties
        • Line Item Custom Properties
        • Orders
        • Views for Cart modifying operations
      • Custom Headless APIs
      • Error Handling
      • Pagination
      • Deprecation
    • Backoffice Authentication
      • Microsoft Entra ID Example
      • Auth0 Authentication Example
    • Definitions
      • What is a Definition
    • Search and indexing
      • Configuration
      • Indexing
        • Index Definitions
        • Facets
        • Indexing Prices
        • Suggestions
        • Custom Data
      • Searching
    • Payment Providers
      • Stripe Provider Integration
      • Implementing a custom payment provider
    • Data Import
    • Miscellaneous
      • Media
      • Price Group Inheritance
      • Price Group Criteria
      • Soft Deletion Of Entities
      • Logging
      • OpenTelemetry
    • Extensions
      • Extending Pipelines
        • Order Processing Pipelines
        • Checkout Pipelines
      • Changing Service Behavior
        • Images
        • Content
      • Custom Headless APIs
      • Extend the Backoffice
        • Custom UI Components
      • Custom Editor UI
      • Custom Promotion Criteria
      • Custom Price Group Criteria
    • How-To
      • Migrate from Classic
        • Common database issues
      • Entities from code
        • Bootstrapping data on startup
        • Product Definitions & Fields
      • Discover pipelines and their tasks
      • Executing a pipeline
    • Integrations
      • Umbraco Media Delivery API
      • App Slices
        • Product Picker
  • Release Notes
  • Contact Us
Powered by GitBook
On this page
  • Views
  • Examples
  • Request
  • MiniCart Response

Was this helpful?

  1. Ucommerce Next Gen
  2. Headless
  3. Reference

Views for Cart modifying operations

PreviousOrdersNextCustom Headless APIs

Last updated 1 year ago

Was this helpful?

Endpoints that modify a Cart ( e.g. ) can return one of the available views representing the updated Cart. By using views, you will not need to fetch the updated Cart in a subsequent API call.

The views can be requested by adding a views query parameter to your request with at least one of the following views:

Views

View
Description

miniCart

Returns a subset of Cart data.

Examples

Request

curl -D- -X POST <base_url>/api/v1/carts/<cartId>/lines?views=miniCart \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
    -d '{
        ...<the parameters for the request>...
    }'

MiniCart Response

{
    "miniCart": {
        "customProperties": [
            {
                "id": "{id}",
                "key": "{propKey}",
                "value": "{propValue}"
            }
        ],
        "createdDate": "{createdDate}",
        "cultureCode": "{cultureCode}",
        "discount": "{discountAmount}",
        "discountTotal": "{discountTotalAmount}",
        "id": "{id}",
        "note": "{note}",
        "orderLines": [
            {
                "discount": "{discountAmount}",
                "discounts": "{[discount1Amount, discount2Amount]}",
                "id": "{id}",
                "price": "{priceAmount}",
                "priceGroupId": "{priceGroupId}",
                "productCatalogId": "{productCatalogId}",
                "productName": "{productName}",
                "quantity": "{quantityNumber}",
                "sku": "{sku}",
                "total": "{totalAmount}",
                "unitDiscount": "{unitDiscountAmount}",
                "variantSku": "{variantSku}",
                "tax": "{taxAmount}",
                "taxRate": "{taxRateAmount}",
                "customProperties": [
                    {
                        "id": "{id}",
                        "key": "{propKey}",
                        "value": "{propValue}"
                    }
                ]
            }
        ],
        "orderTotal": "{orderTotalAmount}",
        "paymentTotal": "{paymentTotalAmount}",
        "shippingTotal": "{shippingTotalAmount}",
        "subTotal": "{subTotalAmount}",
        "tax": "{taxAmount}"
    }
}
Add Line Item to a Cart