LensMate Integration


Enabling LensMate Integration


Before LensMate can communicate with your system, the integration must be enabled and your API key must be shared with the LensMate team.

Steps to Enable LensMate Integration

  1. Navigate to Settings → Integrations.
  2. Locate LensMate Settings.
  3. Toggle the integration status to Enabled.

Once enabled:

  • A unique API key will be automatically generated and displayed.
  • Copy this API key and share it with the LensMate team.
  • The LensMate team will register the key on their side to authenticate all requests between LensMate and your system.


After completing the LensMate integration setup and sharing the API key with the LensMate team, you can now start processing requests through LensMate.


1)  API Documentation


Details about the API endpoints, request/response format, and integration process.

2)  Displaying Data in the System


Steps to view the updated order data in the Sales module.


1) API Documentation  


1. Get Order Data

Endpoint: /api/lensmate/order/<order_number>    

Method: GET

Headers Required:

X-API-Key: your_api_key
Content-Type: application/json

Example Request:

curl -X GET \
  'https://your-got2-instance.com/api/lensmate/order/SO001' \
  -H 'X-API-Key: your_api_key' \
  -H 'Content-Type: application/json'

Response Format:

{
    "TrayNumber": "string",
    "Comments": "string",
    "ContactLast": "string",
    "ContactFirst": "string",
    "ContactMI": "string",
    "FraBarcode": "string",
    "FraMaterial": "string",
    "FraEyeShape": "string",
    "FraEdgeType": "string",
    "FraA": 0,
    "FraB": 0,
    "FraED": 0,
    "FraDBL": 0,
    "LenMaterial": "string",
    "LenIndex": 0,
    "LenType": "string",
    "LenThickEnum": 0,
    "LenBarcodeL": "string",
    "LenBalanceL": false,
    "LenFinishedL": false,
    "LenDiaL": 0,
    "LenSegWdL": 0,
    "LenBowlDiaL": 0,
    "LenThickCenterL": 0,
    "LenLRPInL": 0,
    "LenLRPDownL": 0,
    "LenPRPOutL": 0,
    "LenPRPUpL": 0,
    "LenSlabL": 0,
    "LenTrueFrontL": 0,
    "LenBackCurveL": 0,
    "LenCarrierCurveL": 0,
    "RxSphL": 0,
    "RxCylL": 0,
    "RxAxisL": 0,
    "RxPrismHorizL": 0,
    "RxPrismDirHorizEnumL": 0,
    "RxPrismVertL": 0,
    "RxPrismDirVertEnumL": 0,
    "RxAddL": 0,
    "RxIPDL": 0,
    "RxNPDL": 0,
    "OCHtL": 0,
    "SegHtL": 0,
    "LenBarcodeR": "string",
    "LenBalanceR": false,
    "LenFinishedR": false,
    "LenDiaR": 0,
    "LenSegWdR": 0,
    "LenBowlDiaR": 0,
    "LenThickCenterR": 0,
    "LenLRPInR": 0,
    "LenLRPDownR": 0,
    "LenPRPOutR": 0,
    "LenPRPUpR": 0,
    "LenSlabR": 0,
    "LenTrueFrontR": 0,
    "LenBackCurveR": 0,
    "LenCarrierCurveR": 0,
    "RxSphR": 0,
    "RxCylR": 0,
    "RxAxisR": 0,
    "RxPrismHorizR": 0,
    "RxPrismDirHorizEnumR": 0,
    "RxPrismVertR": 0,
    "RxPrismDirVertEnumR": 0,
    "RxAddR": 0,
    "RxIPDR": 0,
    "RxNPDR": 0,
    "OCHtR": 0,
    "SegHtR": 0
}
2. Update Order Data

Endpoint: /api/lensmate/update_order    

Method: POST

Headers Required:

X-API-Key: your_api_key
Content-Type: application/json

Request Body:

{
    "order_number": "SO001",
    "lab_ticket": "LAB123",
    "lensmate_order_number": "LM456"
}

Example Request:

curl -X POST \
  'https://your-got2-instance.com/api/lensmate/update_order' \
  -H 'X-API-Key: your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{
    "order_number": "SO001",
    "lab_ticket": "LAB123",
    "lensmate_order_number": "LM456"
}'

Success Response:

{
    "status": "success",
    "message": "Order updated successfully"
}
Common Error Responses for Both APIs:
  • 401: Invalid API key
  • 403: Integration not enabled
  • 404: Order not found
Notes:
  • Both endpoints require a valid API key in the X-API-Key header
  • The integration must be enabled in settings
  • For the update endpoint, at least one of lab_ticket or lensmate_order_number must be provided
  • All responses are in JSON format

Order gets pulled by Got2 order number inside Lensmate system. Lab operator will eneter the Got2 order number inside Lensmate to get order details.

2) How to Show Data In the System


To view the updated order data in our system, first navigate to the Sales module. Then search for the specific Sales Order number and open it to view the details.


After that, open the Sales Order and navigate to the Transmission Settings tab. Inside this tab, locate the LensMate section. Here, you will be able to see all the details related to LensMate, including:

  • Lab Vendor
  • Lab Ticket Number
  • Last Updated
  • Lab Status and Comment

Still need help? Contact Us Contact Us