Skip to content
Reponse.ai LogoDocs
DocsAPISDKsGuides

Search Documentation

Search for an article...

Getting Started

  • Overview
  • Architecture
  • Installation
  • Authentication
  • First Request

Products & Collections

  • Products — List
  • Products — Get
  • Products — Metafields
  • Collections — List
  • Collections — Get
  • Collections — Products

Cart & Checkout

  • Cart — Create
  • Cart — Get
  • Cart — Add Item
  • Cart — Update Item
  • Cart — Remove Item
  • Cart — Apply Promotion
  • Checkout — Stripe
  • Checkout — Payment Intent
  • Checkout — ACP

Orders & Fulfillment

  • Orders — Create
  • Orders — Get
  • Orders — Confirm
  • Orders — Cancel
  • Orders — Fulfill
  • Orders — Refund

Commerce

  • Inventory — Get
  • Inventory — Update
  • Shipping — Rates
  • Discounts — List
  • Discounts — Create
  • Discounts — Validate
  • Subscriptions — Manage

Loyalty & Gift Cards

  • Loyalty — Balance
  • Loyalty — Redeem
  • Loyalty — Referral
  • Gift Cards — List
  • Gift Cards — Redeem

Tickets & Support

  • Tickets — List
  • Tickets — Create
  • Tickets — Reply

Platform

  • Product Feed — JSON
  • Product Feed — CSV
  • Theme — Get
  • Approvals — Execute
  • Approvals — Reject
  • Geocode

SDKs

  • SDK Overview
  • TypeScript SDK
  • React Hooks

Guides

  • Chat Widget
  • Shopify Sync
  • Storefront Starter
  • Loyalty Program
  • Discounts & Promotions
  • Subscriptions
  • Klaviyo Integration
  • Custom Domains
  • Agentic Commerce (ACP)
  • A2A Protocol
  • AI Engines
  • MCP Server

Webhooks

  • Webhooks Overview
  • Events Reference
  • Shopify Webhooks
  • Stripe Webhooks
  • Reviews (Stamped / Trustpilot)
  • Logistics
  • Email Inbound

Resources

  • Environment Variables
  • Rate Limits
  • Changelog
DocsProducts & CollectionsProducts — Metafields

Products — Metafields

Product metafields and extended attributes.

2 min read/Last updated Jul 9, 2026
On this page

Overview

Metafields store **extended, structured attributes** on products beyond the core fields — specifications, care instructions, Google product category, ingredients, and more. They are synced from Shopify and surfaced for SEO (JSON-LD structured data) and AI grounding (giving engines more facts to answer shopper questions accurately).

Authentication

All metafield endpoints require a valid API key with `read:products` (for GET) or `write:products` (for PATCH) scopes.

Authorization: Bearer rp_live_xxxxxxxxxxxx

GET metafields

Retrieve all metafields for a product.

Request

GET /v1/products/:productId/metafields
ParameterInTypeRequiredDescription
productIdpathstringYesProduct ID
namespacequerystringNoFilter by namespace (e.g. custom)
keyquerystringNoFilter by key (e.g. care_instructions)

Response

json
{
  "data": [
    {
      "id": "mf_abc123",
      "namespace": "custom",
      "key": "care_instructions",
      "value": "Machine wash cold, tumble dry low",
      "type": "single_line_text",
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-03-20T14:00:00Z"
    },
    {
      "id": "mf_def456",
      "namespace": "custom",
      "key": "material_composition",
      "value": "{\"cotton\": 80, \"polyester\": 20}",
      "type": "json",
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "total": 2
  }
}

Code examples

**cURL:**

bash
curl -X GET "https://api.reponse.ai/v1/products/prod_xxx/metafields?namespace=custom" \
  -H "Authorization: Bearer rp_live_xxxxxxxxxxxx"

**TypeScript (SDK):**

typescript
const { data: metafields } = await reponse.catalog.getMetafields({
  path: { productId: 'prod_xxx' },
  query: { namespace: 'custom' },
});

for (const mf of metafields) {
  console.log(`${mf.namespace}.${mf.key} = ${mf.value}`);
}

PATCH metafields

Create or update metafields on a product. If a metafield with the same `namespace` + `key` already exists, it is updated; otherwise a new one is created (upsert behavior).

Request

PATCH /v1/products/:productId/metafields
ParameterInTypeRequiredDescription
productIdpathstringYesProduct ID

**Body:**

json
{
  "metafields": [
    {
      "namespace": "custom",
      "key": "care_instructions",
      "value": "Hand wash only, do not bleach",
      "type": "single_line_text"
    },
    {
      "namespace": "custom",
      "key": "weight_grams",
      "value": "250",
      "type": "number_integer"
    }
  ]
}

Response

json
{
  "data": [
    {
      "id": "mf_abc123",
      "namespace": "custom",
      "key": "care_instructions",
      "value": "Hand wash only, do not bleach",
      "type": "single_line_text",
      "updatedAt": "2026-05-27T10:00:00Z"
    },
    {
      "id": "mf_ghi789",
      "namespace": "custom",
      "key": "weight_grams",
      "value": "250",
      "type": "number_integer",
      "createdAt": "2026-05-27T10:00:00Z",
      "updatedAt": "2026-05-27T10:00:00Z"
    }
  ]
}

Code examples

**cURL:**

bash
curl -X PATCH "https://api.reponse.ai/v1/products/prod_xxx/metafields" \
  -H "Authorization: Bearer rp_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "metafields": [
      {
        "namespace": "custom",
        "key": "care_instructions",
        "value": "Hand wash only",
        "type": "single_line_text"
      }
    ]
  }'

**TypeScript (SDK):**

typescript
await reponse.catalog.updateMetafields({
  path: { productId: 'prod_xxx' },
  body: {
    metafields: [
      {
        namespace: 'custom',
        key: 'care_instructions',
        value: 'Hand wash only',
        type: 'single_line_text',
      },
    ],
  },
});

Namespace / key pattern

Metafields follow a `namespace.key` naming convention:

NamespacePurposeExamples
customMerchant-defined fieldscustom.care_instructions, custom.material
shopifySynced from Shopify metafieldsshopify.google_product_category
specsTechnical specificationsspecs.battery_capacity, specs.screen_size
complianceRegulatory compliancecompliance.oeko_tex, compliance.origin_country
dimensionsPhysical dimensionsdimensions.length, dimensions.width
seoSEO-specific metadataseo.title_override, seo.description_override
aiAI grounding dataai.product_facts, ai.usage_scenarios

**Naming rules:**

  • Namespaces: lowercase, alphanumeric with underscores, max 64 characters
  • Keys: lowercase, alphanumeric with underscores, max 128 characters
  • Combined: namespace.key must be unique per product
  • Maximum 50 metafields per product

Value types

TypeDescriptionExample value
single_line_textPlain text, single line"Machine wash cold"
multi_line_textPlain text, multiple lines"Line 1\nLine 2"
number_integerInteger number"250"
number_decimalDecimal number"19.99"
booleanBoolean value"true"
jsonArbitrary JSON"{\"cotton\": 80}"
dateISO 8601 date"2026-06-01"
urlValid URL"https://example.com"
colorHex color code"#FF5733"
dimensionValue with unit"{\"value\": 30, \"unit\": \"cm\"}"
weightValue with unit"{\"value\": 250, \"unit\": \"g\"}"
**Note:** All values are stored as strings. The `type` field determines how the value is validated, displayed, and used in structured data.

How metafields are used

ConsumerUsage
JSON-LD structured dataMetafields like google_product_category, material, weight are mapped to Schema.org properties
AI enginesProduct metafields are injected into the system prompt as [PRODUCT_ATTRIBUTES] for accurate answers
Storefront displayMetafields can be rendered in product detail templates via the headless API
Search & filtersNumeric and enum metafields can power faceted search
Shopify syncMetafields from Shopify are automatically synced with namespace: "shopify"

Metafields in product responses

Metafields are **included by default** in the product detail endpoint (`GET /v1/products/:id`).

For the product list endpoint (`GET /v1/products`), metafields are **excluded by default** to keep responses lightweight. Add `?include=metafields` to include them:

GET /v1/products?include=metafields

Error codes

CodeStatusDescription
UNAUTHORIZED401Missing or invalid API key
FORBIDDEN403Key lacks write:products scope
PRODUCT_NOT_FOUND404Product ID does not exist
INVALID_NAMESPACE422Namespace contains invalid characters
INVALID_KEY422Key contains invalid characters or exceeds max length
INVALID_VALUE_TYPE422Value does not match the declared type
DUPLICATE_METAFIELD409Multiple metafields with same namespace+key in a single request
METAFIELD_LIMIT422Product already has 50 metafields
RATE_LIMITED429Too many requests
PreviousProducts — Get
NextCollections — List