curl --request POST \
--url https://api.mercemur.com/api/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"title": "<string>",
"handle": "<string>",
"subtitle": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"attributes": {},
"discountable": true,
"unpublish_at": "2023-11-07T05:31:56Z",
"material": "<string>",
"weight": "<string>",
"length": "<string>",
"height": "<string>",
"width": "<string>",
"hs_code": "<string>",
"mid_code": "<string>",
"origin_country": "<string>",
"options": [
{
"title": "<string>",
"values": [
"<string>"
]
}
],
"variants": [
{
"price_minor": 1,
"currency_code": "<string>",
"title": "<string>",
"sku": "<string>",
"manage_inventory": true,
"allow_backorder": true,
"requires_shipping": true,
"variant_rank": 123,
"selections": {}
}
],
"images": [
{
"url": "<string>",
"alt_text": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
handle: '<string>',
subtitle: '<string>',
description: '<string>',
thumbnail: '<string>',
meta_title: '<string>',
meta_description: '<string>',
attributes: {},
discountable: true,
unpublish_at: '2023-11-07T05:31:56Z',
material: '<string>',
weight: '<string>',
length: '<string>',
height: '<string>',
width: '<string>',
hs_code: '<string>',
mid_code: '<string>',
origin_country: '<string>',
options: [{title: '<string>', values: ['<string>']}],
variants: [
{
price_minor: 1,
currency_code: '<string>',
title: '<string>',
sku: '<string>',
manage_inventory: true,
allow_backorder: true,
requires_shipping: true,
variant_rank: 123,
selections: {}
}
],
images: [{url: '<string>', alt_text: '<string>'}]
})
};
fetch('https://api.mercemur.com/api/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mercemur.com/api/v1/products"
payload = {
"title": "<string>",
"handle": "<string>",
"subtitle": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"attributes": {},
"discountable": True,
"unpublish_at": "2023-11-07T05:31:56Z",
"material": "<string>",
"weight": "<string>",
"length": "<string>",
"height": "<string>",
"width": "<string>",
"hs_code": "<string>",
"mid_code": "<string>",
"origin_country": "<string>",
"options": [
{
"title": "<string>",
"values": ["<string>"]
}
],
"variants": [
{
"price_minor": 1,
"currency_code": "<string>",
"title": "<string>",
"sku": "<string>",
"manage_inventory": True,
"allow_backorder": True,
"requires_shipping": True,
"variant_rank": 123,
"selections": {}
}
],
"images": [
{
"url": "<string>",
"alt_text": "<string>"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mercemur.com/api/v1/products"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"meta_description\": \"<string>\",\n \"attributes\": {},\n \"discountable\": true,\n \"unpublish_at\": \"2023-11-07T05:31:56Z\",\n \"material\": \"<string>\",\n \"weight\": \"<string>\",\n \"length\": \"<string>\",\n \"height\": \"<string>\",\n \"width\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"mid_code\": \"<string>\",\n \"origin_country\": \"<string>\",\n \"options\": [\n {\n \"title\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variants\": [\n {\n \"price_minor\": 1,\n \"currency_code\": \"<string>\",\n \"title\": \"<string>\",\n \"sku\": \"<string>\",\n \"manage_inventory\": true,\n \"allow_backorder\": true,\n \"requires_shipping\": true,\n \"variant_rank\": 123,\n \"selections\": {}\n }\n ],\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mercemur.com/api/v1/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'handle' => '<string>',
'subtitle' => '<string>',
'description' => '<string>',
'thumbnail' => '<string>',
'meta_title' => '<string>',
'meta_description' => '<string>',
'attributes' => [
],
'discountable' => true,
'unpublish_at' => '2023-11-07T05:31:56Z',
'material' => '<string>',
'weight' => '<string>',
'length' => '<string>',
'height' => '<string>',
'width' => '<string>',
'hs_code' => '<string>',
'mid_code' => '<string>',
'origin_country' => '<string>',
'options' => [
[
'title' => '<string>',
'values' => [
'<string>'
]
]
],
'variants' => [
[
'price_minor' => 1,
'currency_code' => '<string>',
'title' => '<string>',
'sku' => '<string>',
'manage_inventory' => true,
'allow_backorder' => true,
'requires_shipping' => true,
'variant_rank' => 123,
'selections' => [
]
]
],
'images' => [
[
'url' => '<string>',
'alt_text' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"attributes": {
"care": "<string>",
"fabric": "<string>"
},
"created_at": "<string>",
"description": "<string>",
"discountable": true,
"handle": "<string>",
"height": null,
"hs_code": "<string>",
"id": "<string>",
"images": [
{
"alt_text": "<string>",
"id": "<string>",
"rank": 123,
"url": "<string>"
}
],
"length": null,
"material": "<string>",
"meta_description": "<string>",
"meta_title": "<string>",
"mid_code": null,
"options": [
{
"id": "<string>",
"title": "<string>",
"values": [
"<string>"
]
}
],
"origin_country": "<string>",
"published_at": null,
"status": "<string>",
"subtitle": "<string>",
"thumbnail": "<string>",
"title": "<string>",
"type_id": "<string>",
"unpublish_at": null,
"updated_at": "<string>",
"variants": [
{
"allow_backorder": true,
"currency_code": "<string>",
"id": "<string>",
"manage_inventory": true,
"price_minor": 123,
"requires_shipping": true,
"selections": {
"Size": "<string>"
},
"sku": "<string>",
"title": "<string>",
"variant_rank": 123
}
],
"weight": null,
"width": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}Create a draft product
curl --request POST \
--url https://api.mercemur.com/api/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"title": "<string>",
"handle": "<string>",
"subtitle": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"attributes": {},
"discountable": true,
"unpublish_at": "2023-11-07T05:31:56Z",
"material": "<string>",
"weight": "<string>",
"length": "<string>",
"height": "<string>",
"width": "<string>",
"hs_code": "<string>",
"mid_code": "<string>",
"origin_country": "<string>",
"options": [
{
"title": "<string>",
"values": [
"<string>"
]
}
],
"variants": [
{
"price_minor": 1,
"currency_code": "<string>",
"title": "<string>",
"sku": "<string>",
"manage_inventory": true,
"allow_backorder": true,
"requires_shipping": true,
"variant_rank": 123,
"selections": {}
}
],
"images": [
{
"url": "<string>",
"alt_text": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
handle: '<string>',
subtitle: '<string>',
description: '<string>',
thumbnail: '<string>',
meta_title: '<string>',
meta_description: '<string>',
attributes: {},
discountable: true,
unpublish_at: '2023-11-07T05:31:56Z',
material: '<string>',
weight: '<string>',
length: '<string>',
height: '<string>',
width: '<string>',
hs_code: '<string>',
mid_code: '<string>',
origin_country: '<string>',
options: [{title: '<string>', values: ['<string>']}],
variants: [
{
price_minor: 1,
currency_code: '<string>',
title: '<string>',
sku: '<string>',
manage_inventory: true,
allow_backorder: true,
requires_shipping: true,
variant_rank: 123,
selections: {}
}
],
images: [{url: '<string>', alt_text: '<string>'}]
})
};
fetch('https://api.mercemur.com/api/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mercemur.com/api/v1/products"
payload = {
"title": "<string>",
"handle": "<string>",
"subtitle": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"attributes": {},
"discountable": True,
"unpublish_at": "2023-11-07T05:31:56Z",
"material": "<string>",
"weight": "<string>",
"length": "<string>",
"height": "<string>",
"width": "<string>",
"hs_code": "<string>",
"mid_code": "<string>",
"origin_country": "<string>",
"options": [
{
"title": "<string>",
"values": ["<string>"]
}
],
"variants": [
{
"price_minor": 1,
"currency_code": "<string>",
"title": "<string>",
"sku": "<string>",
"manage_inventory": True,
"allow_backorder": True,
"requires_shipping": True,
"variant_rank": 123,
"selections": {}
}
],
"images": [
{
"url": "<string>",
"alt_text": "<string>"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mercemur.com/api/v1/products"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnail\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"meta_description\": \"<string>\",\n \"attributes\": {},\n \"discountable\": true,\n \"unpublish_at\": \"2023-11-07T05:31:56Z\",\n \"material\": \"<string>\",\n \"weight\": \"<string>\",\n \"length\": \"<string>\",\n \"height\": \"<string>\",\n \"width\": \"<string>\",\n \"hs_code\": \"<string>\",\n \"mid_code\": \"<string>\",\n \"origin_country\": \"<string>\",\n \"options\": [\n {\n \"title\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variants\": [\n {\n \"price_minor\": 1,\n \"currency_code\": \"<string>\",\n \"title\": \"<string>\",\n \"sku\": \"<string>\",\n \"manage_inventory\": true,\n \"allow_backorder\": true,\n \"requires_shipping\": true,\n \"variant_rank\": 123,\n \"selections\": {}\n }\n ],\n \"images\": [\n {\n \"url\": \"<string>\",\n \"alt_text\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mercemur.com/api/v1/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'handle' => '<string>',
'subtitle' => '<string>',
'description' => '<string>',
'thumbnail' => '<string>',
'meta_title' => '<string>',
'meta_description' => '<string>',
'attributes' => [
],
'discountable' => true,
'unpublish_at' => '2023-11-07T05:31:56Z',
'material' => '<string>',
'weight' => '<string>',
'length' => '<string>',
'height' => '<string>',
'width' => '<string>',
'hs_code' => '<string>',
'mid_code' => '<string>',
'origin_country' => '<string>',
'options' => [
[
'title' => '<string>',
'values' => [
'<string>'
]
]
],
'variants' => [
[
'price_minor' => 1,
'currency_code' => '<string>',
'title' => '<string>',
'sku' => '<string>',
'manage_inventory' => true,
'allow_backorder' => true,
'requires_shipping' => true,
'variant_rank' => 123,
'selections' => [
]
]
],
'images' => [
[
'url' => '<string>',
'alt_text' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"attributes": {
"care": "<string>",
"fabric": "<string>"
},
"created_at": "<string>",
"description": "<string>",
"discountable": true,
"handle": "<string>",
"height": null,
"hs_code": "<string>",
"id": "<string>",
"images": [
{
"alt_text": "<string>",
"id": "<string>",
"rank": 123,
"url": "<string>"
}
],
"length": null,
"material": "<string>",
"meta_description": "<string>",
"meta_title": "<string>",
"mid_code": null,
"options": [
{
"id": "<string>",
"title": "<string>",
"values": [
"<string>"
]
}
],
"origin_country": "<string>",
"published_at": null,
"status": "<string>",
"subtitle": "<string>",
"thumbnail": "<string>",
"title": "<string>",
"type_id": "<string>",
"unpublish_at": null,
"updated_at": "<string>",
"variants": [
{
"allow_backorder": true,
"currency_code": "<string>",
"id": "<string>",
"manage_inventory": true,
"price_minor": 123,
"requires_shipping": true,
"selections": {
"Size": "<string>"
},
"sku": "<string>",
"title": "<string>",
"variant_rank": 123
}
],
"weight": null,
"width": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>"
}
}Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Headers
A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.
Body
Creates the product as a DRAFT. Status is not settable here: a product goes live through POST /products/{productId}/publish, which is the only shape that carries the free-variant acknowledgement and a scheduled publish_at.
Required on create, unlike the dashboard. Without it a retry outside the idempotency window mints a SECOND product at a suffixed handle; with it the retry collides and returns 409 handle_taken.
Merchant-defined JSON, stored unchanged and unvalidated.
Defaults to true when omitted.
A decimal string, not a number, matching the column and the read shape.
Variant axes, fixed at creation. There is no route to change an option afterwards: every variant's selection is a foreign key into these values, so editing an axis would orphan them.
Show child attributes
Show child attributes
Variants nest ONLY here. On a patch an array is a data-loss shape either way it is read, so edits go through the variant routes.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
