Discover new ways of working with Carts, Orders, Quotes, and Shipping Methods.
After completing this page, you should be able to:
- Recognize what new Line Item price information you have access to thanks to the new
taxPortions
field. - Give users access only to Quotes tied to specific Stores using either the Merchant Center or the API.
- Export Orders using the Merchant Center.
- Implement Shipping Method predicates using the new predicate builder.
Time to complete page: 20 minutes
taxPortions field added to TaxedItemPrice
As you probably know, tax subrates let you break down a tax rate into smaller parts, each with a name
and amount
. They provide transparency for how a specific tax rate is calculated.
Tax subrates have been part of Composable Commerce for a while now and you can also manage them in the Merchant Center:
Make sure that the sum of your subrates matches the total rate.
In the example above, we can see a tax rate of 19% that consists of two parts:
- subrate 1: 10%
- subrate 2: 9%
Thanks to the newly added taxPortions
field on taxedPrice
in Line Items and Custom Line Items in your Carts/Orders, you have the data you need to show your customers how these subrates were applied to individual items and not just the whole Cart:
{
"type": "Cart",
...
"lineItems": [
{
"id": "3fa03c5d-1993-4099-a813-293846b965c4",
"productId": "9f846e46-b50d-4bf1-b851-5508b26b9102",
"productKey": "amalia-rug",
...
"taxedPrice": {
"totalNet": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 11764,
"fractionDigits": 2
},
"totalGross": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 13999,
"fractionDigits": 2
},
"taxPortions": [
{
"rate": 0.1,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 1176,
"fractionDigits": 2
},
"name": "subrate 1"
},
{
"rate": 0.09,
"amount": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 1059,
"fractionDigits": 2
},
"name": "subrate 2"
}
],
"totalTax": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 2235,
"fractionDigits": 2
}
},
}
]
}
...
Store-based data fencing for Quotes
Quote Requests in commercetools are used to initiate a structured negotiation process between a buyer and a seller. They are particularly useful in B2B scenarios or when dealing with complex products and pricing. Here's a breakdown of their purpose:
- Formalize purchase requests: Buyers can submit Quote Requests to express their interest in purchasing goods or services. This request outlines the desired products, quantities, and any specific requirements.
- Negotiate pricing and terms: Sellers can respond to Quote Requests with tailored offers, potentially adjusting prices, applying discounts, or defining specific payment and delivery terms.
- Track negotiation history: The Quote Request object in commercetools keeps a record of the entire negotiation process, including the initial request, subsequent offers, counter-offers, and the final agreed-upon terms.
Quote Requests have to be created from an existing Cart via the API. However once created, they can be further searched, filtered and managed in the Merchant Center:
If a Cart was tied to a specific Store, any assigned Quote Requests based on it will also be bound to that Store. Thanks to the latest enhancements, we can control which Merchant Center Teams can manage Quotes, Staged Quotes and Quote Requests tied to specific Stores:
When a member of the B2C Store Admins team, configured in the screenshot above, tries to access the Quotes in the Project, they will only see Quotes tied to the B2C Retail Store:
Of course similar functionality is also available via the API. The following request can be used to view Quote Requests tied to the B2C Retail Store:
curl --get "https://api.{region}.commercetools.com/{project Key}/in-store/key=b2c-retail-store/quote-requests" \
--header "Authorization: Bearer {bearerToken}" | jq
It’s worth pointing out that similar functionality is also available for Orders.
Order export
Exporting orders from commercetools unlocks a world of possibilities for your business! Here’s how it can elevate your operations:
- Powerful Data Analysis: Dive into detailed sales trends, customer behavior, and product performance to uncover insights that drive smarter, data-backed decisions.
- Seamless system integration: Effortlessly connect your order data to an Enterprise Resource Planning (ERP) system, Customer Relationship Management (CRM) system, or accounting system, streamlining workflows and boosting efficiency with automated data flows.
- Reliable archiving and auditing: Maintain secure backups and robust records to meet auditing and compliance requirements with ease.
- Tailored customizations: Use your exported data to create custom integrations or applications that align with your unique business needs.
- Unmatched flexibility: Ensure data portability for smooth migrations across systems or platforms whenever your business evolves.
Just like you saw earlier with Products, exporting Orders is now possible directly from the Merchant Center:
You can now enhance your Order exports to CSV
files by including details like the order number, ID, and order state. These additional fields make it easier to filter and organize Orders when working with the file in a spreadsheet editor:
After confirming the initial settings, you can then select which fields/states specifically you would like to include in the export:
You can find the status of the export operation and the resulting file by going to Operations, then Export:
Shipping Method predicate builder
Everyone appreciates the predicate builder in the Cart Discount section of the Merchant Center and how it makes it easier to define the conditions for applying Cart Discounts. Now you can enjoy the same benefits when creating predicates for Shipping Methods:
Here are some of its benefits:
- Visual and user-friendly: It provides a graphical interface to construct predicates, making it more intuitive than writing them manually. You can easily select fields, operators, and values from drop-down menus and input fields.
- Guided experience: The builder guides you through the process of creating valid predicates. It ensures that you select compatible fields and operators, reducing errors.
- Real-time validation: It validates your predicate syntax as you build it, providing immediate feedback and preventing you from saving invalid predicates.
- Improved accessibility: It makes creating complex logic accessible to users who may not be familiar with the intricacies of predicate syntax.
Enjoy a more streamlined way of creating your Shipping Method predicates!