ShipperHQ Metafields
When you enable ShipperHQ on a store, additional fields become available on the product level:
- Shipping Groups (opens in a new tab)
- Origin Locations (opens in a new tab)
- Dimensional Rules (opens in a new tab)
These field values can be set in the control panel by the merchant as well as using one of the following:
If you duplicate a product (opens in a new tab) in the control panel and have ShipperHQ installed (opens in a new tab), metafields for ShipperHQ will be duplicated along with the product or variant.
ShipperHQ object properties
Property | Type | Values | Access |
---|---|---|---|
permission_set | string | This must be set to write . Setting to any other field will cause unintended behavior. | required |
key | enum | Members: shipping-groups , shipping-origins , shipping-dimensional-rules . | required |
value | JSON encoded string | This will be the name of the attribute type in ShipperHQ. Input the name exactly how it is listed within ShipperHQ. To pass in more than one Shipping Origin, Origin Location or Dimensional Rule, use an array with a comma-separated list. White spaces and special characters need to be escaped. Must be a JSON encoded string "[\"Origin Name from SHQ-1\",\" Origin Name from SHQ-2\"]" . | required |
namespace | string | This will always be shipping.shipperhq . | required |
resource_type | string | Either product or variant . | read only |
resource_id | string | ID of the product or variant . | read only |
description | string | ShipperHQ shipping origins associated with this product/sku. | read only |
date_created | string | Date and time of the metafield's creation. | read only |
date_modified | string | Date and time when the metafield was last updated. | read only |
id | number | ID of the metafield. | read only |
⚠️
Control panel behavior
When you set Shipping Origins using the API, you cannot delete the fields using the control panel. You must send a DELETE
request to the metafields resource.
Add ShipperHQ metafield
To add a ShipperHQ metafield, set the namespace
field to shipping.shipperhq
:
Example request: Add ShipperHQ metafield
POST https://api.bigcommerce.com/stores/{{store_hash}}/v3/catalog/products/{{product_id}}/metafields
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
{
"permission_set": "write",
"key": "shipping-origins",
"value": "[\"Alaska\",\"California\"]",
"namespace": "shipping.shipperhq"
}
Example response: Add ShipperHQ metafield
{
"data": [
{
"id": 51,
"key": "shipping-origins",
"value": "[\"Alaska\",\"California\"]",
"namespace": "shipping.shipperhq",
"permission_set": "write",
"resource_type": "product",
"resource_id": 214,
"description": "ShipperHQ shipping origins associated with this product/sku",
"date_created": "2018-07-19T17:56:08+00:00",
"date_modified": "2018-07-24T14:51:43+00:00"
},
{
"id": 52,
"key": "shipping-groups",
"value": "[\"SHIPPING GROUP NAME\"]",
"namespace": "shipping.shipperhq",
"permission_set": "write",
"resource_type": "product",
"resource_id": 214,
"description": "ShipperHQ shipping group rules associated with this product/sku",
"date_created": "2018-07-24T14:51:43+00:00",
"date_modified": "2018-07-24T14:51:43+00:00"
},
{
"id": 53,
"key": "shipping-dimensional-rules",
"value": "[\"DIMENSIONAL RULES NAME\"]",
"namespace": "shipping.shipperhq",
"permission_set": "write",
"resource_type": "product",
"resource_id": 214,
"description": "ShipperHQ dimensional rules associated with this product/sku",
"date_created": "2018-07-24T14:51:43+00:00",
"date_modified": "2018-07-24T14:51:43+00:00"
}
],
"meta": {
"pagination": {
"total": 3,
"count": 3,
"per_page": 50,
"current_page": 1,
"total_pages": 1,
"links": {
"current": "?page=1&limit=50"
}
}
}
}
Resources
Related endpoints
Related articles
- ShipperHQ (opens in a new tab) (Knowledge Base)
Did you find what you were looking for?