

Loading page...
GRAYSOS · B2B API DOCUMENTATION
Technical documentation for approved B2B partners integrating Graysos products, stock, and catalogue data into their own systems.
The Graysos Connect API allows B2B partners to fetch a filtered product catalogue based on their assigned price tier and product permissions.
All requests require an API key issued by Graysos.
curl -X GET "/api/b2b/catalog" \
-H "x-api-key: YOUR_API_KEY"API keys must never be exposed in frontend code.
GET /api/b2b/catalog
Returns the full catalogue visible to the authenticated B2B partner.
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.
// 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);For access requests, pricing endpoints, or order-placement APIs, contact Graysos.