Kumusoft Solutions
EFRIS API
Auth Service
EFRIS API
Auth Service
  1. EFRIS API
  • Get Current Taxpayer Details
    GET
  • Update AES Key
    POST
  • Get Efris Stock Items
    GET
  • Update Stock List
    POST
  • Verify TIN
    GET
  • Fiscalise
    POST
  • Preview Invoice
    POST
  • Issue CreditNote
    POST
  • Register EFRIS Product
    POST
  • Get Units Of Measure
    GET
  • Increase Stock
    POST
  • EFRIS Invoice Report
    POST
  • Invoice Details
    GET
  • Get Saved Items List
    GET
  • Get Master Data
    GET
  • Reduce stock
    POST
  1. EFRIS API

Preview Invoice

POST
/efris/preview

Endpoint Description#

This endpoint is used to preview an invoice based on the provided seller and buyer details, as well as the items being purchased. It processes the information and returns a structured response that includes the outcome of the preview operation.

Request Body#

The request must be sent as a JSON object with the following structure:
data: An object containing the invoice details.
sellerDetails: An object with seller information.
referenceNo: A string representing the seller's reference number.
basicInformation: An object with basic invoice details.
currency: A string indicating the currency used (e.g., "UGX").
invoiceType: An integer representing the type of invoice.
invoiceKind: An integer representing the kind of invoice.
invoiceIndustryCode: A string representing the industry code for the invoice.
buyerDetails: An object containing buyer information.
buyerBusinessName: A string for the buyer's business name.
buyerLegalName: A string for the buyer's legal name.
buyerType: A string indicating the type of buyer.
buyerTin: A string for the buyer's Tax Identification Number (TIN).
itemsBought: An array of objects, each representing an item purchased.
itemCode: A string for the item code.
quantity: An integer for the quantity of the item.
unitPrice: A number representing the unit price of the item.
total: A number for the total price of the item.
taxForm: A string indicating the tax form applicable to the item.
taxRule: A string indicating the tax rule applicable to the item.
discountFlag: An integer indicating if a discount is applied.
discountTotal: A number representing the total discount applied.
exciseFlag: A string indicating if excise tax is applicable.
exciseRate: A string for the excise tax rate.
exciseUnit: A string for the unit of excise tax.
exciseTax: A string representing the excise tax amount.
exciseCurrency: A string indicating the currency for the excise tax.

Response Structure#

The response will include the result of the preview operation, typically containing:
status: A string indicating the success or failure of the request.
message: A string providing additional information about the operation.
data: An object containing any relevant data returned from the preview operation, such as calculated totals or validation messages.
Ensure that the request body adheres to the specified structure to receive a valid response.
The POST /efris/preview endpoint is designed to generate a preview of an invoice based on the provided seller and buyer details, along with the items being purchased. This endpoint is useful for users who want to review the invoice details before finalizing the transaction.

Request Parameters#

The request body must be in JSON format and should contain the following structure:
data: An object that encapsulates all details necessary for invoice generation.
sellerDetails: An object containing information about the seller.
referenceNo (string): A unique reference number for the seller.
basicInformation: An object that includes general invoice information.
currency (string): The currency code (e.g., "UGX").
invoiceType (integer): The type of invoice (e.g., 1 for standard).
invoiceKind (integer): The kind of invoice (e.g., 1 for regular).
invoiceIndustryCode (string): The industry code for the invoice (e.g., "101").
buyerDetails: An object containing information about the buyer.
buyerBusinessName (string): The name of the buyer's business.
buyerLegalName (string): The legal name of the buyer.
buyerType (string): The type of buyer (e.g., "1" for individual).
buyerTin (string): The Tax Identification Number of the buyer (can be empty).
itemsBought: An array of objects representing the items being purchased.
Each item object contains:
itemCode (string): The code for the item (e.g., "Airline Insurance").
quantity (integer): The quantity of the item being purchased.
unitPrice (number): The price per unit of the item.
total (number): The total price for the item (quantity * unitPrice).
taxForm (string): The tax form applicable to the item (e.g., "101").
taxRule (string): The tax rule applicable to the item (e.g., "STANDARD").
discountFlag (integer): A flag indicating if a discount is applied.
discountTotal (number): The total discount amount.
exciseFlag (string): A flag indicating if excise tax applies.
exciseRate (string): The rate of excise tax.
exciseUnit (string): The unit of excise tax.
exciseTax (string): The amount of excise tax.
exciseCurrency (string): The currency for the excise tax.

Example Request Body#

{
  "data": {
    "sellerDetails": {
      "referenceNo": "Tb005"
    },
    "basicInformation": {
      "currency": "UGX",
      "invoiceType": 1,
      "invoiceKind": 1,
      "invoiceIndustryCode": "101"
    },
    "buyerDetails": {
      "buyerBusinessName": "Buyer Name",
      "buyerLegalName": "Buyer Legal Name",
      "buyerType": "1",
      "buyerTin": ""
    },
    "itemsBought": [
      {
        "itemCode": "Airline Insurance",
        "quantity": 1,
        "unitPrice": 45600,
        "total": 45600,
        "taxForm": "101",
        "taxRule": "STANDARD",
        "discountFlag": 2,
        "discountTotal": 0,
        "exciseFlag": "2",
        "exciseRate": "",
        "exciseUnit": "",
        "exciseTax": "",
        "exciseCurrency": "UGX"
      }
    ]
  }
}

Example Response Body#

The response will contain the generated invoice preview based on the provided request data. The structure of the response will include the invoice details, total amounts, and any applicable taxes.
{
  "status": "success",
  "message": "Invoice preview generated successfully.",
  "invoicePreview": {
    // Invoice details will be included here
  }
}

Notes#

Ensure that all required fields are provided in the request to avoid errors in generating the invoice preview.
The response will indicate whether the preview was generated successfully and provide the relevant details.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Examples

Responses

🟢200
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://auth.efris.kakasa.xyz/api/v1/efris/preview' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data": {
        "sellerDetails": {
            "referenceNo": "Tb005"
        },
        "basicInformation": {
            "currency": "UGX",
            "invoiceType": 1,
            "invoiceKind": 1,
            "invoiceIndustryCode": "101"
        },
        "buyerDetails": {
            "buyerBusinessName": "Buyer Name",
            "buyerLegalName": "Buyer Legal Name",
            "buyerType": "1",
            "buyerTin": ""
        },
        "itemsBought": [
            {
                "itemCode": "Airline Insurance",
                "quantity": 1,
                "unitPrice": 45600,
                "total": 45600,
                "taxForm": "101",
                "taxRule": "STANDARD", //EXEMPT//ZERORATED
                "discountFlag": 2,
                "discountTotal": 0,
                "exciseFlag": "2",
                "exciseRate": "",
                "exciseUnit": "",
                "exciseTax": "",
                "exciseCurrency": "UGX"
            }
        ]
    }
}'
Response Response Example
{}
Previous
Fiscalise
Next
Issue CreditNote
Built with