API Docs
Overview

Fatoora API Documentation

Use this reference to authenticate with your API key, manage client records, and create invoices. The page is structured in a standard API-reference format: overview first, then resources, authentication, and endpoint-by-endpoint examples.

Resources

The API is organized into clear resource groups so developers can move from setup to production use quickly.

Auth1

API key validation and onboarding.

Client4

Create, update, delete, and list client records.

Invoice8

List invoices and create invoice variants, credit notes, and debit notes.

Authentication

Get your API key

You can get the live API key as follows:

  1. Log in to Simple Fatoora account using your Account.
  2. Select the "API Integration" button from the left menu.
  3. Choose the "API Key" and "Copy" .

Standard headers

Use these headers for authenticated JSON requests unless an endpoint says otherwise.

X-API-Key
5747324adfb***f8d374a37c612a
API key for authentication
Content-Type
application/json
JSON payload format
Auth

Authentication endpoints

Validate API Key

POST
/api_doc/users/validate_user_api_key
Used to validate API Key

Request body

Key Type Required Description
api_key string yes API key (take from website or Fatoora support)

Example request

Sample Request
{"api_key":"5747324adfb82***fbf8d374a37c612a"}

Example response

Success Response
Sample Success Response
{
    "response": "Validated successfully",
    "api_key": "5747324adfb8***08efbf8d374a37c612a",
    "status": true
}
Fail Response
Sample Fail Response
{
    "message": "Invalid API key",
    "status": false
}
Client

Client endpoints

Get All Client

Client
POST
/api_doc/client/get_all
Retrieve all list of clients.(Do not send "page" if all data is need )

Request body

Key Type Required Description
page int no Used for Pagination
client_type int no Used for Filtering
search_key string no Search by name/mobile/email

Example request

Sample Request
{
			"page": 1,
			"search_key": "IMC"
}

Example response

Sample Success Response
{
    "response": {
        "pagination_meta": {
            "current_page": 1,
            "pages": 1,
            "per_page": 10,
            "total": 1
        },
        "users": [
            {
					"client_type": 1,
					"client_send_mail": 1
					"address": "abc,xyz",
					"building_number": "1234",
					"city": "Riyadh",
					"district": "Riyadh",
					"street_name": "Riyadh",
					"postal_code": "12345",
					"category_title": "Technology",
					"company_vat_number": "3213213213213213",
					"country_code": "+966",
					"email_id": "imc@gmail.com",
					"full_name": "IMC Compay",
					"id": 225,
					"mobile_number": "555999120"
            }
        ]
    },
    "status": true
}

Create Client

Client
POST
/api_doc/client/create
Create a new client.

Request body

Key Type Required Description
first_name string Yes Client's first name or Company name
last_name string No Client's last name
email_id string Yes Email address (must be unique)
country_code string Yes Phone country code (e.g., +966)
mobile_number string Yes Mobile number (no spaces or dashes)
company_registration_number string Conditional(Yes for Business) Business registration number
company_vat_number string Conditional(Yes for Business) VAT number for the company
category_id string No Comma-separated list of category IDs
client_type integer (1 or 2) Yes 1 = Business, 2 = Individual
address string Conditional(Yes for Business) Client address
latitude string Conditional(Yes for Business) Latitude for geolocation
longitude string Conditional(Yes for Business) Longitude for geolocation
client_send_mail integer (1 or 2) Yes 1 = Yes, 0 = No
building_number string Conditional(Yes for Business) Building Number
postal_code string Conditional(Yes for Business) Postal code
district string Conditional(Yes for Business) District Name
city string Conditional(Yes for Business) city
street_name string Conditional(Yes for Business) Street Name

Example request

Sample Request
{
    "first_name": "imc",
    "last_name": "company",
    "email_id": "imc@gmail.com",
    "country_code": "+966",
    "mobile_number": "555999120",
    "company_registration_number": "3213213213213213",
    "company_vat_number":"3213213213213213",
    "category_id": "1,2",
    "client_type": 1,
    "client_send_mail": 1,
    "address": "abc,xyz",
    "building_number": "1234",
    "city": "Riyadh",
    "district": "Riyadh",
    "street_name": "Riyadh",
    "postal_code": "12345",
    "latitude": "1.1",
    "longitude": "1.1"

    
}

Example response

Sample Success Response
{
    "response": {
        "message": "User created successfully",
        "user_id": 274
    },
    "status": true
}

Update Client

Client
POST
/api_doc/client/update
Update an existing client.

Request body

Key Type Required Description
id int Yes Client's unique id(given in listing api)
first_name string Yes Client's first name
last_name string Yes Client's last name
email_id string Yes Email address (must be unique)
country_code string Yes Phone country code (e.g., +966)
mobile_number string Yes Mobile number (no spaces or dashes)
company_registration_number string Conditional(Yes for Business) Business registration number
company_vat_number string Conditional(Yes for Business) VAT number for the company
category_id string No Comma-separated list of category IDs
client_type string (1 or 2) Yes 1 = Business, 2 = Individual
address string Conditional(Yes for Business) Client address
latitude string Conditional(Yes for Business) Latitude for geolocation
longitude string Conditional(Yes for Business) Longitude for geolocation
client_send_mail integer (1 or 2) Yes 1 = Yes, 0 = No
building_number string Conditional(Yes for Business) Building Number
postal_code string Conditional(Yes for Business) Postal code
district string Conditional(Yes for Business) District Name
city string Conditional(Yes for Business) city
street_name string Conditional(Yes for Business) Street Name

Example request

Sample Request
{
    "id": "85",
    "first_name": "imc",
    "last_name": "company",
    "mobile_number": "555999120",
    "email_id": "imc@gmail.com",
    "country_code": "+966",
    "company_registration_number": "3213213213213213",
    "company_vat_number":"3213213213213213",
    "client_type": 1,
    "category_id": "1,2",
    "client_send_mail": 1,
    "address": "abc,xyz",
    "building_number": "1234",
    "city": "Riyadh",
    "district": "Riyadh",
    "street_name": "Riyadh",
    "postal_code": "12345",
    "latitude": "1.1",
    "longitude": "1.1"
}

Example response

Sample Success Response
{
    "response": {
        "message": "User updated successfully",
        "user_id": 85
    },
    "status": true
}

Delete Client

Client
DELETE
/api_doc/client/delete/85
Delete an existing client.

Example response

Sample Success Response
{
    "response": {
        "message": "User deleted successfully"
    },
    "status": true
}
Invoice

Invoice endpoints

Get All Invoice

Invoice
POST
/api_doc/invoice/get_all
Retrieve all list of invoices..(Do not send "page" if all data is need )

Request body

Key Type Required Description
page int no Used for Pagination
search_key string no search by name/reference number/invoice number

Example request

Sample Request
{
	"page": 1,
    "search_key":"HTG"
}

Example response

Sample Success Response
{
    "response": {
        "invoices": [
            {
                "company_name": "I - M - C",
                "country_code": "+966",
                "created_on": "2025-02-21 08:10:55",
                "date_time": "2025-02-21 13:40:47",
                "email_id": "imc2@imc.imc",
                "first_name": "imc",
                "id": 449,
                "invoice": "http://43.205.18.14:8085/download/U86-13.pdf",
                "invoice_number": "U86-13",
                "invoice_type": 1,
                "last_name": "tech",
                "mobile_number": "555999120",
                "reference_number": "HTGRDFDSCHTFC",
                "total": 3.9984,
                "user_id": 86,
                "user_invoice_number": "13"
            }
        ],
        "pagination_meta": {
            "current_page": 1,
            "pages": 2,
            "per_page": 10,
            "total": 1
        }
    },
    "status": true
}

Get Invoice By Id

Invoice
GET
/api_doc/invoice/get_byid/732
Retrieve all DETAILS of A invoice.

Example response

Sample Success Response
{
    "response": {
        "buyer_address": null,
        "buyer_client_type": null,
        "buyer_contact_number": null,
        "buyer_country_code": null,
        "buyer_cr_number": null,
        "buyer_email_id": "girish@gmail.com",
        "buyer_name": null,
        "buyer_vat_number": null,
        "client_id": 0,
        "created_from": 2,
        "created_on": "2025-06-11 06:07:43",
        "created_type": "",
        "date_time": "2025-06-11 12:14:39",
        "discount": 500.0,
        "footer_text": "sssss",
        "id": 732,
        "invoice": "https://simplefatoora.oss-me-central-1.aliyuncs.com/invoice/U316-197-5696819b.pdf",
        "invoice_details": [
            {
                "description": "Item 2a ",
                "discount": 500.0,
                "discount_percent": 5.0,
                "id": 866,
                "invoice_id": 732,
                "net_amount": 5000.0,
                "product_id": "#34rfgb",
                "quantity": 10,
                "total": 10925.0,
                "unit_price": 1000.0,
                "vat": 1425.0,
                "vat_percent": 15.0
            }
        ],
        "invoice_number": "#128888",
        "invoice_type": 0,
        "logo": "http://35.154.4.154/images/uploads/ondeen//0992a1fc-1465-487e-9a5a-edd8ee02d299.png",
        "notes": "dddddddd",
        "parent_date_time": null,
        "parent_invoice_number": null,
        "qrcode": "https://simplefatoora.oss-me-central-1.aliyuncs.com/invoice/fed308b3-a8e1-4919-b7b7-084c1625251a.png",
        "reference_number": "#128888",
        "seller_address": "Imcrinox Technologies Pvt Ltd, Electronics City Phase 1, Electronic City, Bengaluru, Karnataka, India",
        "seller_client_type": null,
        "seller_contact_number": "555999120",
        "seller_country_code": "+966",
        "seller_cr_number": "300000432310003",
        "seller_email_id": "bhshrinidhi@gmail.com",
        "seller_name": "SBH Company",
        "seller_vat_number": "300000432310003",
        "status": 1,
        "sub_total": 10000.0,
        "total": 10925.0,
        "user_id": 316,
        "user_invoice_number": "197",
        "vat": 1425.0,
        "vat_percent": 15.0
    },
    "status": true
}

Create Simplified Invoice

InvoiceSimplified
POST
/api_doc/invoice/create
Create a new Simplified invoice.

Request body

Key Type Required Description
client_id int Conditional Unique ID of the client(get from Get All Client api with client_type=2)
client_type int Yes 2
client_name string Conditional Client's full name or business name
client_contact_number string Conditional Client’s phone number (without country code)
client_country_code string Conditional Phone country code (e.g., +966)
client_email_id string Conditional Email address of the client
invoice_type int Yes 0
date_time string (YYYY-MM-DD HH:MM:SS) Yes Date and time of invoice generation
reference_number string No External reference number for the invoice
logo string (URL) No Optional logo for the invoice(will be taken from profile if not provieded)
notes string No Additional notes for the invoice(will be taken from profile if not provieded)
footer_text string No Custom footer/Terms text to appear on invoice(will be taken from profile if not provieded)
invoice_detail array of objects Yes List of invoice line items
  ↳ description string Yes Item description
  ↳ product_id string Yes Unique product identifier
  ↳ unit_price float Yes Price per unit
  ↳ quantity integer Yes Number of units
  ↳ discount_percent float No Discount applied in percentage
  ↳ vat_percent float Yes VAT rate applied in percentage

Example request

With client id
Sample Request
{
  
    "client_id": 76,
	
    "client_type": 2,
    "invoice_type": 0,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#124",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}
With client data
Sample Request
{
  
	
    "client_name": "ABC",
    "client_contact_number": "555999120",
    "client_country_code": "+966",
    "client_email_id": "imc@gmail.com",
	
    "client_type": 2,
    "invoice_type": 0,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}

Example response

Sample Success Response
{
    "response": {
        "date_time": "19 Dec 2024, 12:14PM",
        "invoice": "https://imc…2bed.pdf",
        "invoice_number": "12332",
        "message": "Invoice created successfully",
        "qrcode": "https://imcr…c-ae85-174078703bb5.png",
        "seller_address": "Riyadh…adh Saudi Arabia",
        "seller_name": "IMC",
        "seller_vat_number": "1234567890",
        "total": 605.0,
        "vat": 55.0
    },
    "status": true
}

Create VAT Invoice

InvoiceVAT
POST
/api_doc/invoice/create
Create a new VAT invoice. Either client id or client data is mandatory.

Request body

Key Type Required Description
client_id int Conditional Unique ID of the client(get from Get All Client api with client_type=1)
client_type int Yes 1
client_name string Conditional Client's full name or business name
client_address string Conditional Full address of the client
client_contact_number string Conditional Client’s phone number (without country code)
client_country_code string Conditional Phone country code (e.g., +966)
client_email_id string Conditional Email address of the client
client_cr_number string Conditional Client’s Commercial Registration number
client_vat_number string Conditional Client’s VAT registration number
building_number string Conditional Building Number
postal_code string Conditional Postal code
district string Conditional District Name
city string Conditional city
street_name string Conditional Street Name
invoice_type int Yes 1
date_time string (YYYY-MM-DD HH:MM:SS) Yes Date and time of invoice generation
reference_number string No External reference number for the invoice
logo string (URL) No Optional logo for the invoice(will be taken from profile if not provieded)
notes string No Additional notes for the invoice(will be taken from profile if not provieded)
footer_text string No Custom footer/Terms text to appear on invoice(will be taken from profile if not provieded)
invoice_detail array of objects Yes List of invoice line items
  ↳ description string Yes Item description
  ↳ product_id string Yes Unique product identifier
  ↳ unit_price float Yes Price per unit
  ↳ quantity integer Yes Number of units
  ↳ discount_percent float No Discount applied in percentage
  ↳ vat_percent float Yes VAT rate applied in percentage

Example request

With client id
Sample Request
{
  
    "client_id": 76,
	
    "client_type": 1,	
    "invoice_type": 1,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#124",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}
With client data
Sample Request
{
  
	
    "client_name": "ABC",
    "client_address": "xyz,wnop, Riyadh",
    "client_contact_number": "555999120",
    "client_country_code": "+966",
    "client_email_id": "imc@gmail.com",
    "client_cr_number": "3213213213213213",
    "client_vat_number": "3213213213213213",
	"building_number": "1234",
	"city": "Riyadh",
	"district": "Riyadh",
	"street_name": "Riyadh",
	"postal_code": "12345",
	
    "client_type": 1,
    "invoice_type": 1,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}

Example response

Sample Success Response
{
    "response": {
        "date_time": "19 Dec 2024, 12:14PM",
        "invoice": "https://imc…2bed.pdf",
        "invoice_number": "12332",
        "message": "Invoice created successfully",
        "qrcode": "https://imcr…c-ae85-174078703bb5.png",
        "seller_address": "Riyadh…adh Saudi Arabia",
        "seller_name": "IMC",
        "seller_vat_number": "1234567890",
        "total": 605.0,
        "vat": 55.0
    },
    "status": true
}

Create Simplified Purchase Invoice

InvoicePurchaseSimplified
POST
/api_doc/invoice/create
Create a new Purchase invoice. Either client id or client data is mandatory.

Request body

Key Type Required Description
client_id int Conditional Unique ID of the client(get from Get All Client api with client_type=2)
client_type int Yes 2
client_name string Conditional Client's full name or business name
client_contact_number string Conditional Client’s phone number (without country code)
client_country_code string Conditional Phone country code (e.g., +966)
client_email_id string Conditional Email address of the client
invoice_type int Yes 2
date_time string (YYYY-MM-DD HH:MM:SS) Yes Date and time of invoice generation
reference_number string No External reference number for the invoice
logo string (URL) No Optional logo for the invoice(will be taken from profile if not provieded)
notes string No Additional notes for the invoice(will be taken from profile if not provieded)
footer_text string No Custom footer/Terms text to appear on invoice(will be taken from profile if not provieded)
invoice_detail array of objects Yes List of invoice line items
  ↳ description string Yes Item description
  ↳ product_id string Yes Unique product identifier
  ↳ unit_price float Yes Price per unit
  ↳ quantity integer Yes Number of units
  ↳ discount_percent float No Discount applied in percentage
  ↳ vat_percent float Yes VAT rate applied in percentage

Example request

With client id
Sample Request
{
  
    "client_id": 76,
	
    "client_type": 2,
    "invoice_type": 2,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#124",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}
With client data
Sample Request
{
  
	
    "client_name": "ABC",
    "client_contact_number": "555999120",
    "client_country_code": "+966",
    "client_email_id": "imc@gmail.com",
	
    "client_type": 2,
    "invoice_type": 2,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}

Example response

Sample Success Response
{
    "response": {
        "date_time": "19 Dec 2024, 12:14PM",
        "invoice": "https://imc…2bed.pdf",
        "invoice_number": "12332",
        "message": "Invoice created successfully",
        "qrcode": "https://imcr…c-ae85-174078703bb5.png",
        "seller_address": "Riyadh…adh Saudi Arabia",
        "seller_name": "IMC",
        "seller_vat_number": "1234567890",
        "total": 605.0,
        "vat": 55.0
    },
    "status": true
}

Create VAT Purchase Invoice

InvoicePurchaseVAT
POST
/api_doc/invoice/create
Create a new Purchase invoice. Either client id or client data is mandatory.

Request body

Key Type Required Description
client_id int Conditional Unique ID of the client(get from Get All Client api with client_type=1)
client_type int Yes 1
client_name string Conditional Client's full name or business name
client_address string Conditional Full address of the client
client_contact_number string Conditional Client’s phone number (without country code)
client_country_code string Conditional Phone country code (e.g., +966)
client_email_id string Conditional Email address of the client
client_cr_number string Conditional Client’s Commercial Registration number
client_vat_number string Conditional Client’s VAT registration number
building_number string Conditional Building Number
postal_code string Conditional Postal code
district string Conditional District Name
city string Conditional city
street_name string Conditional Street Name
invoice_type int Yes 2
date_time string (YYYY-MM-DD HH:MM:SS) Yes Date and time of invoice generation
reference_number string No External reference number for the invoice
logo string (URL) No Optional logo for the invoice(will be taken from profile if not provieded)
notes string No Additional notes for the invoice(will be taken from profile if not provieded)
footer_text string No Custom footer/Terms text to appear on invoice(will be taken from profile if not provieded)
invoice_detail array of objects Yes List of invoice line items
  ↳ description string Yes Item description
  ↳ product_id string Yes Unique product identifier
  ↳ unit_price float Yes Price per unit
  ↳ quantity integer Yes Number of units
  ↳ discount_percent float No Discount applied in percentage
  ↳ vat_percent float Yes VAT rate applied in percentage

Example request

With client id
Sample Request
{
  
    "client_id": 76,
	
    "client_type": 1,
    "invoice_type": 2,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#124",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}
With client data
Sample Request
{
  
	
    "client_name": "ABC",
    "client_address": "xyz,wnop, Riyadh",
    "client_contact_number": "555999120",
    "client_country_code": "+966",
    "client_email_id": "imc@gmail.com",
    "client_cr_number": "3213213213213213",
    "client_vat_number": "3213213213213213",
	"building_number": "1234",
	"city": "Riyadh",
	"district": "Riyadh",
	"street_name": "Riyadh",
	"postal_code": "12345",
	
    "client_type": 1,
    "invoice_type": 2,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}

Example response

Sample Success Response
{
    "response": {
        "date_time": "19 Dec 2024, 12:14PM",
        "invoice": "https://imc…2bed.pdf",
        "invoice_number": "12332",
        "message": "Invoice created successfully",
        "qrcode": "https://imcr…c-ae85-174078703bb5.png",
        "seller_address": "Riyadh…adh Saudi Arabia",
        "seller_name": "IMC",
        "seller_vat_number": "1234567890",
        "total": 605.0,
        "vat": 55.0
    },
    "status": true
}

Create Credit Note

Credit Note
POST
/api_doc/invoice/create
Create a new Credit Note.

Request body

Key Type Required Description
invoice_type int Yes 3
parent_type int Yes 0 or 1 or 2(invoice_type of selected parent invoice)
date_time string (YYYY-MM-DD HH:MM:SS) Yes Date and time of invoice generation
reference_number string No External reference number for the invoice
parent_invoice_number string Yes refers to original invoice
logo string (URL) No Optional logo for the invoice(will be taken from profile if not provieded)
notes string No Additional notes for the invoice(will be taken from profile if not provieded)
footer_text string No Custom footer/Terms text to appear on invoice(will be taken from profile if not provieded)
invoice_detail array of objects Yes List of invoice line items
  ↳ description string Yes Item description
  ↳ product_id string Yes Unique product identifier
  ↳ unit_price float Yes Price per unit
  ↳ quantity integer Yes Number of units
  ↳ discount_percent float No Discount applied in percentage
  ↳ vat_percent float Yes VAT rate applied in percentage

Example request

With client id
Sample Request
{

    "parent_type": 1,
    "invoice_type": 3,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#124",
    "parent_invoice_number":"#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}
With client data
Sample Request
{

    "parent_type": 1,
    "invoice_type": 3,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#123",
    "parent_invoice_number":"#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}

Example response

Sample Success Response
{
    "response": {
        "date_time": "19 Dec 2024, 12:14PM",
        "invoice": "https://imc…2bed.pdf",
        "invoice_number": "12332",
        "message": "Invoice created successfully",
        "qrcode": "https://imcr…c-ae85-174078703bb5.png",
        "seller_address": "Riyadh…adh Saudi Arabia",
        "seller_name": "IMC",
        "seller_vat_number": "1234567890",
        "total": 605.0,
        "vat": 55.0
    },
    "status": true
}

Create Debit Note

Debit Note
POST
/api_doc/invoice/create
Create a new Debit Note.

Request body

Key Type Required Description
invoice_type int Yes 4
parent_type int Yes 0 or 1 or 2(invoice_type of selected parent invoice)
date_time string (YYYY-MM-DD HH:MM:SS) Yes Date and time of invoice generation
reference_number string No External reference number for the invoice
parent_invoice_number string Yes refers to original invoice
logo string (URL) No Optional logo for the invoice(will be taken from profile if not provieded)
notes string No Additional notes for the invoice(will be taken from profile if not provieded)
footer_text string No Custom footer/Terms text to appear on invoice(will be taken from profile if not provieded)
invoice_detail array of objects Yes List of invoice line items
  ↳ description string Yes Item description
  ↳ product_id string Yes Unique product identifier
  ↳ unit_price float Yes Price per unit
  ↳ quantity integer Yes Number of units
  ↳ discount_percent float No Discount applied in percentage
  ↳ vat_percent float Yes VAT rate applied in percentage

Example request

With client id
Sample Request
{
  
    "parent_type": 1,
    "invoice_type": 4,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#124",
    "parent_invoice_number":"#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}
With client data
Sample Request
{

    "parent_type": 1,
    "invoice_type": 4,
    "date_time": "2024-12-19 12:14:39",
    "reference_number": "#123",
    "parent_invoice_number":"#123",
    "logo": "",
    "notes": "",
    "footer_text": "",
    "invoice_detail": [
        {
            
            "description": "Item 2 ",
            "product_id": "#34rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        },
        {
            
            "description": "Item 1 ",
            "product_id": "#23rfgb",
            "unit_price": 100,
            "quantity": 2,
            "discount_percent": 5,
            "vat_percent": 15
        }
    ]
}

Example response

Sample Success Response
{
    "response": {
        "date_time": "19 Dec 2024, 12:14PM",
        "invoice": "https://imc…2bed.pdf",
        "invoice_number": "12332",
        "message": "Invoice created successfully",
        "qrcode": "https://imcr…c-ae85-174078703bb5.png",
        "seller_address": "Riyadh…adh Saudi Arabia",
        "seller_name": "IMC",
        "seller_vat_number": "1234567890",
        "total": 605.0,
        "vat": 55.0
    },
    "status": true
}