Add a Sale

POST/api/v1/sales

Submit a sales invoice to Kenya Revenue Authority. This is the core compliance endpoint, every sale your business makes must be submitted here before or immediately after issuing a receipt to the buyer. Kenya Revenue Authority returns a receipt signature and internal data that must appear on every printed or digital receipt.

Requires x-api-key

http://localhost:8100/api/v1/sales

Transaction Fields

FieldTypeRequiredDescription
invcNostringRequiredYour internal invoice/receipt number. Must be unique per taxpayer.
orgInvcNostringOptionalOriginal invoice number, required only for credit notes and copies.
salesDtstringRequiredSale date in YYYYMMDD format (e.g. 20240115).
stockRlsDtstringOptionalStock release date in YYYYMMDDHHmmss format.
custTinstringOptional11-character Kenya Revenue Authority PIN of the buyer. Required for B2B sales.
custNmstringOptionalBuyer name. Required if custTin is provided.
pmtTyCdstringRequiredPayment method code. See Payment Method Codes section.
rcptTyCdstringRequiredReceipt type: S=Sale, R=Return, T=Training, C=Copy.
salesSttsCdstringRequiredSales status code. See Sales Status Codes section.
cfmDtstringOptionalConfirmation date in YYYYMMDDHHmmss format.
currencystringRequiredTransaction currency (e.g. KES, USD).
exchangeRatenumberRequiredExchange rate to KES. Use 1 for KES transactions.
destnCountryCdstringRequiredDestination country code (e.g. KE for domestic).
prchrAcptcYnstringOptionalPurchaser acceptance: Y or N.
remarkstringOptionalOptional remark for this transaction.
totTaxblAmtnumberRequiredTotal taxable amount (exclusive of VAT).
totTaxnumberRequiredTotal VAT amount.
totAmtnumberRequiredTotal invoice amount inclusive of VAT (totTaxblAmt + totTax).

Line Item Fields

FieldTypeRequiredDescription
itemSeqnumberOptionalLine item sequence number. Auto-assigned if omitted.
itemCdstringRequiredItem code from your registered items (e.g. SV0000000Z001).
itemClsCdstringOptionalItem class code: SV=Service, GD=Goods. Inferred from itemCd if omitted.
itemNmstringRequiredItem name as it appears on the receipt.
bcdstringOptionalBarcode for goods items.
pkgUnitCdstringOptionalPackaging unit code.
pkgnumberOptionalPackage count.
qtyUnitCdstringRequiredQuantity unit code (e.g. U=Unit, KG=Kilogram).
qtynumberRequiredQuantity sold.
prcnumberOptionalUnit price before discount.
splyAmtnumberOptionalSupply amount (qty x prc).
dcRtnumberOptionalDiscount rate as a percentage (0-100).
dcAmtnumberOptionalDiscount amount in KES.
taxTyCdstringRequiredTax type: A=Exempt, B=16% VAT, C=0% VAT, D=Non-VAT.
taxblAmtnumberRequiredTaxable amount for this line (exclusive of VAT). For type B: totAmt / 1.16.
taxAmtnumberRequiredVAT amount for this line. For type B: taxblAmt * 0.16.
totAmtnumberRequiredTotal amount for this line inclusive of VAT.
itemExpiryDtstringOptionalExpiry date for perishable goods in YYYYMMDD format.

Payment Method Codes

Receipt Type Codes

Sales Status Codes

Important

Print on Every Receipt

Request

{
  "transaction": {
    "invcNo": "INV-2024-001",
    "salesDt": "20240115",
    "custTin": "A000000000Z",
    "custNm": "BUYER COMPANY LTD",
    "pmtTyCd": "09",
    "rcptTyCd": "S",
    "salesSttsCd": "02",
    "currency": "KES",
    "exchangeRate": 1,
    "destnCountryCd": "KE",
    "totTaxblAmt": 4310.34,
    "totTax": 689.66,
    "totAmt": 5000
  },
  "items": [
    {
      "itemCd": "SV0000000Z001",
      "itemNm": "Monthly SaaS Subscription",
      "qtyUnitCd": "U",
      "qty": 1,
      "prc": 5000,
      "splyAmt": 5000,
      "dcRt": 0,
      "dcAmt": 0,
      "taxTyCd": "B",
      "taxblAmt": 4310.34,
      "taxAmt": 689.66,
      "totAmt": 5000
    }
  ]
}

Response

{
  "resultCd": "000",
  "resultMsg": "Sales invoice submitted successfully",
  "data": {
    "cisInvcNo": 42,
    "intrlData": "AbCdEfGhIjKlMnOpQrStUvWxYz...",
    "rcptSign": "XxXxXxXxXxXxXxXxXxXxXxXx...",
    "sdcDateTime": "20240115103045",
    "totRcptNo": 42,
    "vsdcRcptPbctDate": "20240115",
    "resultDt": "20240115103045"
  }
}
curl -X POST http://localhost:8100/api/v1/sales \\
  -H "x-api-key: YOUR_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "transaction": {
      "invcNo": "INV-2024-001",
      "salesDt": "20240115",
      "pmtTyCd": "09",
      "rcptTyCd": "S",
      "salesSttsCd": "02",
      "currency": "KES",
      "exchangeRate": 1,
      "destnCountryCd": "KE",
      "totTaxblAmt": 4310.34,
      "totTax": 689.66,
      "totAmt": 5000
    },
    "items": [
      {
        "itemCd": "SV0000000Z001",
        "itemNm": "Monthly SaaS Subscription",
        "qtyUnitCd": "U",
        "qty": 1,
        "prc": 5000,
        "splyAmt": 5000,
        "dcRt": 0,
        "dcAmt": 0,
        "taxTyCd": "B",
        "taxblAmt": 4310.34,
        "taxAmt": 689.66,
        "totAmt": 5000
      }
    ]
  }'