1. Product catalogs

Creating your first product

Now that we have confirmed the default catalog is in place with the ViewAllProducts setting set to true, we can begin populating it with products. Continue operating from the seller perspective, which has the required roles for managing products, product assignments, and price schedules.

What is a product?

A product in OrderCloud represents a physical, digital, or abstract good that is offered for sale by a seller organization and is purchasable by buyer users via an order. Creating a new product only requires a Name; everything else is optional. However, a product without an assigned or default price schedule is not purchasable.

What is a price schedule?

OrderCloud separates products from price to allow the same product to be sold across multiple channels at varying prices. A price schedule can include quantity price breaks, min and max quantity per order, whether to apply tax or shipping calculations, or to what type of order the price schedule applies.

For simpler solutions, you can tie a product directly to a price schedule using the DefaultPriceSchedule property. Products with a DefaultPriceSchedule eliminate the need to create product assignments between the buyers that access the product through a catalog with ViewAllProducts set to true. You can still create more specific product assignments if you wish to override the default price for a certain buyer party.

Creating the product

For this streamlined example, create a purchasable product in the simplest way possible by using the DefaultPriceSchedule field.

First, create the product. Because we do not have a price schedule yet, leave that field out for now.

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

{
    "ID": "SHIRT",
    "Name": "Cotton T-Shirt",
    "Description": "A plain white, cotton shirt for everyday use.",
    "Active": true
}

The response looks like this:

json
{
	"OwnerID": "xxxxxxxxxxxxxxxxxx",
	"DefaultPriceScheduleID": null,
	"AutoForward": false,
	"ID": "SHIRT",
	"Name": "Cotton T-Shirt",
	"Description": "A plain white, cotton shirt for everyday use.",
	"QuantityMultiplier": 1,
	"ShipWeight": null,
	"ShipHeight": null,
	"ShipWidth": null,
	"ShipLength": null,
	"Active": true,
	"SpecCount": 0,
	"VariantCount": 0,
	"ShipFromAddressID": null,
	"Inventory": null,
	"DefaultSupplierID": null,
	"AllSuppliersCanSell": false,
	"xp": null
}

OrderCloud has populated certain non-nullable values:

  • OwnerID - The organization that owns this product (our seller organization ID)
  • QuantityMultiplier - This field does not affect any functionality. If we were selling a pack of 5 shirts, we might change this value to 5 to indicate that in the user experience.
  • AutoForward - This field is relevant to solutions that use suppliers; no need to worry about it now.

In a production solution you would likely include things like inventory, shipping measurements, and ship-from address (for estimating shipping cost), but we are not creating any integrations for this example so we left them blank.

If the shirt came in multiple sizes or colors, you would likely create a new spec and assign it to the product. To keep this simple, product specs and variants will be covered in future guides.

Adding a default price schedule

Now that we know what product we are working with, create a reasonable price for it. Do this by creating a new Price Schedule and then PATCH the product we created with the resulting price schedule ID.

OrderCloud price schedules are flexible API resources that are covered more thoroughly in the knowledge base.

See Same product, multiple price schedules for more information.

Their most basic form consists of an ID, Name, and one or more price breaks. Price breaks allow seller users to provide different prices based on the quantity being ordered.

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

{
    "ID": "SHIRT_PRICE",
    "Name": "Cotton T-Shirt Price",
    "PriceBreaks": [
        {
            "Quantity": 1,
            "Price": 10
        }
    ]
}
Update the default price schedule ID
PATCH https://sandboxapi.ordercloud.io/v1/products/SHIRT HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8;

{
    "DefaultPriceScheduleID": "SHIRT_PRICE"
}

You have created your first OrderCloud product and price schedule. Your product is not visible to your buyer user yet. See Making your product visible to learn more about product visibility.

If you have suggestions for improving this article, let us know!