Marketplaces / Big Commerce Technical Scope / Big Commerce Product Management / Big Commerce Update Price

Big Commerce Update Price

Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)

Date Version Name Applied changes
09/08/2023 1.0 Bogomil Pavlov First Publish

There are two types of price updates one is for products and one for variants.

Update Product Price

The product price updates can be sent in bulk and we want to be able to push up to 10 products per request. We want all triggers, validations and standardizations to be as per Price Update General requirements

The only difference is we want to use this request only if Product Account > Variation Group is empty

API Call: PUT https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products Doc: https://developer.bigcommerce.com/docs/rest-catalog/products#update-products-batch

Sample Request: PUT https://api.bigcommerce.com/stores/oduzegjfvn/v3/catalog/products Body:

[
  {
    "id": 107,
    "price": 10,
    "cost_price": 10,
    "sale_price": 10
      },
      {
    "id": 106,
    "price": 10,
    "cost_price": 10,
    "sale_price": 10
      }
]

Mapping:

Big Commerce Field Hemi Field Required Comment
id Product Account > Channel Item Id Yes
price Product Account > Price

OR Product Account > RRP | Yes | If RRP <= Price we push Product Account > Price If RRP > Price we push Product Account > RRP | | cost_price | Product Account > Original Price | No | | | sale_price | Product Account > Price | No | If RRP > Price we want to push this field as Product Account > Price If RRP <= Price we include the sale_price with value 0 |

Sample Response: Status 200 OK

{
    "data": {
        "id": 107,
        "name": "Smith Journal 13",
        "type": "physical",
        "sku": "DPB",
        "description": "<p>A seemingly simple dustpan with a few features to make life easier. The arch and length of the dustpan eases cleanup, the wood turned handle provides firm grip and the rubber liner along the edge of the scoop will retrieve small crumbs with a single swipe. A key ring at the top makes storage a cinch - hang it off a broom closet hook when not in use.</p>\n<p>Dustpan Measures 45 cm/17.7 in</p>",
        "weight": 1,
        "width": 0,
        "depth": 0,
        "height": 0,
        "price": 11,
        "cost_price": 11,
        "retail_price": 0,
        "sale_price": 11,
        "map_price": 0,
        "tax_class_id": 0,
        "product_tax_code": "",
        "calculated_price": 11,
        "categories": [
            23,
            22
        ],
        "brand_id": 36,
        "option_set_id": null,
        "option_set_display": "right",
        "inventory_level": 0,
        "inventory_warning_level": 0,
        "inventory_tracking": "none",
        "reviews_rating_sum": 0,
        "reviews_count": 0,
        "total_sold": 0,
        "fixed_cost_shipping_price": 0,
        "is_free_shipping": false,
        "is_visible": true,
        "is_featured": false,
        "related_products": [
            -1
        ],
        "warranty": "",
        "bin_picking_number": "0",
        "layout_file": "product.html",
        "upc": "",
        "mpn": "",
        "gtin": "",
        "search_keywords": "",
        "availability": "available",
        "availability_description": "",
        "gift_wrapping_options_type": "any",
        "gift_wrapping_options_list": [],
        "sort_order": 0,
        "condition": "New",
        "is_condition_shown": false,
        "order_quantity_minimum": 0,
        "order_quantity_maximum": 0,
        "page_title": "",
        "meta_keywords": [],
        "meta_description": "",
        "date_created": "2015-07-03T18:56:16+00:00",
        "date_modified": "2023-08-10T23:18:09+00:00",
        "view_count": 7,
        "preorder_release_date": null,
        "preorder_message": "0",
        "is_preorder_only": false,
        "is_price_hidden": false,
        "price_hidden_label": "0",
        "custom_url": {
            "url": "/dustpan-brush/",
            "is_customized": false
        },
        "base_variant_id": 73,
        "open_graph_type": "product",
        "open_graph_title": "",
        "open_graph_description": "",
        "open_graph_use_meta_description": true,
        "open_graph_use_product_name": true,
        "open_graph_use_image": true
    },
    "meta": {}
}

Sample Error Response #1:

{
    "status": 422,
    "code": 20200,
    "title": "Bulk operation has failed",
    "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes",
    "errors": {
        "1": "A product with the id of 106 was not found"
    }
}

Please note if we have a batch of 10 products and even one of them returns error nothing is updated.

Also if we have a batch of 10 products and 2 of them are with incorrect ids we will receive first the error for the first product then once we fix it the another error will be received. Thus we just want to store the errorsmessage as Product Account > Update Price Error for all products in the batch but if for some reason the there are no errors we want to store the title

Update Variant Price

The price variants updates are variant per variant. We want all triggers, validations and standardizations to be a per Price Update General requirements

The only difference is we want to use this request only if Product Account > Variation Group is NOT empty

API Call: PUT https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/products/{product_id}/variants/{variant_id} Doc: https://developer.bigcommerce.com/docs/rest-catalog/product-variants#update-a-product-variant

Sample Request: PUT https://api.bigcommerce.com/stores/oduzegjfvn/v3/catalog/products/121/variants/95

Body:

 {
      "cost_price": 4,
      "price": 5,
      "sale_price": 6

}
Big Commerce Field Hemi Field Required Comment
product_id Product Account > Channel Item Id Yes
variant_id Product Account Big Commerce > Variant Id Yes If this field is missing we want to return internal error.

Mapping:

Big Commerce Field Hemi Field Required Comment
price Product Account > Price

OR Product Account > RRP | Yes | If RRP <= Price we push Product Account > Price If RRP > Price we push Product Account > RRP | | cost_price | Product Account > Original Price | No | | | sale_price | Product Account > Price | No | If RRP > Price we want to push this field as Product Account > Price If RRP <= Price we include the sale_price with value 0 |

Sample Response: Status 200 OK

{
    "data": {
        "id": 95,
        "product_id": 121,
        "sku": "765124q3",
        "sku_id": 135,
        "price": 5,
        "calculated_price": 6,
        "sale_price": 6,
        "retail_price": 60,
        "map_price": null,
        "weight": null,
        "calculated_weight": 1,
        "width": null,
        "height": null,
        "depth": null,
        "is_free_shipping": false,
        "fixed_cost_shipping_price": null,
        "purchasing_disabled": false,
        "purchasing_disabled_message": "",
        "image_url": "",
        "cost_price": 4,
        "upc": "12345678",
        "mpn": "1234567890",
        "gtin": "012345678905",
        "inventory_level": 2,
        "inventory_warning_level": 0,
        "bin_picking_number": "",
        "option_values": [
            {
                "id": 117,
                "label": "Beige",
                "option_id": 124,
                "option_display_name": "Color"
            },
            {
                "id": 119,
                "label": "42",
                "option_id": 125,
                "option_display_name": "Size"
            }
        ]
    },
    "meta": {}
}

Sample Error Response #1:

{
    "status": 404,
    "code": 22001,
    "title": "No variants with id 9777 found for product id 121",
    "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes"
}

We want to store the title as error in Product Account > Update Price Error

Additional Information:

For this integration we will need to make sure the protect flags are working as expected:

Protect Price (Stop all price updates) Protect the whole item - Stop all price updates Closed -will stop all the updates to the MPs

Is this article helpful?
0 0 0