KSA APIs Online
Product DocsWebsite
  • Intro
  • Environments
  • Authentication
    • Access Tokens
    • API KEY
  • Generate Einvoice API
    • UBL2.1 XML
    • UBL2.1 XML (VAT IN URL)
    • JSON
    • JSON (VAT IN URL)
    • Responses
    • Callback Response
    • Technical Guidelines
  • Get Invoice Process Status
  • Get Invoice in PDF
Powered by GitBook
On this page
  • Request Method
  • Request Path
  • Request Headers
  • Request Body
  1. Generate Einvoice API

UBL2.1 XML (VAT IN URL)

PreviousUBL2.1 XMLNextJSON

Last updated 1 year ago

We accept the UBL2.1 XML compliant directly as the input for the generate einvoice API. The xml input needs to be base64 encoded. Here are some attached documents for your reference

As part of our responsibilities we will enrich the following elements within the document before sending it to ZATCA

  • ProfileID

  • UUID

  • IssueDate

  • IssueTime

  • Previous Invoice Hash

  • Invoice Counter Value

  • Signature (Simplified Document Only)

  • QR Code (Simplified Document Only)

  • UBL Extensions (Simplified Document Only)

Request Method

POST

Request Path

{{API_URL}}/api/v2/ksa_einvoice/<VAT_NUM>/generate_einvoice/

NOTE: VAT_NUM is the vat number of your organization that you have onboarded in our website. For eg if you have onboarded vat number 399975588700003 then the full path would be

{{API_URL}}/api/v2/ksa_einvoice/online_service/399975588700003/generate_einvoice/

Request Headers

Parameter
Value
Description

Productid

einvoicing_global

Keep as is

Authorization/MiplApiKey

api_key/auth token

Value and header type is mentioned in the Authentication Page

Request Body

Parameter
Value
Description

invoice

""

Base64 Encoded XML document

If you want to do a quick test without registering your company within our website you can try out the following . Basic test can be done here to see if your document is compliant or not.

The response for the API can be found .

Standard Invoice
Standard Credit Note
Standard Debit Note
Simplified Invoice
Simplified Credit Note
Simplified Debit Note
ENV
here