Create a workspace token (shown once)
curl --request POST \
--url https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Claude Code — laptop",
"scopes": [
"site:write",
"catalog:read"
],
"expiresAt": "<string>"
}
'import requests
url = "https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens"
payload = {
"name": "Claude Code — laptop",
"scopes": ["site:write", "catalog:read"],
"expiresAt": "<string>"
}
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({
name: 'Claude Code — laptop',
scopes: ['site:write', 'catalog:read'],
expiresAt: '<string>'
})
};
fetch('https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens', 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://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens",
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([
'name' => 'Claude Code — laptop',
'scopes' => [
'site:write',
'catalog:read'
],
'expiresAt' => '<string>'
]),
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://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens"
payload := strings.NewReader("{\n \"name\": \"Claude Code — laptop\",\n \"scopes\": [\n \"site:write\",\n \"catalog:read\"\n ],\n \"expiresAt\": \"<string>\"\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://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Claude Code — laptop\",\n \"scopes\": [\n \"site:write\",\n \"catalog:read\"\n ],\n \"expiresAt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens")
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 \"name\": \"Claude Code — laptop\",\n \"scopes\": [\n \"site:write\",\n \"catalog:read\"\n ],\n \"expiresAt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {},
"message": "<string>"
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}Workspace
Create a workspace token (shown once)
POST
/
api
/
v2
/
shops
/
{shopId}
/
workspace
/
tokens
Create a workspace token (shown once)
curl --request POST \
--url https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Claude Code — laptop",
"scopes": [
"site:write",
"catalog:read"
],
"expiresAt": "<string>"
}
'import requests
url = "https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens"
payload = {
"name": "Claude Code — laptop",
"scopes": ["site:write", "catalog:read"],
"expiresAt": "<string>"
}
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({
name: 'Claude Code — laptop',
scopes: ['site:write', 'catalog:read'],
expiresAt: '<string>'
})
};
fetch('https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens', 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://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens",
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([
'name' => 'Claude Code — laptop',
'scopes' => [
'site:write',
'catalog:read'
],
'expiresAt' => '<string>'
]),
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://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens"
payload := strings.NewReader("{\n \"name\": \"Claude Code — laptop\",\n \"scopes\": [\n \"site:write\",\n \"catalog:read\"\n ],\n \"expiresAt\": \"<string>\"\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://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Claude Code — laptop\",\n \"scopes\": [\n \"site:write\",\n \"catalog:read\"\n ],\n \"expiresAt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://itemshop.dev/api/v2/shops/{shopId}/workspace/tokens")
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 \"name\": \"Claude Code — laptop\",\n \"scopes\": [\n \"site:write\",\n \"catalog:read\"\n ],\n \"expiresAt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {},
"message": "<string>"
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}{
"success": false,
"statusCode": 400,
"error": "Error message",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/api/v2/..."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Shop ID (ObjectId)
Body
application/json
Token name
Required string length:
1 - 100Example:
"Claude Code — laptop"
Minimum array length:
1Available options:
site:read, site:write, catalog:read, catalog:write, orders:read, discounts:write, stats:read Example:
["site:write", "catalog:read"]
Expiry (ISO 8601)
Was this page helpful?
⌘I