Creating Your First Product
Now that we've confirmed the default catalog in place with the ViewAllProducts
setting set to true, we can begin populating it with products. We will 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 purchase-able 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 purchase-able.
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 may 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
circumvent the need to create any 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 our streamlined example we would like to create a purchase-able product in the easiest way possible. This means we will want to take advantage of the DefaultPriceSchedule
field.
First, let's create the product. Since we don't have a price schedule yet, we'll leave that field out for now.
Create a new product
1POST https://sandboxapi.ordercloud.io/v1/products HTTP/1.12Authorization: Bearer INSERT_ACCESS_TOKEN_HERE3Content-Type: application/json; charset=UTF-8;45{6 "ID": "SHIRT",7 "Name": "Cotton T-Shirt",8 "Description": "A plain white, cotton shirt for everyday use.",9 "Active": true10}
Your response should look something like this:
1{2 "OwnerID": "xxxxxxxxxxxxxxxxxx",3 "DefaultPriceScheduleID": null,4 "AutoForward": false,5 "ID": "SHIRT",6 "Name": "Cotton T-Shirt",7 "Description": "A plain white, cotton shirt for everyday use.",8 "QuantityMultiplier": 1,9 "ShipWeight": null,10 "ShipHeight": null,11 "ShipWidth": null,12 "ShipLength": null,13 "Active": true,14 "SpecCount": 0,15 "VariantCount": 0,16 "ShipFromAddressID": null,17 "Inventory": null,18 "DefaultSupplierID": null,19 "AllSuppliersCanSell": false,20 "xp": null21}
OrderCloud has taken care of defaulting 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 may change this value to 5 to indicate that in the user experience.AutoForward
- This field is relevant to solutions that take advantage of suppliers, no need to worry about it now.
In a real solution you would likely include things like inventory, shipping measurements, and ship-from address (for estimating shipping cost), but we are not going to be 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. Once again, 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, let's come up with a reasonable price for it. We 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 another one of those flexible API resources that are covered more thoroughly in the knowledge base.
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
1POST https://sandboxapi.ordercloud.io/v1/priceschedules HTTP/1.12Authorization: Bearer INSERT_ACCESS_TOKEN_HERE3Content-Type: application/json; charset=UTF-8;45{6 "ID": "SHIRT_PRICE",7 "Name": "Cotton T-Shirt Price",8 "PriceBreaks": [9 {10 "Quantity": 1,11 "Price": 1012 }13 ]14}
Update the default price schedule ID
1PATCH https://sandboxapi.ordercloud.io/v1/products/SHIRT HTTP/1.12Authorization: Bearer INSERT_ACCESS_TOKEN_HERE3Content-Type: application/json; charset=UTF-8;45{6 "DefaultPriceScheduleID": "SHIRT_PRICE"7}
Congratulations! You've just created your first OrderCloud product and price schedule. Your product isn't quite visible to your buyer user yet, though. Visit our guide "Making Your Product Visible" to learn more on product visibility.
Still have questions?
Ask in our Community Channel