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

Big Commerce Stock Update

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

Stock Update

The stock updates can be sent in bulk and we want to be able to push up to 1000 products per request. We want stock updates and zero stock updates to be as per our standards. We want all triggers, validations and standardizations to be a per Stock Update general requirementsAPI Call: PUT https://api.bigcommerce.com/stores/{store_hash}/v3/inventory/adjustments/absolute

Docs: https://developer.bigcommerce.com/buy-online-pick-up-in-store/rest-management/inventory/adjustments#absolute-adjustment

Sample Request: PUT https://api.bigcommerce.com/stores/oduzegjfvn/v3/inventory/adjustments/absolute

Body:

{
  "reason": "Absolute adjustment reason",
  "items": [
    {
      "location_id": 1,
      "sku": 1,
      "quantity": 1
    },
    {
      "location_id": 1,
      "sku": 3,
      "quantity": 1
    },
    {
      "location_id": 1,
      "sku": "sku-4",
      "quantity": 1
    },
    {
      "location_id": 1,
      "sku": "sku-5",
      "quantity": 1
    },
    {
      "location_id": 1,
      "sku": 111,
      "quantity": 7
    }
  ]
}

Mapping:

Big Commerce Field Hemi Field Required Comment
reason Absolute adjustment reason Yes Hardcoded as “Absolute adjustment reason
items
location_id Big Commerce Account > Big Commerce Location Yes If no location is selected we want to return an error in Product Account > Error Updating Quantity or Product Account > Error End Item
sku Product > SKU Yes
quantity Product Account > Quantity Yes

Sample Response: Status 200 OK

{
    "transaction_id": "97a73cdd-9fc5-4aa5-892c-4ead8259c24e"
}

We treat this as success and we do not want to store anything.

Sample Error Response #1:

{
    "status": 422,
    "title": "Location not found, identities: [3,2]",
    "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes",
    "errors": {}
}

Sample Error Response #2:

{
    "status": 422,
    "title": "Items with identity: [sku sku-5,sku sku-4] not exists",
    "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes",
    "errors": {}
}

Sample Error Response #3:

{
    "status": 422,
    "title": "JSON data is missing or invalid",
    "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes",
    "errors": {
        "items.0.sku": "error.expected.jsstring"
    }
}

We want to store the title as error in Product Account > Error Updating Quantity or Product Account > Error End Item

Is this article helpful?
0 0 0