Get the signed-in customer's metafields
const url = 'https://apibase.ecomweb.app/api/v1/tenant/stores/example/customers/metafields';const options = { method: 'GET', headers: { 'x-storefront-api-key': '<x-storefront-api-key>', Authorization: 'Bearer <token>' }};
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/tenant/stores/example/customers/metafields \ --header 'Authorization: Bearer <token>' \ --header 'x-storefront-api-key: <x-storefront-api-key>'Returns the custom field values the store has set on the signed-in shopper’s customer record and that the store lets shoppers read. The result is keyed by namespace.key, each entry with its type and value, and is empty when there are none.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Responses
Section titled “Responses”The metafields the shopper may read, keyed by namespace.key.
object
object
The metafield’s type, such as single_line_text_field or list.number_integer.
Example generated
{ "additionalProperty": { "value": {}, "type": "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"}