/client/items
Path: /client/items
Namespace: client
Resource: items
Overview
The Item resource in the client namespace provides customers with access to the product catalog, allowing them to browse available items for purchase.
Key Difference from Admin: Client namespace provides read-only or limited access to items for customer browsing.
Relationships
See Admin Items for complete relationship documentation. Client items use the same Item model with customer access.
Available Operations
List Items (GET)
Endpoint: GET /client/items.json
Query Parameters:
q[field_predicate]=value- Ransack query filters for advanced filteringscope=name- Apply named scope (e.g.,in_stock,out_of_stock)page=N- Page number for paginationper_page=N- Items per page (default: 25)
Request Examples:
curl -X GET "https://your-company.erpax.com/client/items.json" \
-H "Accept: application/json" \
-H "Cookie: session_cookie"curl -X GET "https://your-company.erpax.com/client/items.json?scope=in_stock" \
-H "Accept: application/json"JavaScript Example:
const response = await fetch('/client/items.json', {
credentials: 'include',
headers: { 'Accept': 'application/json' }
});
const data = await response.json();Response (200 OK):
{
"items": [
{
"id": 1,
"code": "PROD-001",
"name": "Widget A",
"description": "High-quality widget",
"price_cents": 10000,
"price": "100.00",
"currency_code": "USD",
"inventory_quantity": 100,
"created_at": "2024-01-10T10:00:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 25,
"total_pages": 5,
"total_count": 123
}
}Show Item (GET /:id)
Endpoint: GET /client/items/:id.json
Request Example:
curl -X GET "https://your-company.erpax.com/client/items/1.json" \
-H "Accept: application/json" \
-H "Cookie: session_cookie"JavaScript Example:
const response = await fetch('/client/items/1.json', {
credentials: 'include',
headers: { 'Accept': 'application/json' }
});
const data = await response.json();Response (200 OK):
{
"item": {
"id": 1,
"code": "PROD-001",
"name": "Widget A",
"description": "High-quality widget",
"price_cents": 10000,
"price": "100.00",
"currency_code": "USD",
"inventory_quantity": 100,
"tax_rate": 0.1,
"tax_type": "vat",
"unit": "piece",
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-15T12:00:00Z"
}
}Note: Create, update, and delete operations are typically not available in the client namespace. Client namespace provides read-only access to the product catalog for customer browsing.
Scopes
See Admin Items for complete scope documentation. Client namespace supports the same scopes as admin namespace.
Filters
See Admin Items for complete filter documentation. Client namespace supports the same filters as admin namespace.
Business Rules
- Customer Access: Customers can browse the product catalog
- Limited Operations: Create, update, and delete operations are typically not available
- Same Business Rules: Follows the same business rules as admin namespace items
Related Resources
- Admin Items - Complete item documentation
- Client Orders - Add items to customer orders
- Client Dashboard - Client namespace overview