GRAYSOS · B2B API DOCUMENTATION
Graysos Connect API
Technical documentation for approved B2B partners integrating Graysos products, stock, and catalogue data into their own systems.
Overview
The Graysos Connect API allows B2B partners to fetch a filtered product catalogue based on their assigned price tier and product permissions.
- Only products you are allowed to sell are returned
- Includes stock availability and main product image
- Designed for server-side consumption
Authentication
All requests require an API key issued by Graysos.
- Header: x-api-key
- Alternative: Authorization: Bearer <key>
curl -X GET "/api/b2b/catalog" \
-H "x-api-key: YOUR_API_KEY"API keys must never be exposed in frontend code.
Endpoint
GET /api/b2b/catalog
Returns the full catalogue visible to the authenticated B2B partner.
- Max response size: 2000 products
- No pagination (sync-based design)
- Ordered by latest updates
Response structure
Successful responses return JSON with the following structure:
{
"partner": {
"b2b_partner_id": 12,
"price_tier_id": 3
},
"count": 120,
"products": [
{
"id": 101,
"sku": "SKU-001",
"name": "Product name",
"slug": "product-name",
"category_id": 55,
"brand": "Brand",
"short_description": "Short text",
"base_cost_ex_vat": 12.5,
"image_url": "https://...",
"qty_on_hand": 80,
"created_at": "2025-01-01T10:00:00Z",
"updated_at": "2025-01-10T12:00:00Z"
}
]
}Pricing fields reflect base cost. Tier pricing logic is applied internally by Graysos and can be exposed via dedicated endpoints if required.
Code examples
// Node.js (fetch)
const res = await fetch("/api/b2b/catalog", {
headers: {
"x-api-key": process.env.GRAYSOS_API_KEY,
},
});
const data = await res.json();
console.log(data.products.length);// PHP
$ch = curl_init("/api/b2b/catalog");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: YOUR_API_KEY"
]);
$response = curl_exec($ch);
curl_close($ch);Sync guidance
- Poll the API every 15–60 minutes
- Upsert products by id
- Use updated_at for change detection
- Cache images locally or via CDN
Support
For access requests, pricing endpoints, or order-placement APIs, contact Graysos.