POST /catalog/products/{product_id}/metafields

Creates a Product Metafield.

Required Fields:

Note: The maxiumum number of metafields allowed on each order, product, category, variant, or brand is 250 per client ID. For more information, see Platform Limits in the Help Center.

Servers

Path parameters

Name Type Required Description
product_id Integer Yes

The ID of the Product to which the resource belongs.

Request headers

Name Type Required Description
Accept String Yes

The MIME type of the response body.

Default value: "application/json"

Content-Type String Yes

The MIME type of the request body.

Default value: "application/json"

Query parameters

Name Type Required Description
key:in[] Array No

Filter based on comma-separated metafieldʼs keys. Could be used with vanilla key query parameter.

date_created:max String No

'Query parameter that lets you filter by the maximum date created, for example, 2024-05-14T09:34:00 or 2024-05-14. Returns metafields created before this date.'

include_fields[] Array No

Fields to include, in a comma-separated list. The ID and the specified fields will be returned.

date_modified:max String No

'Query parameter that lets you filter by the maximum date modified created, for example, 2024-05-14T09:34:00 or 2024-05-14. Returns metafields modified before this date.'

before String No

A cursor indicating where to start retrieving the previous page of results. Use this parameter to paginate backward. Not required for the initial request. For subsequent requests, use the end_cursor value returned in meta.cursor_pagination from the previous response. Works with limit, direction, and other supported query parameters. When specified, offset-based pagination (page) is ignored. Cannot be used in combination with the after parameter.

page Integer No

Specifies the page number in a limited (paginated) list of products.

date_modified:min String No

'Query parameter that lets you filter by the minimum date modified created, for example, 2024-05-14T09:34:00 or 2024-05-14. Returns metafields modified after this date.'

limit Integer No

Controls the number of items per page in a limited (paginated) list of products.

Default value: 50

namespace String No

Filter based on a metafieldʼs namespaces.

namespace:in[] Array No

Filter based on comma-separated metafieldʼs namespaces. Could be used with vanilla namespace query parameter.

direction String No

Sort direction. Acceptable values are: asc, desc.

Valid values:

  • "desc"
  • "asc"
key String No

Filter based on a metafieldʼs key.

after String No

A cursor indicating where to start retrieving the next page of results. Use this parameter to paginate forward. Not required for the initial request. For subsequent requests, use the start_cursor value returned in meta.cursor_pagination from the previous response. Works with limit, direction, and other supported query parameters. When specified, offset-based pagination (page) is ignored. Cannot be used in combination with the before parameter.

date_created:min String No

'Query parameter that lets you filter by the minimum date created, ffor example, 2024-05-14T09:34:00 or 2024-05-14. Returns metafields created after this date.'

Request body fields

Name Type Required Description
namespace String Yes

Namespace for the metafield, for organizational purposes. This is set by the developer. Required for POST.

description String No

Description for the metafields.

key String Yes

The name of the field, for example: location_id, color. Required for POST.

value String Yes

The value of the field, for example: 1, blue. You must enter a JSON formatted string for ShipperHQ metafields. Required for POST.

permission_set String Yes

Determines the visibility and writeability of the field by other API consumers.

|Value|Description |-|-| |app_only|Private to the app that owns the field| |read|Visible to other API consumers| |write|Open for reading and writing by other API consumers| |read_and_sf_access|Visible to other API consumers, including on storefront| |write_and_sf_access|Open for reading and writing by other API consumers, including on storefront|

Valid values:

  • "read"
  • "write_and_sf_access"
  • "write"
  • "read_and_sf_access"
  • "app_only"

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.