Sitecore OrderCloud Documentation

docs

Portal login

Same Product, Multiple Price Schedules

Published by Miranda Posthumus on July 24, 2018

Price schedules are one of the critical factors related to product visibility and there are several ways that you can build relationships between products and price schedules. One of the scenarios you may wish to achieve is one product with multiple price schedules. Why would you possibly want one product that had multiple different prices based on buyer/user? Lets take a look at the example scenario below, and walk through a solution to achieve the desired result.

As a seller company, I sell two different memberships to my b2b ecommerce site. The first is Startup and the second is Enterprise. The Enterprise membership is considerably more expensive than the Startup membership, therefore I want to provide a slightly lower product pricing to my Enterprise customers. Specifically, Jane Doe from CloudTech has signed up for an Enterprise membership, and John Deer from ComputerDudes has signed up for a Startup membership.

How would we go about achieving this effect you might ask? After reviewing the considerations, let's dive in!

Considerations

  1. In our example, we will be assigning price schedules to products and parties at the Buyer level, however you can get even more granular than that, and assign Product/Price Schedule combinations at the User Group level within a single Buyer. This allows you further flexibility within your product visibility.

  2. This guide assumes that all products, categories and catalogs have been created successfully, with proper assignments. Make sure that your product is assigned to a catalog that the buyer's users have access to, or you will have issues when trying to create your product assignments. To verify that your product is assigned to your catalog, you can call GET /v1/catalogs/productassignments.

Create a Price Schedule

First, lets create the price schedule that is to be associated with the Enterprise membership. For this example, we'll use "USB Cord" as our Product.

Lets assume there is no tax or shipping costs, and the minimum order quantity is 1. Our call to the OrderCloud API should like this (If successful, our call should return a 201 Created response):

POST https://sandboxapi.ordercloud.io/v1/priceschedules HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8

{
  "ID": "enterprise-priceschedule-id",
  "Name": "USB Cord",
  "MinQuantity": 1,
  "PriceBreaks": [
    {
      "Quantity": 1,
      "Price": 3.99
    }
  ]
}

Next, lets make a similar call, but change the ID and PriceBreaks fields to adjust for the Startup configurations. The call should look like this:

POST https://sandboxapi.ordercloud.io/v1/priceschedules HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8

{
  "ID": "startup-priceschedule-id",
  "Name": "USB Cord",
  "MinQuantity": 1,
  "PriceBreaks": [
    {
      "Quantity": 1,
      "Price": 5.99
    }
  ]
}

Create a Product-PriceSchedule Assignment

Now that we have our two price schedules created, the next step is to create two different product assignments based on party. By making these product assignments, we are creating a special relationships between the product, a price schedule and different parties. Lets first assign the enterprise USB Cord price schedule and the CloudTech 'Buyer' party that is subject to Enterprise pricing. Both of these POST calls should garner 204 No Content responses if successful.

POST https://sandboxapi.ordercloud.io/v1/products/assignments HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8

{
  "ProductID": "usb-product-id",
  "BuyerID": "cloudtech",
  "PriceScheduleID": "enterprise-priceschedule-id"
}

Now that our connection between the Enterprise USB Cord Price Schedule, the CloudTech 'Buyer' and the USB Cord product has been made, lets wire up our second assignment.

POST https://sandboxapi.ordercloud.io/v1/products/assignments HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8

{
  "ProductID": "usb-product-id",
  "BuyerID": "computerdudes",
  "PriceScheduleID": "startup-priceschedule-id"
}

Now that all of our assignments have been made, lets verify that we have successfully created special relationships between our two different buyers, two different price schedules and our product: USB Cord. The next steps require that you authenticate as specific users. To check the contents of your authentication token, visit JWT.io.

In the context of Jane Doe from CloudTech, call GET https://sandboxapi.ordercloud.io/v1/me/products/usb-product-id, you should see the USB Cord product returned at the price of "Price": 3.99.

In the context of John Deer from ComputerDudes, call GET https://sandboxapi.ordercloud.io/v1/me/products/usb-product-id, you should see the same product returned at a different price of "Price": 5.99.

Conclusion

Congratulations! You now have the knowledge and background to make informed decisions about how to structure your Product -- multiple Price Schedule -- Buyer/UserGroup relationships, and how to make those assignments via the OrderCloud API.


Still have questions?
Ask in our Community Channel

Content Powered By
Sitecore Logo

© Copyright 2024, Sitecore OrderCloud®. All rights reserved.

Contact Us
Privacy Policy
Sitecore