Get Product
This endpoint retrieves the details of a specific product or lists multiple products with filtering, sorting, and pagination options.
π Authenticationβ
Header | Required | Description |
---|---|---|
Content-Type | Yes | Must be application/json |
Authorization | Yes | Format: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature |
π Available Endpointsβ
1. Get Single Productβ
GET /api/v1/products/{productId}
Path Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
productId | string | Yes | The unique identifier of the product |
2. List Productsβ
GET /api/v1/products
Query Parametersβ
Parameter | Type | Description | Default |
---|---|---|---|
page | number | Page number for pagination | 1 |
limit | number | Items per page (max 100) | 20 |
category | string | Filter by category | - |
active | boolean | Filter by active status | - |
query | string | Search in name/description | - |
sort | string | Sort field (name,created,updated) | created |
order | string | Sort order (asc,desc) | desc |
tags | string[] | Filter by tags | - |
π Usage Examplesβ
Get Single Productβ
curl -X GET "https://openapi.onlive.site/api/v1/products/123e4567-e89b-12d3-a456-426614174000" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature"
List Active Products in Categoryβ
curl -X GET "https://openapi.onlive.site/api/v1/products?category=Apparel&active=true&limit=50" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature"
Search Productsβ
curl -X GET "https://openapi.onlive.site/api/v1/products?query=premium&sort=name&order=asc" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature"
π€ Response Formatβ
Single Product Responseβ
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Premium T-Shirt",
"active": true,
"category": "Apparel",
"currency": "EUR",
"descriptionHtml": "<p>High-quality cotton t-shirt</p>",
"externalId": "SHIRT-001",
"images": [
"https://example.com/shirt-front.webp",
"https://example.com/shirt-back.webp"
],
"options": [
{
"name": "Size",
"values": ["Small", "Medium", "Large"]
},
{
"name": "Color",
"values": ["Black", "White"]
}
],
"variants": [
{
"id": "789e0123-c45b-67d8-e901-234567890000",
"sku": "TS-BLK-S",
"price": 29.99,
"currency": "EUR",
"stock": 50,
"selectedOptions": [
{
"name": "Size",
"value": "Small"
},
{
"name": "Color",
"value": "Black"
}
],
"images": [
"https://example.com/shirt-black-small.webp"
]
}
],
"price": 29.99,
"stock": 50,
"tags": ["premium", "apparel"],
"providerType": "onlive",
"createdAt": "2025-05-22T10:00:00Z",
"updatedAt": "2025-05-22T10:00:00Z"
}
Product List Responseβ
{
"items": [
{
// Product object as above
}
],
"page": 1,
"limit": 20,
"total": 150,
"pages": 8
}
π Response Interpretationβ
Product Fieldsβ
id
: Unique product identifiername
,category
: Basic product infoactive
: Product visibility statusprice
: Lowest variant pricestock
: Total available stockoptions
: Available customization optionsvariants
: Individual product variationscreatedAt
,updatedAt
: Timestamps
Pagination Fieldsβ
page
: Current page numberlimit
: Items per pagetotal
: Total items availablepages
: Total number of pages
π Filtering Optionsβ
-
Basic Filters
- Category-based filtering
- Active status filtering
- Tag-based filtering
-
Search Options
- Name search
- Description search
- SKU search
-
Advanced Filters
- Price range
- Stock availability
- Creation date
β Error Responsesβ
400 Bad Requestβ
{
"statusCode": 400,
"message": "Invalid query parameter",
"errors": [
{
"field": "limit",
"message": "Must be a number between 1 and 100"
}
]
}
401 Unauthorizedβ
{
"statusCode": 401,
"message": "Invalid or missing authorization credentials"
}
403 Forbiddenβ
{
"statusCode": 403,
"message": "Insufficient permissions to access this product"
}
404 Not Foundβ
{
"statusCode": 404,
"message": "Product not found"
}
429 Too Many Requestsβ
{
"statusCode": 429,
"message": "Rate limit exceeded",
"retryAfter": 60
}
π‘ Best Practicesβ
-
Performance
- Use pagination for large lists
- Cache frequently accessed products
- Limit requested fields when possible
- Implement rate limiting
-
Data Handling
- Handle empty results gracefully
- Parse timestamps correctly
- Cache responses when appropriate
- Handle currency formatting
-
Error Handling
- Implement proper error handling
- Retry on network errors
- Handle rate limiting
- Log failed requests
π Related Endpointsβ
- Create Product: Create new products
- Update Product: Modify existing products
- Delete Product: Remove products
π Notesβ
- Results are paginated by default
- Maximum 100 items per page
- Timestamps are in ISO 8601 format
- Prices include VAT where applicable
- Stock levels are real-time
- Images are WebP format
- Currency follows ISO 4217