Payments & Reporting – OptoSoft API

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 in this module. Every request needs a JWT bearer token — see Authentication.

JWT bearer auth JSON request & response 85 documented endpoints Reviewed monthly

Payments & Reporting

A receipt records money taken from a customer — an advance against an order, a balance settlement on delivery, or a payment against an invoice. The dashboard endpoint aggregates that activity into the figures a store owner checks each morning.

Reading receipts lives here. Creating a receipt is part of the counter-billing flow — see Quick Sale for /api/quickSale/SaveReceipt. To find out how much is outstanding before taking a payment, use /api/Orders/{salesOrderId}/advance-receipt-data.

Receipt endpoints

GET /api/Receipts/id Bearer token

Returns the receipts recorded against a customer and sales order — the payment history for one order. Despite the path ending in id, both identifiers are passed as query parameters and the response is an array.

Query parameters

NameTypeRequiredDescription
customerIdint64RequiredNumeric customer ID — not the encrypted string.
salesOrderIdint64RequiredNumeric sales order ID.

Response

FieldTypeDescription
receiptIdstringEncrypted receipt ID.
receiptNostringReceipt number as printed.
namestringCustomer name.
salesOrderNostringOrder the payment applies to.
invoiceNOstringInvoice number, if the receipt is against an invoice.
datedate-timeReceipt date.
amountdoubleAmount taken on this receipt.
receiptTotalAmountdoubleTotal received against the order so far.
soTotalAmountdoubleOrder total.
balancedoubleBalance still outstanding.
statusNamestringReceipt status label.

Example request

curl "https://api.opto-soft.com/api/Receipts/id?customerId=30188&salesOrderId=104822" \
  -H "Authorization: Bearer YOUR_TOKEN"

Errors

StatusCause
404No receipts found for that customer and order.
500Server error.
POST /api/Receipts/list-paged Bearer token

The full receipt register with filters and paging — the collections view. Use it for a daily-cash report, or to reconcile takings against a payment gateway. Paging uses the pageNumber / pageSize style.

Request body

FieldTypeRequiredDescription
companyIDstringRequiredEncrypted company ID — a string here, unlike the invoice search.
branchIDstringRequiredEncrypted branch ID.
yearIDstringRequiredEncrypted financial-year ID.
pageNumberint32Required1-based page index.
pageSizeint32RequiredRows per page.
customerIDstringOptionalEncrypted customer ID.
customerNamestringOptionalPartial match on customer name.
customerMobilestringOptionalCustomer mobile number.
receiptNostringOptionalReceipt number.
receiptTypestringOptionalPayment type. Values from GET /api/quickSale/Fetch-Receipt-Type.
salesOrderNostringOptionalFilter to one order.
invoiceNOstringOptionalFilter to one invoice.
datestringOptionalSingle receipt date.
fromDatestringOptionalStart of a date range.
toDatestringOptionalEnd of a date range.
amountstringOptionalExact amount filter.
statusstringOptionalReceipt status filter.
orderBystringOptionalSort column, optionally with DESC.

Example request

curl -X POST https://api.opto-soft.com/api/Receipts/list-paged \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "companyID": "ENCRYPTED_COMPANY_ID",
    "branchID": "ENCRYPTED_BRANCH_ID",
    "yearID": "ENCRYPTED_YEAR_ID",
    "fromDate": "2026-07-26",
    "toDate": "2026-07-26",
    "pageNumber": 1,
    "pageSize": 50,
    "orderBy": "ReceiptDate DESC"
  }'

Response

FieldTypeDescription
totalRowsint32Total matching receipts, before paging.
data[].receiptIdstringEncrypted receipt ID.
data[].receiptNostringReceipt number.
data[].receiptTypestringPayment method.
data[].receiptDatedate-timeDate taken.
data[].customerNamestringCustomer name.
data[].customerMobileNostringCustomer mobile number.
data[].salesOrderNostringOrder the payment applies to.
data[].invoiceNOstringInvoice number, where applicable.
data[].amountdoubleAmount on this receipt.
data[].salesOrderAmountdoubleOrder total.
data[].totalReceiptdoubleTotal received against the order.
data[].itemCountint32Line items on the order.
data[].statusstringStatus label.
data[].statusIDint32Numeric status.

Example response

{
  "totalRows": 41,
  "data": [
    {
      "receiptId": "ENCRYPTED_RECEIPT_ID",
      "receiptNo": "RCP/2026/002210",
      "receiptType": "UPI",
      "receiptDate": "2026-07-26T10:12:00",
      "customerName": "Anita Shah",
      "customerMobileNo": "9876543210",
      "salesOrderNo": "SO/2026/001842",
      "amount": 3000.00,
      "salesOrderAmount": 8450.00,
      "totalReceipt": 3000.00,
      "status": "Cleared",
      "statusID": 1
    }
  ]
}

Dashboard

POST /api/Dashboard/dashboardData Bearer token

Returns the aggregated figures shown on the OptoSoft dashboard for a branch and financial year — sales totals, order counts by status, collections and outstanding balances. This is the endpoint to feed a BI tool or an owner’s summary screen.

Request body

FieldTypeRequiredDescription
branchIDstringRequiredEncrypted branch ID to report on.
yearIDstringRequiredEncrypted financial-year ID.
statusIdint32OptionalRestrict the aggregation to one order status.
datedate-timeOptionalReporting date. Omit for the current date.

Example request

curl -X POST https://api.opto-soft.com/api/Dashboard/dashboardData \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "branchID": "ENCRYPTED_BRANCH_ID",
    "yearID": "ENCRYPTED_YEAR_ID",
    "date": "2026-07-26T00:00:00"
  }'

The response shape is not declared in the OpenAPI specification. Parse it defensively, and cache the result rather than calling it on every page view — it is an aggregate query.

Chat with us Call us