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.
AmountnumberAmount taken on this receipt.
StatusNamestringReceipt status label.
BalancenumberBalance still outstanding.
ReceiptTotalAmountnumberTotal received against the order so far.
SOTotalAmountnumberOrder total.

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.

Example response — 200 OK

[
  {
    "ReceiptId": "Q2ZQdGhSZVhBaVlXTnpaWFF3TWk0d01B",
    "ReceiptNo": "REC-2024-0321",
    "Name": "Advance",
    "SalesOrderNo": "SO-2024-0568",
    "InvoiceNO": "INV-2024-1042",
    "Date": "2024-01-16T00:00:00",
    "Amount": 3000.00,
    "StatusName": "Active",
    "Balance": 5500.00,
    "ReceiptTotalAmount": 3000.00,
    "SOTotalAmount": 8500.00
  }
]
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
Items[].ReceiptIdstringEncrypted receipt ID.
Items[].ReceiptNostringReceipt number.
Items[].ReceiptTypestringPayment method.
Items[].SalesOrderNostringOrder the payment applies to.
Items[].InvoiceNOstringInvoice number, where applicable.
Items[].CustomerNamestringCustomer name.
Items[].CustomerMobileNostringCustomer mobile number.
Items[].ReceiptDatedate-timeDate taken.
Items[].AmountnumberAmount on this receipt.
Items[].SalesOrderAmountnumberOrder total.
Items[].StatusstringStatus label.
Items[].StatusIDintegerNumeric status.
Items[].ItemCountintegerLine items on the order.
Items[].TotalReceiptnumberTotal received against the order.
Totalinteger
PageNumberinteger
PageSizeinteger

Example response — 200 OK

{
  "Items": [
    {
      "ReceiptId": "Q2ZQdGhSZVhBaVlXTnpaWFF3TWk0d01B",
      "ReceiptNo": "REC-2024-0321",
      "ReceiptType": "Advance",
      "SalesOrderNo": "SO-2024-0568",
      "InvoiceNO": "INV-2024-1042",
      "CustomerName": "Rajesh Sharma",
      "CustomerMobileNo": "9876543210",
      "ReceiptDate": "2024-01-16T00:00:00",
      "Amount": 3000.00,
      "SalesOrderAmount": 8500.00,
      "Status": "Active",
      "StatusID": 1,
      "ItemCount": 1,
      "TotalReceipt": 3000.00
    }
  ],
  "Total": 38,
  "PageNumber": 1,
  "PageSize": 20
}

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"
  }'

This is an aggregate query. Parse it defensively, and cache the result rather than calling it on every page view — it is an aggregate query.

Example response — 200 OK

{
  "TodaySalesOrder": 12500.50,
  "MonthlySalesOrder": 385000.00,
  "TotalSalesOrder": 4250000.00,
  "TodayReceipt": 9500.00,
  "MonthlyReceipt": 310000.00,
  "TotalReceipt": 3800000.00,
  "TodayCustomers": 8,
  "MonthlyCustomers": 215,
  "TotalCustomers": 3420
}
Chat with us Call us