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
  • Prerequisites
  • Add Custom Properties to Line Item
  • Parameters
  • Request
  • Response
  • Delete Custom Property from Line Item
  • Parameters
  • Request
  • Response
  • Get Custom Properties for Line Item
  • Parameters
  • Request
  • Response
  • Update Custom Properties for Line Item
  • Parameters
  • Request
  • Response
  • Error Handling
  • Related Articles

Was this helpful?

  1. Ucommerce Next Gen
  2. Headless
  3. Reference

Line Item Custom Properties

PreviousCart Custom PropertiesNextOrders

Last updated 1 year ago

Was this helpful?

You can enable a mini cart view in the following requests to show changes to the cart immediately. Find out more in the Views for Cart modifying operations

Prerequisites

  • access_token from Headless API Authentication

  • cartId from

Add Custom Properties to Line Item

Parameters

  • lineId (string)

  • key the unique key of the property (string)

  • value the value of the property (string)

Request

curl -D- -X POST <base_url>/api/v1/carts/<cartId>/<lineId>/properties \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
    -d '{
        "cultureCode": "<cultureCode>",
        "priceGroupId": "<priceGroupId>",
        "key": "<key>",
        "value": "<value>"
    }'

Response

{
    "miniCart": null,
    "success": true
}

Delete Custom Property from Line Item

Parameters

  • propertyId from #add-custom-properties-to-cart or #get-custom-properties-for-cart

  • lineId (string)

Request

curl -D- -X DELETE <base_url>/api/v1/carts/<cartId>/lines/<lineId>/properties/<propertyId> \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
    -d '{
        "cultureCode": "<cultureCode>",
        "priceGroupId": "<priceGroupId>",
    }'

Response

{
    "miniCart": null,
    "success": true
}

Get Custom Properties for Line Item

Parameters

  • lineId (string)

Request

curl -D- -X GET <base_url>/api/v1/carts/<cartId>/lines/<lineId>/properties \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \

Response

{
    "customProperties":
        [
            {
                "id" : "{id}",
                "key" : "{key}",
                "value" : "{value}",
            }
        ]
}

Update Custom Properties for Line Item

Parameters

  • lineId (string)

  • propertyId from #add-custom-properties-to-cart or #get-custom-properties-for-cart

  • value new value for the property (string)

Request

curl -D- -X PATCH <base_url>/api/v1/carts/<cartId>/lines/<lineId>/properties/<propertyId> \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \
    -d '{
        "cultureCode": "<cultureCode>",
        "priceGroupId": "<priceGroupId>",
        "value": "<value>"
    }'

Response

{
    "miniCart": null,
    "success": true
}

Error Handling

Error
Description

BadRequest (400)

Execution of the pipeline fails; AccessToken was not attached.

Unauthorized (401)

The token is expired.

Forbidden (403)

The token does not have access to this endpoint.

NotFound (404)

Cart or Property not found.

Conflict (409)

Property already exists on the order.

Error Response Example

{
"errors":
    [
        {
            "error-description": "Property not found.",
            "error": "NotFound"
        }
    ]
}

Related Articles

Error Handling
Create a Cart