De Koshur Crafts Logo

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

GET
/api/v1/vendors
API Key
100/min

List all registered vendors with pagination

POST
/api/v1/vendors
OAuth 2.0
10/min

Register a new vendor account

GET
/api/v1/vendors/{id}/products
API Key
200/min

Get vendor's product inventory

PUT
/api/v1/vendors/{id}/inventory
OAuth 2.0
50/min

Update product inventory levels

Sample Requests & Responses

Vendors API Example

Complete example showing request and response for vendors operations

javascript
// 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

API Key Authentication

Simple authentication using API keys in the Authorization header. Suitable for server-to-server integrations.

Easy to implement
Perfect for backend services
No token expiration
OAuth 2.0 Flow

Industry-standard OAuth 2.0 with client credentials flow. Required for sensitive operations and user data access.

Enhanced security
Scoped permissions
Token refresh capability
Authentication Examples

Examples of both API key and OAuth 2.0 authentication methods

javascript
// 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

Rate Limits

Public Access

1,000/hour

For public data like product catalogs and tour listings

Burst: 100/minute

Authenticated

10,000/hour

For vendor and affiliate operations with API key

Burst: 500/minute

Premium

50,000/hour

For high-volume integrations and enterprise use

Burst: 2,000/minute

Enterprise

200,000/hour

For large-scale business operations with dedicated support

Burst: 5,000/minute

HTTP Response Codes
200
OK
Request successful
201
Created
Resource created successfully
400
Bad Request
Invalid request parameters
401
Unauthorized
Invalid or missing authentication
403
Forbidden
Insufficient permissions
404
Not Found
Resource not found
500
Internal Server Error
Server error occurred