Skip to main content

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

The type 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

Success Response:

Example 2: Get Sales Status

Success Response:

Example 3: Get Purchase Status

Success Response:

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:
Missing 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

  1. Authenticate - Obtain JWT token and ensure store access
  2. Choose Status Type - Select the type of status to retrieve: stock, sell, or buy
  3. Make Request - GET request to /status/:type with x-store-id header
  4. Process Response - Receive counts object with relevant metrics for the selected type
This API provides a quick way to monitor the health and activity of your optical store by retrieving aggregated counts for stock management, sales operations, and purchase operations.

Item API

Create and manage optical items

Customer API

Create and manage optical customers