Skip to main content

Sign Receipt

Signs a fiscal invoice, credit note, or debit note and submits it to ZIMRA.

POST /api/receipt/sign

Request Body

FieldTypeRequiredDescription
ZimraDeviceIdintYesThe ZIMRA device ID to sign the receipt with. Obtain from your CloudESD portal.
TypestringYes"FiscalInvoice", "CreditNote", or "DebitNote"
CurrencystringYesISO 4217 currency code (3 uppercase letters, e.g. "USD", "ZWG"). Note: "ZIG" is automatically converted to "ZWG".
ReferencestringYesYour unique receipt reference. Must be unique per taxpayer.
DatedatetimeYesReceipt date/time. Milliseconds are truncated. See Device Constraints.
ReceiptLinesTaxInclusiveboolYesWhether UnitPrice and LineTotal on receipt lines include tax. This significantly affects how tax calculations are validated — see Tax Calculation.
TotalAmountdecimalYesReceipt total inclusive of all taxes. Max 2 decimal places. Must be >= 0 for FiscalInvoice/DebitNote or <= 0 for CreditNote.
ReceiptLinesarrayYesAt least one receipt line. See Receipt Line.
PaymentsarrayYesAt least one payment. See Payment.
TaxesarrayYesTax summary grouped by tax type. See Tax Summary.
OriginalReferencestringCredit/Debit notes onlyThe Reference of the original fiscal invoice being credited/debited. See Credit & Debit Notes.
OriginalFiscalDayNumberintConditionalRequired for credit/debit notes only if the original receipt was not processed through this system. See External Original Invoices.
OriginalGlobalCounterintConditionalRequired for credit/debit notes only if the original receipt was not processed through this system.
OriginalZimraDeviceIdintConditionalRequired for credit/debit notes only if the original receipt was not processed through this system.
NotesstringCredit/Debit notes onlyReason for the credit or debit note. Required for CreditNote and DebitNote.
ReceiptPrintFormstringNo"Receipt48" (default, 48 chars/line receipt paper) or "InvoiceA4" (A4 invoice format)
BuyerTINstringConditionalBuyer's TIN/BP number. Must be exactly 10 digits if supplied. Required if BuyerVAT is supplied.
BuyerVATstringNoBuyer's VAT number. Must be exactly 9 digits if supplied. If supplied, both BuyerTIN and BuyerName become required.
BuyerNamestringConditionalRequired if BuyerTIN or BuyerVAT is supplied.
BuyerAddressstringNoMax 400 characters. Format: house number, street name, city, province (comma or newline separated). e.g. "207, Josiah Tongogara Ave, Harare, Harare"
BuyerPhonestringNoMax 20 characters.
BuyerEmailstringNoMax 100 characters.
CashierstringNoCashier name, max 20 characters. May be overridden by bearer token default.

Receipt Line

FieldTypeRequiredDescription
TypestringYes"Sale" or "Discount"
NamestringYesProduct/service description, max 200 characters.
HsCodestringYesHS (Harmonized System) code. Must be 4 or 8 digits when tax % > 0; must be 8 digits when tax % = 0 or exempt. Your tenant may have auto-assignment of default HS codes enabled.
UnitPricedecimalNoPrice per unit. If supplied, LineTotal must equal UnitPrice * Quantity exactly. See Sign Rules for positive/negative requirements.
QuantitydecimalYesMust be greater than zero.
LineTotaldecimalYesTotal for the line. Max 2 decimal places. If ReceiptLinesTaxInclusive is true, this includes tax. See Sign Rules.
TaxPercentdecimal?YesThe tax percentage for this line. A value of 15% VAT should be 15 (not 0.15). Set to null for tax-exempt lines (which is not the same as 0). Retrieve valid tax percentages from the Get Device endpoint. This field must always be present in the JSON, even when null.

Payment

FieldTypeRequiredDescription
TypestringYesOne of: "Cash", "Card", "MobileWallet", "Coupon", "Credit", "BankTransfer", "Other"
AmountdecimalYesMust be >= 0 for FiscalInvoice/DebitNote or <= 0 for CreditNote. The sum of all payment amounts must equal TotalAmount.

Tax Summary

Each entry represents one tax type used across receipt lines. Group by tax percentage.

FieldTypeRequiredDescription
TaxPercentdecimal?YesThe tax percentage (e.g. 15), or null for exempt. Must match a tax type on the device.
SalesAmountWithTaxdecimalYesThe total of all receipt line totals for this tax type (including tax). See Tax Calculation.
TaxAmountdecimalYesThe calculated tax amount. See Tax Calculation.

Example: Tax-Inclusive Fiscal Invoice

{
"ZimraDeviceId": 12345,
"Type": "FiscalInvoice",
"Currency": "USD",
"Reference": "INV-2025-001",
"Date": "2025-03-15T10:30:00",
"ReceiptLinesTaxInclusive": true,
"TotalAmount": 115.00,
"ReceiptPrintForm": "Receipt48",
"BuyerName": "Acme Corp",
"BuyerTIN": "1234567890",
"ReceiptLines": [
{
"Type": "Sale",
"Name": "Widget A",
"HsCode": "84719000",
"UnitPrice": 50.00,
"Quantity": 2,
"LineTotal": 100.00,
"TaxPercent": 15
},
{
"Type": "Sale",
"Name": "Consulting Service",
"HsCode": "99800000",
"UnitPrice": 15.00,
"Quantity": 1,
"LineTotal": 15.00,
"TaxPercent": 0
}
],
"Payments": [
{
"Type": "Card",
"Amount": 115.00
}
],
"Taxes": [
{
"TaxPercent": 15,
"SalesAmountWithTax": 100.00,
"TaxAmount": 13.04
},
{
"TaxPercent": 0,
"SalesAmountWithTax": 15.00,
"TaxAmount": 0.00
}
]
}

Example: Credit Note

{
"ZimraDeviceId": 12345,
"Type": "CreditNote",
"Currency": "USD",
"Reference": "CN-2025-001",
"OriginalReference": "INV-2025-001",
"Date": "2025-03-16T09:00:00",
"Notes": "Customer returned Widget A",
"ReceiptLinesTaxInclusive": true,
"TotalAmount": -50.00,
"ReceiptLines": [
{
"Type": "Sale",
"Name": "Widget A",
"HsCode": "84719000",
"UnitPrice": -50.00,
"Quantity": 1,
"LineTotal": -50.00,
"TaxPercent": 15
}
],
"Payments": [
{
"Type": "Cash",
"Amount": -50.00
}
],
"Taxes": [
{
"TaxPercent": 15,
"SalesAmountWithTax": -50.00,
"TaxAmount": -6.52
}
]
}

Response (200 OK)

The response includes all fields from the request plus the following:

FieldTypeDescription
DeviceSignaturestringDigital signature generated by the device
DeviceHashstringHash value of the receipt data
DeviceSerialNumberstringSerial number of the signing device
FiscalDayCounterintSequential receipt number within the fiscal day
FiscalDayNumberintFiscal day number
GlobalCounterintGlobal sequential receipt counter for the device
VerificationCodestring?QR code verification code
QrCodeContentstring?Full QR code URL for receipt verification
SubmissionFaileddatetime?If ZIMRA submission failed, the timestamp of the failure
SubmissionErrorstring?Error message from ZIMRA if submission failed

Error Responses

Status CodeReason
400 Bad RequestValidation errors in the receipt data. Check the errors array for details.
401 UnauthorizedAuthentication failed
409 ConflictA receipt with the same Reference already exists but with different data. See Idempotency.
503 Service UnavailableDevice is in its 2-hour maintenance window, the fiscal day is not open, or the fiscal day has exceeded its maximum length. See Device Constraints.