Get Invoice Process Status

If you would like to get the response of an already processed invoice. Then you can call this API. The API will fetch the final signed invoice along with some of the metadata added by API and will return the format in JSON. If the invoice was not processed already then an error will be returned.

Request Method

GET

Request Path

{{API_URL}}/api/v2/ksa_einvoice/online_service/query_invoice/

Request Params

ParameterValueDescription

invoice_id

1

ID of the invoice

invoice_uuid

63547e08-0c1b-11ee-be56-0242ac120002

UUID of the invoice

Request Headers

ParameterValueDescription

Productid

einvoicing_global

Keep as is

Authorization/MiplApiKey

api_key/auth token

Value and header type is mentioned in the Authentication Page

Responses

200 (OK)

If invoice is fetched successfully.

Schema

ParamaterValueDescription

message

Invoices fetched Successfully

Sample String

success

True

data

[]

List of invoices matching the id

Sample

{
    "success": true,
    "message": "Invoice/Invoices fetched successfully",
    "data": [
        {
            "invoice_id": "ff0f1a65-9b00-46ad-9d53-d1222809b554",
            "invoice_uuid": "36c4387e-9365-4f3a-903b-1a8dc1f86cd8",
            "info_messages": [
                {
                    "type": "INFO",
                    "code": "XSD_ZATCA_VALID",
                    "category": "XSD validation",
                    "message": "Complied with UBL 2.1 standards in line with ZATCA specifications",
                    "status": "PASS",
                    "source": "ZATCA"
                }
            ],
            "warning_messages": [
                {
                    "type": "WARNING",
                    "code": "BR-KSA-81",
                    "category": "KSA",
                    "message": "The other Buyer ID (BT-46) must present in the tax invoice and associated debit notes and credit notes (KSA-2, position 1 and 2 = 01), where the buyer VAT registration number or buyer group VAT registration number (BT-48) is not provided.",
                    "status": "WARNING",
                    "source": "ZATCA"
                }
            ],
            "error_messages": [],
            "status": "CLEARED",
            "pih": "xqqzdGTp/Zkcw/RwRlW4fxrn0T8+PyjGOpVZTRalYsc=",
            "icv": 133,
            "qr_code": "AQ1UZXN0IFN1cHBsaWVyAg8zMDAwNzU1ODg3MDAwMDMDFDIwMjMtMDYtMDhUMTI6NTE6MTFaBAQxMTUwBQMxNTAGLHd1aFhwUFNtdnJqcWttUmtaaFhvUHRNNEc4QTBySWZjRE9zb2o1bEw1N0k9B2BNRVVDSUVKQ1NmNGFqMVJ2NjU5dDRzQ1ErcDZTM2ZXbzRuYVRQZXdNRXJvcGpSTm9BaUVBNTJCdkFQbzE5Y3ZiMkZnOW5PajhTVndrTDExYzc4d2Znak5iTzFZYTBDTT0IWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABEdifjdJ03b3+M0dTPofZCRfBK+8Gdbsnhw4TNmEqacHGTtrSNaba3UVrzamOy7hWZL2gUFQ92NuYweGxhoiuY4=",
            "invoice": "invoice in base 64 encoded format"
        }
    ],
    "count": 1
}

404 (Not found)

If invoice is not found in the database

{
    "message" : "Invoice Does not exist in the database"
    "success": false,
    "error_code": 1001,
    "data": {}
}

401 (Permission Error)

You will get 401 errors when the token is invalid.

500 (Server Error)

If there is a server error during the invoice processing

{
    "message": "Internal Server Error",
    "success": false,
    "error_code": 1001,
    "data": {}
}

Last updated