Item types, categories and sub-categories, item search, the country/state/financial-year masters, and server-rendered invoice and receipt PDFs.
15 endpoints in this module. Every request needs a JWT bearer token — see Authentication.
This module holds the reference data every other module depends on: the product catalog hierarchy, the geography and financial-year masters, and the document renderer that turns an invoice or receipt into a printable PDF.
The catalog is a three-level tree — item type (frame, spectacle
lens, contact lens, sunglass, accessory) contains categories, which
contain sub-categories. Walk it top-down, or jump straight to
SearchItems if you already know what you are looking
for.
Cache this data. Item types, categories, countries, states and financial years change perhaps once a year. Fetch them at start-up and refresh daily — calling them per transaction wastes your rate-limit headroom.
Returns the top level of the catalog. Start here, then drill into categories. This is one of the few endpoints whose response schema is declared in the specification.
| Field | Type | Description |
|---|---|---|
| value | string | Encrypted item-type ID. Pass this as itemTypeID downstream. |
| name | string | Display name, for example "Frame" or "Spectacle Lens". |
| moduleID | string | Encrypted ID of the module this type belongs to. |
| itemImagePath | string | Icon or representative image path. |
curl https://api.opto-soft.com/api/Common/GetItemTypes \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"value": "ENCRYPTED_ITEM_TYPE_ID",
"name": "Frame",
"moduleID": "ENCRYPTED_MODULE_ID",
"itemImagePath": "/images/itemtypes/frame.png"
}
]
Returns the categories under one item type — the second level of the tree.
| Field | Type | Required | Description |
|---|---|---|---|
| itemTypeID | string | Required | Encrypted item-type ID from GetItemTypes. |
curl -X POST https://api.opto-soft.com/api/Common/GetCategoriesByItemType \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "itemTypeID": "ENCRYPTED_ITEM_TYPE_ID" }'
Returns the sub-categories under one category — the third and deepest level.
| Field | Type | Required | Description |
|---|---|---|---|
| categoryID | string | Required | Encrypted category ID from GetCategoriesByItemType. |
curl -X POST https://api.opto-soft.com/api/Common/GetSubCategoriesByCategory \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "categoryID": "ENCRYPTED_CATEGORY_ID" }'
The general-purpose catalog search: filter by any level of the tree, by free text,
or by all three. Paging uses the pageNumber /
pageSize style.
| Field | Type | Required | Description |
|---|---|---|---|
| itemTypeID | string | Optional | Restrict to one item type. |
| categoryID | string | Optional | Restrict to one category. |
| subCategoryID | string | Optional | Restrict to one sub-category. |
| searchTerm | string | Optional | Free-text match on item name, code or brand. |
| pageNumber | int32 | Required | 1-based page index. |
| pageSize | int32 | Required | Rows per page. |
curl -X POST https://api.opto-soft.com/api/Common/SearchItems \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"itemTypeID": "ENCRYPTED_ITEM_TYPE_ID",
"searchTerm": "titanium",
"pageNumber": 1,
"pageSize": 25
}'
OptoSoft groups item types into modules — optical, and optionally other retail verticals the same store runs. These four endpoints navigate that grouping.
Returns the item types belonging to one module — the module-scoped equivalent
of GetItemTypes.
| Field | Type | Required | Description |
|---|---|---|---|
| moduleID | string | Required | Encrypted module ID, available on GetItemTypes results. |
curl -X POST https://api.opto-soft.com/api/Module/GetItemTypesByModule \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "moduleID": "ENCRYPTED_MODULE_ID" }'
Returns the entire category and sub-category tree for an item type in one call.
Prefer this over calling GetCategoriesByItemType
and then GetSubCategoriesByCategory per node
— it saves a round trip per category.
| Field | Type | Required | Description |
|---|---|---|---|
| itemTypeID | string | Required | Encrypted item-type ID. |
curl -X POST https://api.opto-soft.com/api/Module/GetCategoryTreeByItemType \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "itemTypeID": "ENCRYPTED_ITEM_TYPE_ID" }'
Returns the sale types available in the Quick Sale screen for a module — which product sections the counter operator can bill from.
| Field | Type | Required | Description |
|---|---|---|---|
| moduleID | string | Required | Encrypted module ID. |
| value | string | Optional | Encrypted ID, when narrowing to one type. |
| name | string | Optional | Display name filter. |
| itemImagePath | string | Optional | Image path. Not normally sent on a request. |
curl -X POST https://api.opto-soft.com/api/Module/GetQuickSaleTypes \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "moduleID": "ENCRYPTED_MODULE_ID" }'
A module-scoped sale commit, parallel to /api/quickSale/SaveSale.
Prefer /api/quickSale/SaveSale.
The OpenAPI specification declares this endpoint’s request body as an
untyped object with no schema, so its contract is not verifiable from the spec.
If your integration needs this specific endpoint,
contact the OptoSoft team
for the expected payload before building against it.
Untyped JSON object. Not specified.
Returns the country master with encrypted IDs, for
countryID on customer and doctor records.
None.
curl https://api.opto-soft.com/api/Common/GetCountries \
-H "Authorization: Bearer YOUR_TOKEN"
Returns the states within a country. For India this is the list that drives the GST place-of-supply rule, so setting a customer’s state correctly is what makes CGST + SGST versus IGST come out right on their invoices.
| Name | Type | Required | Description |
|---|---|---|---|
| countryId | string | Required | Encrypted country ID from GetCountries. |
curl https://api.opto-soft.com/api/Common/GetStates/ENCRYPTED_COUNTRY_ID \
-H "Authorization: Bearer YOUR_TOKEN"
Returns the financial years configured for the company. Almost every search
endpoint takes a yearID, so resolve the current
year from here at start-up rather than hard-coding it — it rolls over every
1 April in India.
None.
curl https://api.opto-soft.com/api/Common/GetYears \
-H "Authorization: Bearer YOUR_TOKEN"
Four endpoints render printable documents. Each has a
PDF variant returning binary bytes and an
HTML variant returning markup you can restyle or embed. All four are
POST, and all four take the branch and company as
query parameters while the document payload goes in the body.
The specification types the request body of all four as a bare
string rather than a structured object. In practice
this is the serialised document model. Round-trip it from
get-invoice-data-by-salesorder
rather than constructing it by hand.
Renders a GST invoice as a PDF. Returns binary bytes, not JSON.
| Name | Type | Required | Description |
|---|---|---|---|
| CompanyID | string | Required | Encrypted company ID. Note the capitalised name. |
| BranchID | string | Required | Encrypted branch ID, for the letterhead. |
curl -X POST "https://api.opto-soft.com/api/Common/invoice/pdf?CompanyID=ENCRYPTED_COMPANY_ID&BranchID=ENCRYPTED_BRANCH_ID" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @invoice.json \
-o invoice.pdf
The HTML variant of the invoice renderer. Use it to preview an invoice in a browser or an in-app web view, or to apply your own print stylesheet.
| Name | Type | Required | Description |
|---|---|---|---|
| CompanyID | string | Required | Encrypted company ID. |
| BranchID | string | Required | Encrypted branch ID. |
curl -X POST "https://api.opto-soft.com/api/Common/invoice/pdf/html?CompanyID=ENCRYPTED_COMPANY_ID&BranchID=ENCRYPTED_BRANCH_ID" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @invoice.json \
-o invoice.html
Renders a payment receipt as a PDF. Unlike the invoice renderer, this one can
locate the receipt itself from receiptNo.
| Name | Type | Required | Description |
|---|---|---|---|
| receiptNo | string | Required | Receipt number to render. |
| external | boolean | Optional | Set true to use the external-facing receipt template rather than the internal one. |
| CompanyID | string | Required | Encrypted company ID. |
| BranchID | string | Required | Encrypted branch ID. |
curl -X POST "https://api.opto-soft.com/api/Common/receipt/pdf?receiptNo=RCP%2F2026%2F002210&external=true&CompanyID=ENCRYPTED_COMPANY_ID&BranchID=ENCRYPTED_BRANCH_ID" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-o receipt.pdf
The HTML variant of the receipt renderer — ideal for thermal printers driven from a browser, or for emailing a receipt as inline HTML.
| Name | Type | Required | Description |
|---|---|---|---|
| receiptNo | string | Required | Receipt number to render. |
| external | boolean | Optional | Use the external-facing template. |
| CompanyID | string | Required | Encrypted company ID. |
| BranchID | string | Required | Encrypted branch ID. |
curl -X POST "https://api.opto-soft.com/api/Common/receipt/pdf/html?receiptNo=RCP%2F2026%2F002210&CompanyID=ENCRYPTED_COMPANY_ID&BranchID=ENCRYPTED_BRANCH_ID" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-o receipt.html