Complete API Reference
Comprehensive documentation for ArtStay's RESTful APIs including authentication protocols, rate limits, response codes, and sample requests for vendor registration, product listing, affiliate tracking, and tour bookings. Everything you need to integrate with our platform.
API Documentation
Access comprehensive guides and download resources
API Endpoints
/api/v1/vendorsList all registered vendors with pagination
/api/v1/vendorsRegister a new vendor account
/api/v1/vendors/{id}/productsGet vendor's product inventory
/api/v1/vendors/{id}/inventoryUpdate product inventory levels
Sample Requests & Responses
Complete example showing request and response for vendors operations
// List vendors with pagination
const response = await fetch('https://api.artstay.com/v1/vendors?page=1&limit=10', {
headers: {
'Authorization': 'Bearer your_api_key',
'Content-Type': 'application/json'
}
});
const vendors = await response.json();
console.log(vendors);
// Sample Response
{
"status": "success",
"data": [
{
"id": "vendor_001",
"name": "Kashmir Craft Co.",
"location": "Srinagar, Kashmir",
"products_count": 45,
"rating": 4.8,
"verified": true,
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 127,
"pages": 13
}
}Authentication Protocols
Simple authentication using API keys in the Authorization header. Suitable for server-to-server integrations.
Industry-standard OAuth 2.0 with client credentials flow. Required for sensitive operations and user data access.
Examples of both API key and OAuth 2.0 authentication methods
// API Key Authentication
const apiKey = 'your_api_key_here';
const response = await fetch('https://api.artstay.com/v1/vendors', {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
// OAuth 2.0 Authentication Flow
const clientId = 'your_client_id';
const clientSecret = 'your_client_secret';
// Step 1: Get access token
const tokenResponse = await fetch('https://api.artstay.com/oauth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret,
scope: 'vendors:read affiliates:write'
})
});
const { access_token } = await tokenResponse.json();
// Step 2: Use access token for API calls
const apiResponse = await fetch('https://api.artstay.com/v1/vendors', {
headers: {
'Authorization': `Bearer ${access_token}`,
'Content-Type': 'application/json'
}
});Rate Limits & Response Codes
Public Access
For public data like product catalogs and tour listings
Burst: 100/minute
Authenticated
For vendor and affiliate operations with API key
Burst: 500/minute
Premium
For high-volume integrations and enterprise use
Burst: 2,000/minute
Enterprise
For large-scale business operations with dedicated support
Burst: 5,000/minute
