Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Available views for state-modifying endpoints

Some endpoints that modify the state of the basket ( e.g. Adding lineitem to a basket) can return one of the available views representing the state of the basket. By using views, you will not need to fetch the updated basket 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:

    
    
    curl -D- -X POST {base_url}/api/v1/baskets/{basketId}/lines?views=miniBasket \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
    -d '{
    ...
    }'
    
    

Available views

View Description
miniBasket Returns a subset of Basket data.

Examples

miniBasket

    
    
    { 
        "miniBasket": {
            "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}",
                    "vat": "{vatAmount}",
                    "vatRate": "{vatRateAmount}",
                    "customProperties": [
                        {
                            "id": "{id}",
                            "key": "{propKey}",
                            "value": "{propValue}"
                        }
                    ]
                }
            ],
            "orderTotal": "{orderTotalAmount}",
            "paymentTotal": "{paymentTotalAmount}",
            "shippingTotal": "{shippingTotalAmount}",
            "subTotal": "{subTotalAmount}",
            "vat": "{vatAmount}"
        }
    }