curl --request POST \
--url https://www.merchkit.com/api/v1/vendors/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"attributes": {
"vendor_name": "Nordic Timber Co.",
"country": "Denmark"
}
}
]
}
'import requests
url = "https://www.merchkit.com/api/v1/vendors/batch"
payload = { "items": [{ "attributes": {
"vendor_name": "Nordic Timber Co.",
"country": "Denmark"
} }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{attributes: {vendor_name: 'Nordic Timber Co.', country: 'Denmark'}}]})
};
fetch('https://www.merchkit.com/api/v1/vendors/batch', 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://www.merchkit.com/api/v1/vendors/batch",
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([
'items' => [
[
'attributes' => [
'vendor_name' => 'Nordic Timber Co.',
'country' => 'Denmark'
]
]
]
]),
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://www.merchkit.com/api/v1/vendors/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"attributes\": {\n \"vendor_name\": \"Nordic Timber Co.\",\n \"country\": \"Denmark\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.merchkit.com/api/v1/vendors/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"attributes\": {\n \"vendor_name\": \"Nordic Timber Co.\",\n \"country\": \"Denmark\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/vendors/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"attributes\": {\n \"vendor_name\": \"Nordic Timber Co.\",\n \"country\": \"Denmark\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"total": 1,
"created": 0,
"updated": 1,
"failed": 0,
"has_errors": false
},
"data": [
{
"index": 0,
"id": "77e1b2aa-6b3d-4f19-9d10-8c2a5e7f4b21",
"status": "updated"
}
]
}{
"error": {
"code": "validation_failed",
"message": "Unknown attribute key(s): colour.",
"documentation_url": "https://docs.merchkit.com/developers/errors#validation_failed",
"is_retriable": false,
"retry_after_seconds": null,
"alternative_action": "List valid attribute keys via GET /v1/attributes?type=product.",
"request_id": "req_01j9x2k8",
"field_errors": [
{
"field": "colour",
"issue": "not_a_defined_attribute"
}
]
}
}Batch create/upsert vendors
Up to 100 items in one call. With merge_key, every item gets upsert semantics (create-or-update by that key); without it, pure creates. Items are processed independently and the response is PER-ITEM: HTTP 200 does NOT mean every item succeeded — check each status (created | updated | error) and surface error.message/error.field_errors for failures. A 5,000-SKU ERP delta push is 50 calls with merge_key: "sku".
Scope: write:vendors.
curl --request POST \
--url https://www.merchkit.com/api/v1/vendors/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"attributes": {
"vendor_name": "Nordic Timber Co.",
"country": "Denmark"
}
}
]
}
'import requests
url = "https://www.merchkit.com/api/v1/vendors/batch"
payload = { "items": [{ "attributes": {
"vendor_name": "Nordic Timber Co.",
"country": "Denmark"
} }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({items: [{attributes: {vendor_name: 'Nordic Timber Co.', country: 'Denmark'}}]})
};
fetch('https://www.merchkit.com/api/v1/vendors/batch', 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://www.merchkit.com/api/v1/vendors/batch",
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([
'items' => [
[
'attributes' => [
'vendor_name' => 'Nordic Timber Co.',
'country' => 'Denmark'
]
]
]
]),
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://www.merchkit.com/api/v1/vendors/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"attributes\": {\n \"vendor_name\": \"Nordic Timber Co.\",\n \"country\": \"Denmark\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://www.merchkit.com/api/v1/vendors/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"attributes\": {\n \"vendor_name\": \"Nordic Timber Co.\",\n \"country\": \"Denmark\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.merchkit.com/api/v1/vendors/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"attributes\": {\n \"vendor_name\": \"Nordic Timber Co.\",\n \"country\": \"Denmark\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"total": 1,
"created": 0,
"updated": 1,
"failed": 0,
"has_errors": false
},
"data": [
{
"index": 0,
"id": "77e1b2aa-6b3d-4f19-9d10-8c2a5e7f4b21",
"status": "updated"
}
]
}{
"error": {
"code": "validation_failed",
"message": "Unknown attribute key(s): colour.",
"documentation_url": "https://docs.merchkit.com/developers/errors#validation_failed",
"is_retriable": false,
"retry_after_seconds": null,
"alternative_action": "List valid attribute keys via GET /v1/attributes?type=product.",
"request_id": "req_01j9x2k8",
"field_errors": [
{
"field": "colour",
"issue": "not_a_defined_attribute"
}
]
}
}Authorizations
Workspace-scoped API key (mk_live_...). Each operation lists the scope it requires in x-required-scopes. See the Authentication guide for the full scope table and key management.
Body
Response
Per-item results, in input order, under a summary that makes "N of M failed" a single field read. Check every item — a 200 only means the batch was processed. Route retries on error.retriable, never on message text. Summaries from re-runs must not be summed (an idempotent retry reports updates for rows the first attempt created).
Batch-level counts. has_errors is the cheap "anything to look at?" check; clean batches can skip the per-item scan. Do not sum summaries across idempotent re-runs of the same batch.
Show child attributes
Show child attributes
{
"total": 3,
"created": 1,
"updated": 1,
"failed": 1,
"has_errors": true
}
Show child attributes
Show child attributes
Was this page helpful?