1. Buyer perspective

Viewing products

Listing buyer products

Retrieve a list of products available to our buyer user.

Get a list of buyer products
http
GET https://sandboxapi.ordercloud.io/v1/me/products HTTP/1.1
Authorization: Bearer INSERT_ACCESS_TOKEN_HERE
Content-Type: application/json; charset=UTF-8

Notice we did not pass any parameters yet. The response looks like this:

json
{
  "Meta": {
    "Facets": [],
    "Page": 1,
    "PageSize": 20,
    "TotalCount": 1,
    "TotalPages": 1,
    "ItemRange": [
      1,
      1
    ]
  },
  "Items": [
    {
      "PriceSchedule": {
        "ID": "SHIRT_PRICE",
        "Name": "Cotton T-Shirt Price",
        "ApplyTax": false,
        "ApplyShipping": false,
        "MinQuantity": 1,
        "MaxQuantity": null,
        "UseCumulativeQuantity": false,
        "RestrictedQuantity": false,
        "PriceBreaks": [
          {
            "Quantity": 1,
            "Price": 10
          }
        ],
        "xp": null
      },
      "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
    }
  ]
}

As you can see, OrderCloud has flattened the relationships between our buyer user and the SHIRT product. The buyer user's organization, BUYER_ORGANIZATION, has the default catalog BUYER_ORGANIZATION, which has the SHIRT product assigned to it with a default price schedule of SHIRT_PRICE.

Product model

My Products introduces a new OrderCloud model called BuyerProduct. This type of product has a price schedule attached as a sub-object, allowing developers quick access to pricing information without needing to make additional API calls.

List page with facets

Another interesting part of this response model is the Facets property within the Meta information. Facets are unique to resources that have been enhanced with elastic search in OrderCloud's backend. This topic is covered in other reading.

See Introducing premium search for more information.

Browsing other catalogs

The buyer product list request provides a way for buyer users to browse other product catalogs (when assigned to more than just their organization's default catalog). This can be done using the CatalogID option.

Browsing by category

If one of these other catalogs had categories in it, you can filter buyer products by category using the CategoryID property.

See Buyer Product List Parameters for more information.

Creating a unique experience entirely depends on how you take advantage of the parameters available to you. You can create a faceted product search, a category browse experience, or something completely custom using advanced querying.

See Advanced querying for more information.

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