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>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/metafields/:id.json"
payload = {
"value": "<any>",
"type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<any>', type: '<string>'})
};
fetch('https://api.launchmystore.io/api/v1/metafields/:id.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/metafields/:id.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'value' => '<any>',
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/metafields/:id.json"
payload := strings.NewReader("{\n \"value\": \"<any>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.launchmystore.io/api/v1/metafields/:id.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"<any>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/metafields/:id.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"<any>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMetafields
Update Metafield
Update value or type of an existing metafield by id
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>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/metafields/:id.json"
payload = {
"value": "<any>",
"type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<any>', type: '<string>'})
};
fetch('https://api.launchmystore.io/api/v1/metafields/:id.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/metafields/:id.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'value' => '<any>',
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/metafields/:id.json"
payload := strings.NewReader("{\n \"value\": \"<any>\",\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.launchmystore.io/api/v1/metafields/:id.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"<any>\",\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/metafields/:id.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"<any>\",\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdate Metafield
Updates the value (and optionally type) of a metafield owned by your app. The metafield is matched by id andappId — 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"
}'
const response = await fetch(`https://api.launchmystore.io/api/v1/metafields/${id}.json`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
value: 'NEW BADGE VALUE',
type: 'single_line_text_field',
}),
});
Required scope
write_metafields
Path parameters
string
required
The metafield’s UUID (the
id field from list/create responses).Body parameters
any
The new value. Scalars sent as-is; compounds sent as JSON. Must validate
against the (current or new)
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": {
"metafieldId": "e607f43e-9251-451e-a45c-38bf28d61154",
"namespace": "custom",
"key": "badge",
"value": "NEW BADGE VALUE",
"type": "single_line_text_field",
"ownerType": "product",
"ownerId": "e5f6a7b8-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
"appId": "your-app-id",
"createdAt": "2026-05-09T13:32:53.135Z",
"updatedAt": "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
| Code | Description |
|---|---|
UNAUTHORIZED | Invalid or missing access token |
FORBIDDEN | App doesn’t have write_metafields scope |
NOT_FOUND | Metafield does not exist, or wasn’t written by your app |
VALIDATION_ERROR | Value doesn’t match the (new) type or its validations |