Build on the same API that powers OptoSoft optical retail software. The OptoSoft REST API lets your own systems create customers, capture spectacle and contact-lens prescriptions, raise sales orders, generate GST invoices, record receipts and read live dashboard figures — over plain JSON, secured with JWT bearer tokens.
This reference documents 85 endpoints across 8 modules, with request and response fields, worked examples and error handling. It is written and maintained by the OptoSoft team in Ahmedabad, India, and reviewed against the live OpenAPI specification every month.
The OptoSoft REST API gives your software direct, programmatic access to an optical store’s data — customers and their prescriptions, sales orders, GST invoices, receipts, stock and daily takings. It is the same API used by the OptoSoft web application and the OptoSoft Android POS app, so anything those products can do, your integration can do too.
Typical uses include syncing customers into a CRM or marketing platform, pushing orders in from a website or marketplace, pulling invoice data into an accounting package such as Tally or Zoho Books, feeding a business-intelligence dashboard, or building a custom in-store app on top of your existing OptoSoft data.
API access is issued per company and branch. It is included with an active OptoSoft subscription at no extra licence fee. Contact us to have credentials created, and see pricing for subscription plans.
Every endpoint on this site is packaged as a ready-to-import Postman collection — all 85 requests, grouped into the same 8 modules, with pre-filled example bodies and a login script that captures your token automatically.
Collection format v2.1 · 85 requests · 8 folders · 29 pre-declared variables
username and password.{{token}} for you.companyId, branchId and yearId (from Get my profile and List financial years), then send any request.
Collection-level auth is already set to Bearer {{token}},
so every request except login inherits it. Encrypted identifiers have their own
enc* variables — paste real values in as you obtain them from
earlier responses (see Encrypted identifiers).
Numeric fields use unquoted variables — for example
"companyID": {{companyId}}. Postman substitutes the value
before sending, so the request that goes out is valid JSON
("companyID": 18). Quoting them would send a string where
the API expects an integer. Any JSON warning shown in Postman’s body editor is cosmetic.
All endpoints are served over HTTPS from a single host. Every path in this reference is relative to it.
https://api.opto-soft.com
So POST /api/Auth/login means
POST https://api.opto-soft.com/api/Auth/login.
Plain HTTP is not supported. The machine-readable OpenAPI 3.0 specification is published at
/swagger/v1/swagger.json.
The API uses JWT bearer tokens. Exchange your OptoSoft username and password for a token once, then send that token on every subsequent call.
curl -X POST https://api.opto-soft.com/api/Auth/login \
-H "Content-Type: application/json" \
-d '{
"userName": "your-optosoft-username",
"password": "your-password"
}'
curl https://api.opto-soft.com/api/Orders/cancellation-reasons \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json"
Every endpoint documented here requires the
Authorization header. A missing, malformed or expired
token returns 401 Unauthorized. Full details are on the
Authentication
page.
OptoSoft is multi-tenant and multi-branch, and Indian accounting is organised by financial year. Most search and save requests therefore carry three scoping fields:
| Field | Meaning |
|---|---|
| companyID | Your OptoSoft company (tenant). Fixed for your account. |
| branchID | The store or outlet. A multi-store chain has one ID per branch. |
| yearID | The financial year the record belongs to. Resolve the current value from GET /api/Common/GetYears. |
Note that these are typed inconsistently across the API: some endpoints take them as
numbers (int64), others as encrypted strings. Each
endpoint’s field table states which form that endpoint expects — follow it exactly.
Many request and response fields are opaque encrypted identifiers rather
than plain numbers. You will see this wherever a schema name is prefixed
Encrypted, and wherever an ID field is typed
string instead of int64
— for example customerID,
salesOrderID and
itemTypeID.
The rule for handling them is simple:
Some list responses return both forms, such as
EncryptedInvoiceListDto which carries an encrypted
id alongside a numeric
plainId. Where both exist, use the encrypted
id for follow-up API calls and keep
plainId only for your own reconciliation.
The encryption scheme is not published in the OpenAPI specification. The echo-back pattern above covers every documented workflow, because every encrypted ID you need is returned to you by an earlier call. If your integration needs to translate your own internal numeric IDs into OptoSoft encrypted IDs directly, contact the OptoSoft team for the key-exchange details.
The API uses two different paging conventions depending on the module. Check the field table for the endpoint you are calling.
| Style | Fields | Used by |
|---|---|---|
| Page number | pageNumber, pageSize | Orders search, receipts, item search |
| Row range | fromPage, toPage | Customers, invoices, doctors, WhatsApp templates |
Paged responses wrap the rows in an envelope carrying the unfiltered total, so you can compute the number of pages:
{
"totalRows": 248,
"data": [
{ "...": "one row per record" }
]
}
Sort order is controlled by an orderBy string
(a column name, optionally followed by DESC).
Omit it to accept the module default.
Errors are returned as RFC 7807 problem details with the appropriate HTTP status code:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "yearID is required.",
"instance": "/api/Invoice/List"
}
| Status | Meaning | What to do |
|---|---|---|
| 200 | Success | Parse the body. Note that a successful call can still return an empty data array. |
| 400 | Validation failed | Read detail. Usually a missing scoping field or a malformed date. |
| 401 | Unauthenticated | Token missing, malformed or expired. Call /api/Auth/login again and retry once. |
| 404 | Not found | The order, receipt or record does not exist in the requested company, branch and year scope. |
| 500 | Server error | Retry with backoff. If it persists, contact support with the request path and timestamp. |
Do not treat HTTP 200 as unconditional success on save operations. Several save endpoints return 200 with a result object describing the outcome. Always inspect the response body before marking a record as synced on your side.
No hard rate limit is published in the OpenAPI specification. In practice, treat the API as a business system rather than a bulk-export pipe:
pageSize values.500 responses.If you need a higher sustained throughput for a migration or a nightly sync, let us know in advance.
85 endpoints are documented across 8 modules. If you are starting from scratch, read Authentication first, then Customers & Prescriptions.
Obtain a JWT bearer token with your OptoSoft credentials, then read the signed-in user's profile and daily working context.
3 endpoints →Create and update customers, search the customer register, detect duplicates, and manage spectacle and contact-lens prescriptions (SPH, CYL, AXIS, ADD, PD) plus the referring-doctor master.
13 endpoints →Search sales orders with paging, read a single order and its line items, list orders carrying an outstanding balance, change order status and cancel an order with a reason.
10 endpoints →List GST invoices with paging and filters, pull the invoice-ready data for a sales order, and post a complete invoice back to OptoSoft.
6 endpoints →Read receipts against a customer or sales order, page through the receipt register with filters, and pull aggregated dashboard figures for a branch and financial year.
3 endpoints →The counter-billing workflow: build a cart in a temporary session, look up items by barcode or autocomplete, check live stock, then commit the sale, invoice and receipt in a single call.
28 endpoints →Item types, categories and sub-categories, item search, the country/state/financial-year masters, and server-rendered invoice and receipt PDFs.
15 endpoints →Register a WhatsApp Business Account against a branch and manage the message-template library, including syncing approval status back from Meta.
7 endpoints →
The current specification version is v1. OptoSoft
reviews the live OpenAPI specification against this documentation
every month and records additions, removals and field changes below.
Treat new fields appearing in a response as non-breaking — parse defensively and ignore properties you do not recognise, so that an additive change never breaks your integration.
| Date | Version | Change |
|---|---|---|
| 2026-07-26 | v1 | Initial publication of the OptoSoft Developers API reference — 85 endpoints across 8 modules. |
Yes. OptoSoft exposes a JSON REST API at https://api.opto-soft.com,
described by an OpenAPI 3.0 specification. It covers 85 documented endpoints across
authentication, customers and prescriptions, sales orders, GST invoices, receipts
and reporting, quick sale counter billing, catalog and master data, and WhatsApp
messaging configuration.
Yes — a ready-to-import
Postman collection
(format v2.1) is available free. It contains all 85 endpoints grouped into 8 folders,
pre-filled example request bodies, 29 pre-declared variables, and a login test script
that captures your JWT into the {{token}} variable
automatically, so every other request authenticates without further setup.
Post your OptoSoft username and password to /api/Auth/login
to receive a JWT. Send that token on every subsequent request in the
Authorization header as
Bearer {token}. Every endpoint except login
requires a valid bearer token.
API access is included with an active OptoSoft subscription, which starts at ₹6,000 per year in India and $399 per year internationally. There is no separate API licence fee. See OptoSoft pricing, then contact us to have API credentials issued for your company and branch.
Yes. The API is available to OptoSoft customers worldwide, including the United
States, United Kingdom, Australia, Canada, UAE, Germany, France, Japan and Brazil.
Tax fields follow the Indian GST model (CGST, SGST, IGST); customers outside India
can set tax rates to zero or use the
taxNotApplicable flag on receipts.
All requests and responses use application/json
over HTTPS. Errors follow the RFC 7807 problem-details format with
type, title,
status and detail
fields. Two endpoints additionally return binary PDF and raw HTML for printable
invoices and receipts.
OptoSoft operates inbound webhooks for its own WhatsApp Business and voice
integrations, but does not currently publish outbound webhooks for partner
systems. To detect new orders or receipts, poll the search endpoints such as
POST /api/Orders/search using a date range.
Ready to build? Request API access and we will issue credentials for your company and branch, or read more about the optical software features the API exposes.