Skip to main content
POST
/
v1
/
commissions
/
sku
Bulk Upload SKU Commissions
curl --request POST \
  --url https://api.puppetvendors.com/v1/commissions/sku \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "skus": [
    {
      "sku": "<string>",
      "commissionType": "<string>",
      "commissionRate": 123,
      "costOfGoods": 123
    }
  ]
}
'
import requests

url = "https://api.puppetvendors.com/v1/commissions/sku"

payload = { "skus": [
{
"sku": "<string>",
"commissionType": "<string>",
"commissionRate": 123,
"costOfGoods": 123
}
] }
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
skus: [
{
sku: '<string>',
commissionType: '<string>',
commissionRate: 123,
costOfGoods: 123
}
]
})
};

fetch('https://api.puppetvendors.com/v1/commissions/sku', 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.puppetvendors.com/v1/commissions/sku",
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([
'skus' => [
[
'sku' => '<string>',
'commissionType' => '<string>',
'commissionRate' => 123,
'costOfGoods' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);

$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.puppetvendors.com/v1/commissions/sku"

payload := strings.NewReader("{\n \"skus\": [\n {\n \"sku\": \"<string>\",\n \"commissionType\": \"<string>\",\n \"commissionRate\": 123,\n \"costOfGoods\": 123\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-access-token", "<api-key>")
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://api.puppetvendors.com/v1/commissions/sku")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"skus\": [\n {\n \"sku\": \"<string>\",\n \"commissionType\": \"<string>\",\n \"commissionRate\": 123,\n \"costOfGoods\": 123\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.puppetvendors.com/v1/commissions/sku")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"skus\": [\n {\n \"sku\": \"<string>\",\n \"commissionType\": \"<string>\",\n \"commissionRate\": 123,\n \"costOfGoods\": 123\n }\n ]\n}"

response = http.request(request)
puts response.read_body

Overview

Create or update SKU-level commission rates and cost of goods values in bulk. Each SKU is upserted — if a matching SKU already exists for your shop it is updated, otherwise a new record is created.

Use Cases

  • Bulk-set commission overrides for hundreds of SKUs at once
  • Sync cost of goods from an ERP or inventory system
  • Onboard new product lines with pre-configured commission rates
  • Periodic updates to COGS values as supplier pricing changes

Request Body

skus
array
required
Array of SKU commission records (max 500 per request).

Response

Success — all items processed:
200
{
  "success": true,
  "received": 3,
  "created": 2,
  "updated": 1,
  "errors": []
}
Partial failure — some items had validation errors:
200
{
  "success": false,
  "received": 3,
  "created": 1,
  "updated": 0,
  "errors": [
    {
      "index": 1,
      "sku": "BAD-SKU",
      "error": "commissionType must be 'percentage' or 'flat'"
    },
    {
      "index": 2,
      "sku": "",
      "error": "sku is required"
    }
  ]
}
Validation error — request-level:
422
{
  "error": "\"skus\" array is required"
}
This endpoint uses upsert behavior. If a SKU already exists for your shop, the provided fields are updated. If it doesn’t exist, a new SKU record is created. Duplicate SKUs within the same request are processed in order — the last entry wins.
Commission values are applied as-is. A commissionRate of 14 means 14% (not 0.14). Do not divide by 100.

Example

curl -X POST https://api.puppetvendors.com/v1/commissions/sku \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_JWT_TOKEN" \
  -d '{
    "skus": [
      {
        "sku": "TSH-LG-BLU",
        "commissionType": "percentage",
        "commissionRate": 14,
        "costOfGoods": 15.50
      },
      {
        "sku": "MUG-WHT-001",
        "commissionType": "flat",
        "commissionRate": 2.00
      }
    ]
  }'