Lab - Bulk Pricing Rules

Plan: Developer Foundations

Lesson 14 of 21 · 30 min

This lab activity will give you a chance to practice working with bulk pricing rules via the Catalog API. Each step will walk you through how to use all of the endpoints covered in the previous lesson.

Prerequisites:

  • BigCommerce store (sandbox or live)
  • Basic knowledge of APIs
  • REST client (Postman)
  • Completion of Catalog API labs 01 thru 05

In this lab, you will:

  • Add bulk pricing rules to a product
  • GET bulk pricing rules
  • Update bulk pricing rules

Add Bulk Pricing Rules to a Product

  1. Copy and paste the request below into Postman
https://api.bigcommerce.com/stores/{{store_hash}}/v3/catalog/products/:product_id/bulk-pricing-rules
  1. Enter the ID of the product created in previous lab for product_id in the Params tab
  2. Copy and paste the code below into the Body section of Postman
{
"quantity_min": 5,
"quantity_max": 0,
"type": "price",
"amount": 3
}
  1. Select POST next to the request url
  2. Click the Send button
  3. Observe response and bulk pricing added to product

Bulk pricing added to product

Bulk pricing example on storefront

GET Bulk Pricing Rules

  1. Copy andpaste the request below into Postman
https://api.bigcommerce.com/stores/{{store_hash}}/v3/catalog/products/:product_id/bulk-pricing-rules
  1. Enter the ID of the product created in previous lab for product_id in the Params tab
  2. Select GET next to the request url (if not already selected)
  3. Click the Send button
  4. Observe response and copy ID

Update Bulk Pricing Rules

  1. Copy and paste the request below into Postman
https://api.bigcommerce.com/stores/{{store_hash}}/v3/catalog/products/:product_id/bulk-pricing-rules/:rule_id
  1. Enter the ID of the product created in previous lab for product_id in the Params tab
  2. Enter the ID of the bulk pricing rule created in the previous step for rule_id in the Params tab
  3. Copy and paste the code below into the Body section of Postman
{
"quantity_min": 10,
"quantity_max": 50,
"type": "fixed",
"amount": 5
}
  1. Select PUT next to the request url
  2. Click the Send button
  3. Observe response and updated bulk pricing on the product