Add Credit Note with Barcodes
POST
/api/v1/sales/credit-note-barcodeSubmit a credit note where line items are identified by barcode (the bcd field) instead of Kenya Revenue Authority item codes. Use this endpoint when your POS system scans product barcodes rather than looking up Kenya Revenue Authority item codes.
Requires x-api-key
http://localhost:8100/api/v1/sales/credit-note-barcode
Headers
| Field | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Required | Your Ushuru API key. |
| Content-Type | string | Required | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| original | object | Required | Original invoice reference. |
| original.invcNo | number | Required | Original invoice number. |
| original.trdInvcNo | string | Optional | Original trader invoice number. |
| original.creditNoteInvcNo | number | Optional | Credit note invoice number. |
| original.custTin | string | Optional | Customer Kenya Revenue Authority PIN. |
| original.custNm | string | Optional | Customer name. |
| original.pmtTyCd | string | Optional | Payment method code. |
| lineItems | array | Required | Line items identified by barcode. Each item must include the bcd field. |
| lineItems[].bcd | string | Required | Product barcode, used instead of itemCd for item identification. |
| lineItems[].itemNm | string | Required | Item name. |
| lineItems[].qtyUnitCd | string | Required | Quantity unit code. |
| lineItems[].qty | number | Required | Quantity being credited. |
| lineItems[].prc | number | Required | Unit price. |
| lineItems[].taxTyCd | string | Required | Tax type code. |
| lineItems[].taxblAmt | number | Required | Taxable amount. |
| lineItems[].taxAmt | number | Required | Tax amount. |
| lineItems[].totAmt | number | Required | Total amount. |
| reason | string | Required | Credit note reason code (01-06). |
| regrId | string | Optional | Registering user ID. |
| regrNm | string | Optional | Registering user name. |
Request
{
"original": {
"invcNo": 42,
"trdInvcNo": "INV-2024-001",
"creditNoteInvcNo": 10042,
"pmtTyCd": "09"
},
"reason": "01",
"regrId": "USR01",
"regrNm": "Admin",
"lineItems": [
{
"bcd": "5900000123456",
"itemNm": "Product Name",
"qtyUnitCd": "U",
"qty": 2,
"prc": 500,
"taxTyCd": "B",
"taxblAmt": 862.07,
"taxAmt": 137.93,
"totAmt": 1000
}
]
}Response
{
"success": true,
"data": {
"cisInvcNo": 45,
"intrlData": "AbCdEfGhIjKlMnOpQrStUvWxYz...",
"rcptSign": "XxXxXxXxXxXxXxXxXxXxXxXx...",
"sdcDateTime": "20240115111500"
}
}curl -X POST http://localhost:8100/api/v1/sales/credit-note-barcode \\
-H "x-api-key: YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"original": { "invcNo": 42, "pmtTyCd": "09" },
"reason": "01",
"regrId": "USR01",
"regrNm": "Admin",
"lineItems": [{
"bcd": "5900000123456",
"itemNm": "Product Name",
"qtyUnitCd": "U",
"qty": 2,
"prc": 500,
"taxTyCd": "B",
"taxblAmt": 862.07,
"taxAmt": 137.93,
"totAmt": 1000
}]
}'