Delete Metafield
curl --request DELETE \
--url https://api.launchmystore.io/api/v1/metafields/:id.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/metafields/:id.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
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 => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/metafields/:id.json"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.launchmystore.io/api/v1/metafields/:id.json")
.header("Authorization", "Bearer <token>")
.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::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyMetafields
Delete Metafield
Permanently delete a metafield by id
DELETE
/
api
/
v1
/
metafields
/
:id.json
Delete Metafield
curl --request DELETE \
--url https://api.launchmystore.io/api/v1/metafields/:id.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/metafields/:id.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
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 => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/metafields/:id.json"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.launchmystore.io/api/v1/metafields/:id.json")
.header("Authorization", "Bearer <token>")
.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::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyDelete Metafield
Permanently deletes a metafield owned by your app. Apps cannot delete metafields written by other apps or by merchants. The action cannot be undone.Request
curl -X DELETE "https://api.launchmystore.io/api/v1/metafields/<metafieldId>.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const response = await fetch(`https://api.launchmystore.io/api/v1/metafields/${id}.json`, {
method: 'DELETE',
headers: { Authorization: `Bearer ${accessToken}` },
});
Required scope
write_metafields
Path parameters
string
required
The metafield’s UUID (the
id field from list/create responses).Response
{
"status": 200,
"state": "success",
"message": "Metafield deleted successfully"
}
Cache invalidation
Deletion automatically expires the storefront caches for the owning resource. The next render will not include the deleted field — Aqua/Liquid access ({{ owner.metafields.namespace.key }}) returns an empty drop, no
error thrown.
Notes
- Themes that read this metafield will see an empty drop on the next
render.
{{ … }}renders empty string;{% if … %}is falsy. No exceptions thrown. - If the merchant or another app also writes a metafield with the same
(ownerType, namespace, key, ownerId), that one is not affected — rows are scoped perappId.
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 |