Locations
Get Metafields
GET /stores/{store_hash}/v3/inventory/locations/{location_id}/metafields
Request
Retrieve metafields for a location.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- location_id in path - stringrequired
- location_id in path - integerrequired
Unique identifier for a location.
example
Response
The request has been successfully processed.
Body
dataarray[object]
metaobject
Create a Metafield
POST /stores/{store_hash}/v3/inventory/locations/{location_id}/metafields
Request
Create a location metafield.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- location_id in path - stringrequired
- location_id in path - integerrequired
Unique identifier for a location.
- Content-Type in header with default of application/json - stringrequired
The MIME type of the request body.
Body
Common metafield properties.
keystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: status
valuestring
>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: upcoming
namespacestring
>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: headquarters
permission_setstring
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 the storefront. write_and_sf_access
Open for reading and writing by other API consumers, including on the storefront. Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access
descriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
example
Response
The request has been successfully processed.
Body
data
Allows app partners to write custom data to various resources in the API.
metaobject
Get a Metafield
GET /stores/{store_hash}/v3/inventory/locations/{location_id}/metafields/{metafield_id}
Request
Get a metafield by location.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- location_id in path - integerrequired
Unique identifier for a location.
- metafield_id in path - integerrequired
Unique identifier for a metafield.
example
Response
The request has been successfully processed.
Body
data
Allows app partners to write custom data to various resources in the API.
metaobject
Update a Metafield
PUT /stores/{store_hash}/v3/inventory/locations/{location_id}/metafields/{metafield_id}
Request
Update a metafield.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- location_id in path - integerrequired
Unique identifier for a location.
- metafield_id in path - integerrequired
Unique identifier for a metafield.
Body
Common metafield properties.
keystring
>= 1 characters<= 64 charactersThe name of the field, for example:
location_id
,color
.Example: status
valuestring
>= 1 characters<= 65535 charactersThe value of the field, for example:
1
,blue
.Example: upcoming
namespacestring
>= 1 characters<= 64 charactersNamespace for the metafield, for organizational purposes.
Example: headquarters
permission_setstring
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 the storefront. write_and_sf_access
Open for reading and writing by other API consumers, including on the storefront. Allowed: app_only | read | write | read_and_sf_access | write_and_sf_access
descriptionstring
>= 0 characters<= 255 charactersDescription for the metafields.
example
Response
The request has been successfully processed.
Body
data
Allows app partners to write custom data to various resources in the API.
metaobject
Delete a Metafield
DELETE /stores/{store_hash}/v3/inventory/locations/{location_id}/metafields/{metafield_id}
Request
Delete a metafield.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- location_id in path - integerrequired
Unique identifier for a location.
- metafield_id in path - integerrequired
Unique identifier for a metafield.
example
Response
No Content