Skip to main content
POST
/
authenticate
Authenticate
curl --request POST \
  --url https://staging-api.puppetvendors.com/authenticate \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "apiKey": "<string>",
  "shopDomain": "<string>"
}
'
import requests

url = "https://staging-api.puppetvendors.com/authenticate"

payload = {
"apiKey": "<string>",
"shopDomain": "<string>"
}
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({apiKey: '<string>', shopDomain: '<string>'})
};

fetch('https://staging-api.puppetvendors.com/authenticate', 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://staging-api.puppetvendors.com/authenticate",
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([
'apiKey' => '<string>',
'shopDomain' => '<string>'
]),
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://staging-api.puppetvendors.com/authenticate"

payload := strings.NewReader("{\n \"apiKey\": \"<string>\",\n \"shopDomain\": \"<string>\"\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://staging-api.puppetvendors.com/authenticate")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"<string>\",\n \"shopDomain\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://staging-api.puppetvendors.com/authenticate")

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 \"apiKey\": \"<string>\",\n \"shopDomain\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
V2 Preview — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Exchange your vendor API key for a short-lived JWT token. The token is scoped to your vendor account and carries the permissions granted to your API key. Tokens expire after 24 hours. When a token expires, either re-authenticate or use POST /refresh-token to get a new one.

Use Cases

  • Vendor portal apps — Secure, isolated access to your vendor data
  • Custom integrations — Sync your orders, products, and payouts with external systems
  • AI agents — Programmatic access with scoped permissions

Request Body

apiKey
string
required
Your vendor API key (starts with vk_). Create one in the vendor portal under Settings > API Keys, or ask your merchant.
shopDomain
string
Optional. The shop is resolved from your API key. Only send this if your key works across multiple shops — if it doesn’t match, the request is rejected.

Response

200
{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresIn": 86400,
    "scope": "vendor",
    "permissions": ["orders:read", "products:read", "products:write", "fulfillments:read"],
    "shopDomain": "my-store.myshopify.com",
    "mode": "live",
    "vendorId": "507f1f77bcf86cd799439012"
  }
}

Response Fields

FieldTypeDescription
tokenstringJWT token to use in the x-access-token header
expiresInnumberToken lifetime in seconds (always 86400 = 24 hours)
scopestringAlways "vendor" for vendor API keys
permissionsstring[]The specific scopes granted to your API key (e.g., orders:read, products:write). See API Keys & Scopes
shopDomainstringThe Shopify store domain associated with your key
modestring"live" or "test" — matches your API key mode
vendorIdstringYour vendor account ID

Error Responses

401
{ "success": false, "error": { "message": "Invalid API key", "code": "UNAUTHORIZED" } }
401
{ "success": false, "error": { "message": "API key revoked", "code": "UNAUTHORIZED" } }
401
{ "success": false, "error": { "message": "Shop is not active", "code": "UNAUTHORIZED" } }
401
{ "success": false, "error": { "message": "The provided shopDomain is not available.", "code": "UNAUTHORIZED" } }
429
{ "success": false, "error": { "message": "Too many authentication requests", "code": "RATE_LIMITED" } }

Examples

curl -X POST https://staging-api.puppetvendors.com/authenticate \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "vk_live_x9y8z7w6v5u4..."
  }'
import requests

response = requests.post(
    "https://staging-api.puppetvendors.com/authenticate",
    json={"apiKey": "vk_live_x9y8z7w6v5u4..."}
)

data = response.json()["data"]
token = data["token"]
permissions = data["permissions"]
print(f"Token scope: {data['scope']}, permissions: {permissions}")
const response = await fetch("https://staging-api.puppetvendors.com/authenticate", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ apiKey: "vk_live_x9y8z7w6v5u4..." })
});

const { data } = await response.json();
const token = data.token;
// Use token in subsequent requests:
// headers: { "x-access-token": token }