Skip to main content
PUT
/
api
/
v1
/
metafields
/
:id.json
Update Metafield
curl --request PUT \
  --url https://api.launchmystore.io/api/v1/metafields/:id.json \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "value": "<any>",
  "type": "<string>"
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Update Metafield

Updates the value (and optionally type) of a metafield owned by your app. The metafield is matched by id and appId — you cannot update metafields written by other apps or by merchants.

Request

curl -X PUT "https://api.launchmystore.io/api/v1/metafields/<metafieldId>.json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "NEW BADGE VALUE",
    "type": "single_line_text_field"
  }'

Required scope

write_metafields

Path parameters

id
string
required
The metafield’s UUID (the id field from list/create responses).

Body parameters

value
any
The new value. Scalars sent as-is; compounds sent as JSON. Must validate against the (current or new) type.
type
string
Optional new type. The new value must validate against it.
namespace, key, ownerType, and ownerId cannot be changed. Create a new metafield and delete the old one if you need to move it.

Examples

Change a scalar value

curl -X PUT "https://api.launchmystore.io/api/v1/metafields/<id>.json" \
  -H "Authorization: Bearer ..." \
  -H "Content-Type: application/json" \
  -d '{ "value": "NEW BADGE VALUE" }'

Update a compound value

curl -X PUT "https://api.launchmystore.io/api/v1/metafields/<id>.json" \
  -H "Authorization: Bearer ..." \
  -H "Content-Type: application/json" \
  -d '{ "value": { "amount": "19.99", "currency_code": "USD" }, "type": "money" }'

Update a list

curl -X PUT "https://api.launchmystore.io/api/v1/metafields/<id>.json" \
  -H "Authorization: Bearer ..." \
  -H "Content-Type: application/json" \
  -d '{ "value": ["red", "limited"], "type": "list.single_line_text_field" }'

Response

{
  "status": 200,
  "state": "success",
  "data": {
    "metafield": {
      "id": "e607f43e-9251-451e-a45c-38bf28d61154",
      "namespace": "custom",
      "key": "badge",
      "value": "NEW BADGE VALUE",
      "raw_value": "NEW BADGE VALUE",
      "type": "single_line_text_field",
      "owner_type": "product",
      "owner_id": "94995c07-e8a5-43f2-9d1a-18ccf8199adf",
      "app_id": "your-app-id",
      "created_at": "2026-05-09T13:32:53.135Z",
      "updated_at": "2026-05-09T13:42:50.402Z"
    }
  }
}

Cache invalidation

A successful update automatically expires the storefront caches for the owning resource. The next render sees the new value.

Error codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
FORBIDDENApp doesn’t have write_metafields scope
NOT_FOUNDMetafield does not exist, or wasn’t written by your app
VALIDATION_ERRORValue doesn’t match the (new) type or its validations