Define custom data fields for products
/admin/api/custom-fields
List all custom fields with their choices. Returns the full detail including choices for select-type fields.
/admin/api/custom-fields
Create a new custom field. A URL slug is auto-derived from the name. Valid field_type values: text, textarea, date, number, select. Initial choices can be provided for select-type fields.
/admin/api/custom-fields/{id}
Fetch a single custom field with its choices.
/admin/api/custom-fields/{id}
Update a custom field's name, type, required flag, and placeholder. Re-derives the slug from the new name.
/admin/api/custom-fields/{id}
Delete a custom field and all its choices.
/admin/api/custom-fields/{id}/choices
Add a choice to a select-type custom field. A URL slug is auto-derived from the value.
/admin/api/custom-fields/{id}/choices/{cid}
Delete a custom field choice.
/admin/api/custom-fields
List all custom fields with their choices. Returns the full detail including choices for select-type fields.
[
{
"id": 1,
"name": "Engraving Text",
"slug": "engraving-text",
"field_type": "text",
"required": false,
"placeholder": "Enter your text here",
"sort_order": 0,
"choices": []
},
{
"id": 2,
"name": "Gift Wrap",
"slug": "gift-wrap",
"field_type": "select",
"required": false,
"placeholder": null,
"sort_order": 1,
"choices": [
{
"id": 10,
"value": "Standard",
"slug": "standard",
"sort_order": 0
},
{
"id": 11,
"value": "Premium",
"slug": "premium",
"sort_order": 1
}
]
},
{
"id": 3,
"name": "Delivery Date",
"slug": "delivery-date",
"field_type": "date",
"required": true,
"placeholder": null,
"sort_order": 2,
"choices": []
}
]
curl "https://yourshop.zeroshop.io/admin/api/custom-fields" \
-H "Authorization: Bearer zspat_..."
import requests
resp = requests.get(
"https://yourshop.zeroshop.io/admin/api/custom-fields",
headers={"Authorization": "Bearer zspat_..."}
)
fields = resp.json()
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields", {
headers: { "Authorization": "Bearer zspat_..." }
});
const fields = await resp.json();
require "net/http"
require "json"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer zspat_..."
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
fields = JSON.parse(resp.body)
/admin/api/custom-fields
Create a new custom field. A URL slug is auto-derived from the name. Valid field_type values: text, textarea, date, number, select. Initial choices can be provided for select-type fields.
{
"name": "Gift Wrap",
"field_type": "select",
"required": false,
"placeholder": null,
"choices": [
"Standard",
"Premium",
"Luxury"
]
}
{
"id": 2,
"name": "Gift Wrap",
"slug": "gift-wrap"
}
curl -X POST "https://yourshop.zeroshop.io/admin/api/custom-fields" \
-H "Authorization: Bearer zspat_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Gift Wrap",
"field_type": "select",
"required": false,
"choices": ["Standard", "Premium", "Luxury"]
}'
import requests
resp = requests.post(
"https://yourshop.zeroshop.io/admin/api/custom-fields",
headers={"Authorization": "Bearer zspat_..."},
json={
"name": "Gift Wrap",
"field_type": "select",
"required": False,
"choices": ["Standard", "Premium", "Luxury"]
}
)
field = resp.json()
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields", {
method: "POST",
headers: {
"Authorization": "Bearer zspat_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Gift Wrap",
field_type: "select",
required: false,
choices: ["Standard", "Premium", "Luxury"]
})
});
const field = await resp.json();
require "net/http"
require "json"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer zspat_..."
req["Content-Type"] = "application/json"
req.body = {
name: "Gift Wrap",
field_type: "select",
required: false,
choices: ["Standard", "Premium", "Luxury"]
}.to_json
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
field = JSON.parse(resp.body)
/admin/api/custom-fields/{id}
Fetch a single custom field with its choices.
{
"id": 2,
"name": "Gift Wrap",
"slug": "gift-wrap",
"field_type": "select",
"required": false,
"placeholder": null,
"sort_order": 1,
"choices": [
{
"id": 10,
"value": "Standard",
"slug": "standard",
"sort_order": 0
},
{
"id": 11,
"value": "Premium",
"slug": "premium",
"sort_order": 1
},
{
"id": 12,
"value": "Luxury",
"slug": "luxury",
"sort_order": 2
}
]
}
curl "https://yourshop.zeroshop.io/admin/api/custom-fields/2" \
-H "Authorization: Bearer zspat_..."
import requests
resp = requests.get(
"https://yourshop.zeroshop.io/admin/api/custom-fields/2",
headers={"Authorization": "Bearer zspat_..."}
)
field = resp.json()
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields/2", {
headers: { "Authorization": "Bearer zspat_..." }
});
const field = await resp.json();
require "net/http"
require "json"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields/2")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer zspat_..."
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
field = JSON.parse(resp.body)
/admin/api/custom-fields/{id}
Update a custom field's name, type, required flag, and placeholder. Re-derives the slug from the new name.
{
"name": "Gift Wrapping",
"field_type": "select",
"required": true,
"placeholder": "Choose a wrapping style"
}
curl -X PUT "https://yourshop.zeroshop.io/admin/api/custom-fields/2" \
-H "Authorization: Bearer zspat_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Gift Wrapping",
"field_type": "select",
"required": true,
"placeholder": "Choose a wrapping style"
}'
import requests
resp = requests.put(
"https://yourshop.zeroshop.io/admin/api/custom-fields/2",
headers={"Authorization": "Bearer zspat_..."},
json={
"name": "Gift Wrapping",
"field_type": "select",
"required": True,
"placeholder": "Choose a wrapping style"
}
)
# 204 No Content on success
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields/2", {
method: "PUT",
headers: {
"Authorization": "Bearer zspat_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Gift Wrapping",
field_type: "select",
required: true,
placeholder: "Choose a wrapping style"
})
});
// 204 No Content on success
require "net/http"
require "json"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields/2")
req = Net::HTTP::Put.new(uri)
req["Authorization"] = "Bearer zspat_..."
req["Content-Type"] = "application/json"
req.body = {
name: "Gift Wrapping",
field_type: "select",
required: true,
placeholder: "Choose a wrapping style"
}.to_json
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
/admin/api/custom-fields/{id}
Delete a custom field and all its choices.
curl -X DELETE "https://yourshop.zeroshop.io/admin/api/custom-fields/2" \
-H "Authorization: Bearer zspat_..."
import requests
resp = requests.delete(
"https://yourshop.zeroshop.io/admin/api/custom-fields/2",
headers={"Authorization": "Bearer zspat_..."}
)
# 204 No Content on success
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields/2", {
method: "DELETE",
headers: { "Authorization": "Bearer zspat_..." }
});
// 204 No Content on success
require "net/http"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields/2")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer zspat_..."
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
/admin/api/custom-fields/{id}/choices
Add a choice to a select-type custom field. A URL slug is auto-derived from the value.
{
"value": "Eco Friendly"
}
{
"id": 13,
"value": "Eco Friendly",
"slug": "eco-friendly"
}
curl -X POST "https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices" \
-H "Authorization: Bearer zspat_..." \
-H "Content-Type: application/json" \
-d '{ "value": "Eco Friendly" }'
import requests
resp = requests.post(
"https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices",
headers={"Authorization": "Bearer zspat_..."},
json={"value": "Eco Friendly"}
)
choice = resp.json()
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices", {
method: "POST",
headers: {
"Authorization": "Bearer zspat_...",
"Content-Type": "application/json"
},
body: JSON.stringify({ value: "Eco Friendly" })
});
const choice = await resp.json();
require "net/http"
require "json"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer zspat_..."
req["Content-Type"] = "application/json"
req.body = { value: "Eco Friendly" }.to_json
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
choice = JSON.parse(resp.body)
/admin/api/custom-fields/{id}/choices/{cid}
Delete a custom field choice.
curl -X DELETE "https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices/13" \
-H "Authorization: Bearer zspat_..."
import requests
resp = requests.delete(
"https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices/13",
headers={"Authorization": "Bearer zspat_..."}
)
# 204 No Content on success
const resp = await fetch("https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices/13", {
method: "DELETE",
headers: { "Authorization": "Bearer zspat_..." }
});
// 204 No Content on success
require "net/http"
uri = URI("https://yourshop.zeroshop.io/admin/api/custom-fields/2/choices/13")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer zspat_..."
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
We value your privacy
We use cookies for essential site functionality and, with your consent, analytics to understand how our platform is used. No personal data is shared with third parties. See our Privacy Policy for details.