API Authentication
The Vender.cloud API uses Bearer token authentication.
Every request must include an Authorization header with a valid token.
Quick Start
Generate an API key from Admin → Developer Settings → API Keys, then send it as a Bearer token in every request.
Step 1: Generate an API Key
- Log in to your Vender.cloud admin panel.
- Navigate to Developer Settings in the sidebar.
- Click "Create API Key".
- Enter a label (e.g., "Integration — ERP sync") and select the permissions this key needs.
- Optionally set an expiration date.
- Copy the generated token immediately — it is shown only once.
Step 2: Use the Token
Include the token in the Authorization header of every API request:
curl -H "Authorization: Bearer vndr_abc123_YourSecretTokenHere" \
https://api.vender.cloud/api/products Token Format
API keys use the prefix vndr_ followed by a lookup ID and a secret,
separated by underscores.
Step 3: Permission Scoping
Each API key has a scoped set of permissions. Only grant the minimum permissions required for the integration. Available permission groups include:
| Permission Group | Scope |
|---|---|
products.* | View, create, update, delete products |
orders.* | View, create, update, delete sales orders |
customers.* | View and manage customer accounts |
inventory.* | View and update stock levels |
reports.* | View reports and analytics |
settings.* | View and update company settings |
Token Lifecycle
Rotation
Rotate a token when you suspect it has been compromised or as a routine security practice. Rotation generates a new secret while keeping the same key record. The old token is immediately invalidated.
Revocation
Revoke a token to disable it without deleting the record. Revoked tokens cannot be reactivated.
Expiration
Tokens can optionally be set to expire at a specific date and time. Expired tokens are automatically rejected. Set an expiration during creation or rotation.
Error Responses
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid token |
| 403 | FORBIDDEN | Token lacks the required permission |
| 401 | TOKEN_EXPIRED | Token has passed its expiration date |
| 401 | TOKEN_REVOKED | Token has been revoked |
Code Examples
JavaScript / TypeScript
// Using the auto-generated @vender/api SDK
import { listProducts } from '@vender/api';
const { data, error } = await listProducts({
headers: {
Authorization: `Bearer ${API_KEY}`,
},
}); Python
import requests
API_KEY = "vndr_abc123_YourSecretTokenHere"
BASE_URL = "https://api.vender.cloud/api"
response = requests.get(
f"{BASE_URL}/products",
headers={"Authorization": f"Bearer {API_KEY}"}
)
print(response.json()) PHP
$apiKey = "vndr_abc123_YourSecretTokenHere";
$ch = curl_init("https://api.vender.cloud/api/products");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);