Skip to content

Sales Vouchers

Returns Tally Sales vouchers built from invoices. Each invoice produces exactly one sales voucher.

A Sales voucher records that revenue was earned. It does not record that money changed hands. That is what Receipt vouchers are for. The same invoice will appear here once and, after it is paid, also appear in the Receipt feed once. The two are recorded independently.

Endpoint

MethodURL
GET/tally/sales

No query parameters. Returns every unrecorded sales voucher in one response, sorted by invoice creation date ascending.

Filtering rules

  • Already-recorded sales vouchers are excluded.

There is no date range filter and no pagination.

Sales recording vs Receipt recording

Marking an invoice as Sales-recorded does not mark it as Receipt-recorded. They are independent.

Response schema

The response envelope is { status, data, message } (see Overview). The data field is an array of sales voucher objects:

FieldTypeDescription
voucheridstringStable unique ID for the voucher
vouchernumberstringThe invoice number, falling back to voucherid if not set
vouchertypenamestringAlways "Sales"
datestringISO 8601 timestamp, or ""
referencestringThe invoice reference number, or ""
narrationstringAuto-generated description
addressstringClient address, or ""
vatregistrationtypestring"Regular" if the invoice has VAT, "Unregistered" otherwise
statenamestringClient region name, or ""
countrystringAlways "Tanzania"
partyledgerstringClient name, or ""
partyaliasstringAlways ""
mailingnamestringClient name, or ""
salestaxnostringClient VAT registration number, or ""
despatchdocumentnostringAlways ""
despatchthroughstringTruck name when applicable, otherwise ""
destinationstringAlways ""
vehiclenostringTruck name when applicable, otherwise ""
PINstringClient tax ID, or ""
billsBill[]Always exactly one entry. See Bill Object
ledgersLedger[]One or two entries. See Ledger Object
_internalMetadatastringOpaque base64 blob. Pass back to POST /tally/record to mark this voucher as Sales-recorded

Ledger object

The ledgers array always contains the revenue ledger, and optionally a VAT ledger:

FieldTypeDescription
ledgernamestring"Transport Sales" for the revenue ledger, "VAT - OUTPUT 18%" for the VAT ledger
amountnumberThe ledger amount
costcentesCostCenter[]Always [] for sales vouchers

The VAT ledger only appears when the invoice has VAT. Iterate the array, do not assume a fixed length.

Bill object

The top-level bills array always contains exactly one entry:

FieldTypeDescription
namestringInvoice reference number, or ""
amountnumberInvoice grand total

Example response

json
{
  "status": "success",
  "data": [
    {
      "voucherid": "65f1a2b3c4d5e6f7a8b9c0d3",
      "vouchernumber": "INV-04812",
      "vouchertypename": "Sales",
      "date": "2026-04-01T09:00:00.000Z",
      "reference": "REF-2026-04-001",
      "narration": "Sales invoice REF-2026-04-001 for Acme Logistics Ltd",
      "address": "Plot 42, Nyerere Road",
      "vatregistrationtype": "Regular",
      "statename": "Dar es Salaam",
      "country": "Tanzania",
      "partyledger": "Acme Logistics Ltd",
      "partyalias": "",
      "mailingname": "Acme Logistics Ltd",
      "salestaxno": "40-001234-X",
      "despatchdocumentno": "",
      "despatchthrough": "T 827 EEX",
      "destination": "",
      "vehicleno": "T 827 EEX",
      "PIN": "123-456-789",
      "bills": [
        { "name": "REF-2026-04-001", "amount": 1180000 }
      ],
      "ledgers": [
        {
          "ledgername": "Transport Sales",
          "amount": 1000000,
          "costcentes": []
        },
        {
          "ledgername": "VAT - OUTPUT 18%",
          "amount": 180000,
          "costcentes": []
        }
      ],
      "_internalMetadata": "eyJ0Ijoic2FsZXMiLCJpZCI6IjY1ZjFhMmIzYzRkNWU2ZjdhOGI5YzBkMyJ9"
    }
  ],
  "message": "Sales vouchers fetched successfully"
}

Example request

bash
curl -H "x-api-key: your-api-key-here" \
  https://api.example.com/tally/sales
js
const res = await fetch("https://api.example.com/tally/sales", {
  headers: {
    "x-api-key": process.env.TALLY_API_KEY,
  },
});
const { data: vouchers } = await res.json();

Common mistakes

Confusing Sales with Receipt

Sales vouchers represent revenue earned. Receipt vouchers represent money received. The same invoice produces both, and they must be recorded independently.

Missing the optional VAT ledger

The ledgers array contains the VAT ledger only when the invoice has VAT. Iterate the array, do not index a fixed position.