Sitecore OrderCloud Documentation

docs

Portal login

Default Buyer Catalog

In the previous chapter, you established API access for a new organization. During that process, you were asked to create a seller and buyer perspective. Throughout this chapter you should remain in the seller perspective that we authenticated with while in the "Making Your First Request" guide.

What is a Catalog?

Catalogs are a container of products and, optionally, categories. As a seller, your role is to sell products to your buyers through one or more catalogs. To do so, your catalog must be active and assigned to a buyer organization or user group.

When a buyer organization is created, a default catalog is automatically created along with it. You can find the ID of this catalog on the buyer organization model under DefaultCatalogID. The buyer you created in the last chapter should look something like this:

1{
2 "ID": "BUYER_ORGANIZATION",
3 "Name": "Example Buyer",
4 "DefaultCatalogID": "BUYER_ORGANIZATION",
5 "Active": true,
6 "DateCreated": "2021-02-08T23:01:03.57+00:00",
7 "xp": null
8}

Notice that DefaultCatalogID matches the buyer organization ID. OrderCloud will match IDs when possible.

Let's retrieve the default buyer catalog and look at it's properties:

Get the default catalog by ID
1GET https://sandboxapi.ordercloud.io/v1/catalogs/BUYER_ORGANIZATION HTTP/1.1
2Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
3Content-Type: application/json; charset=UTF-8;
1{
2 "ID": "BUYER_ORGANIZATION",
3 "OwnerID": "xxxxxxxxxxxxxxxxxx",
4 "Name": "Example Buyer",
5 "Description": "Default catalog for Example Buyer",
6 "Active": true,
7 "CategoryCount": 0,
8 "xp": null
9}

Here are some properties worth noting at this time:

  • OwnerID - The ID of the organization that owns the catalog (our seller organization ID)

  • Name - The catalog name, based on the name of the buyer organization

  • Active - Whether or not the catalog is accessible to the parties it's assigned to

Our catalog is currently active, which is what we want. If it were inactive it would be useless to our buyer organization. We will not be creating any categories for this example, as that can complicate our visibility rules down the line. So CategoryCount should remain at 0.

Catalog Assignments

Since our buyer organization uses this catalog as the DefaultCatalogID a catalog assignment was automatically created for us. The catalog assignment plays a major role in controlling the visibility of products to your buyers. These visibility rules are intentionally flexible and can get complicated quickly; therefore, we cover them in a separate guide. For now, we will focus on the most straightforward way of getting a product in front of your buyers.

FURTHER READING

Catalog Visibility Rules

Let's list the assignments for this catalog to see what OrderCloud created on our behalf:

List catalog assignments for the default catalog
1GET https://sandboxapi.ordercloud.io/v1/catalogs/assignments?catalogID=BUYER_ORGANIZATION HTTP/1.1
2Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
3Content-Type: application/json; charset=UTF-8;
1{
2 "Meta": {
3 "Page": 1,
4 "PageSize": 20,
5 "TotalCount": 1,
6 "TotalPages": 1,
7 "ItemRange": [
8 1,
9 1
10 ]
11 },
12 "Items": [
13 {
14 "CatalogID": "BUYER_ORGANIZATION",
15 "BuyerID": "BUYER_ORGANIZATION",
16 "ViewAllCategories": true,
17 "ViewAllProducts": true
18 }
19 ]
20}

We get back a single result that shows the relationship between our buyer organization and its default catalog. This is one of few assignment models in the API that have additional configuration properties. OrderCloud defaults both of these settings to true because this is the most inclusive way of defining catalog visibility for a buyer.

  • ViewAllCategories - When set to true, every category in the catalog will be visible to the assigned party without a category assignment.

  • ViewAllProducts - When set to true, every product assigned to the catalog will be visible to the assigned party without a product assignment.

When creating a more finely tuned catalog, where some buyer users should see categories or products that are hidden for others, these settings are usually turned off and more granular assignments are made between the buying parties and the products/catalogs they should see. For the purposes of keeping this example simple, we will keep these set to true and move on.


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