List a product's attribute links
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/products/1/attributes';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/stores/example/products/1/attributes \ --header 'x-api-key: <x-api-key>'Returns the attributes attached to the product, in display order, with the values the product uses for each. Library attributes carry an attribute_id; local ones carry a custom_name.
Required scopes: read:products
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The product ID.
The store’s ref, as returned by GET /stores.
Responses
Section titled “Responses”object
The values the product uses for this attribute.
object
Stable key of the value within the link.
Value as shown to shoppers.
Swatch kind: none, color or image.
Swatch content: a color code or an image URL. Empty when there is no swatch.
ID of the library value, or null for a local value.
Code of the global taxonomy value this one maps to, or null.
Link ID. Use it to remove the link.
Display position of the attribute on the product.
Group label the attribute is shown under, or null.
Whether the attribute is shown on the storefront.
Whether the attribute drives the product’s variants.
ID of the library attribute, or null for a local attribute.
Name of the local attribute, or null for a library attribute.
The attribute’s name, whether library or local.
Code of the global taxonomy attribute this one maps to, or null.
Example generated
[ { "values": [ { "key": "example", "display": "example", "swatch_type": "example", "swatch_value": "example", "attribute_value_id": 1, "taxonomy_value_code": "example" } ], "id": 1, "position": 1, "group": "example", "is_visible": true, "is_variation": true, "attribute_id": 1, "custom_name": "example", "name": "example", "taxonomy_attribute_code": "example" }]The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The resource does not exist in this store.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}