Status API
The Status API allows you to retrieve status counts for different operational areas of your optical store. This endpoint provides aggregated counts for stock management, sales operations, and purchase operations.Endpoint Details
Base URL:https://joptic.jethings.com
Required Headers
Get Status
Endpoint
Endpoint:GET /status/:type
Path Parameters
Type Enum Values
Thetype parameter accepts one of the following values:
stock- Returns counts for stock-related entities (items, item variants, brands, warehouses, products)sell- Returns counts for sales-related entities (customers, customer groups, sales invoices, price lists, item prices)buy- Returns counts for purchase-related entities (suppliers, supplier groups, purchase invoices, purchase orders, price lists, item prices)
The type parameter must be one of: stock, buy, or sell. Any other value will result in a validation error.
Get Status Examples
Example 1: Get Stock Status
Example 2: Get Sales Status
Example 3: Get Purchase Status
Response Structures
Stock Status Response
Returns counts for stock-related entities:
Response Example:
Sales Status Response
Returns counts for sales-related entities:
Response Example:
Purchase Status Response
Returns counts for purchase-related entities:
Response Example:
Error Responses
400 Bad Request
Invalid type parameter:403 Forbidden
500 Internal Server Error
Important Notes
Store Association
- All counts are scoped to the store specified in the x-store-id header
- Only entities associated with the specified store are included in the counts
- The store ID is automatically extracted from the x-store-id header
Active Status Filtering
- Brands, warehouses, and price lists are filtered to include only active entities
- Suppliers and supplier groups are filtered to include only active relationships
- Deleted entities are excluded from counts
Stock Status Details
- Items: Counted via product association, excluding deleted items
- Item Variants: Counted via item to product association, excluding deleted variants
- Brands: Counted from active brand-store relations
- Warehouses: Counted for active, non-deleted warehouses
- Products: Counted for non-deleted products (item groups)
Sales Status Details
- Customers: Counted from customer-store relations, excluding deleted customers
- Customer Groups: Global count (not store-specific)
- Sales Invoices: Counted for non-deleted invoices
- Price Lists: Counted for active selling price lists
- Item Prices: Counted for all item prices in selling price lists
Purchase Status Details
- Suppliers: Counted from active supplier-store relations, excluding deleted suppliers
- Supplier Groups: Counted from active supplier group-store relations, excluding deleted groups
- Purchase Invoices: Counted for all purchase invoices
- Purchase Orders: Counted for all purchase orders
- Price Lists: Counted for active buying price lists
- Item Prices: Counted for all item prices in buying price lists
Summary
- Authenticate - Obtain JWT token and ensure store access
- Choose Status Type - Select the type of status to retrieve: stock, sell, or buy
- Make Request - GET request to /status/:type with x-store-id header
- Process Response - Receive counts object with relevant metrics for the selected type
Item API
Create and manage optical items
Customer API
Create and manage optical customers