Skip to content

Latest commit

 

History

History
128 lines (87 loc) · 5.03 KB

File metadata and controls

128 lines (87 loc) · 5.03 KB

Zatca | Fatoora - Integeration Helper

This project helps in integertation of systems to Zatca systems. Currently tested using their sandbox APIs.


CSR generation

B2C Simplified Invoice Generation is available Now

Compliance API

Reporting API


Follow This guide to generate csr token.

API Reference

Note: Global variables is a dependecy for all the classes , its parameters are described below

Parameter Type Description
BaseUrl string Required. Base url of zatca [Eg: https://gw-apic-gov.gazt.gov.sa]
ComplianceCsidEndpoint string Required. Compliance Csid endpoint [Eg: /e-invoicing/developer-portal/compliance]
ProdCsidEndpoint string Required. Prod csid endpoint [Eg : /e-invoicing/developer-portal/production/csids]
InvoiceClearanceEndPoint string Required. clearance endpoint [Eg: /e-invoicing/developer-portal/invoices/clearance/single]

Get Compliance CSR token

 ComplianceCsrApiClient(GlobalVariables).GetToken(ComplianceCsrRequest)
ComplianceCsrRequest Parameter Type Description
Otp string Required. OTP obatined from tax portal
Csr string Required. CSR token generated using above mentioned step

Get Prod CSID

  ProdCsidApiClient(GlobalVariables).GetToken(ProdCsidOnboardingRequest)
ProdCsidOnboardingRequest Parameter Type Description
ComplianceRequestId string Required. RequestId from the response of above endpoint
CsrBinaryToken string Required. Binary token from the response of above endpoint
CsrSecret string Required. Secret from the response of above endpoint

Generate xml

  StandardInvoiceXmlGenerator.Generate(StandardInvoice)

For parameters refer -> https://github.com/fasilmarshooq/Zatca_Integration_Helper/blob/main/Zatca-Standard-Invoice-Integration-Client/Model/StandardInvoice.cs

Clear Invoice

  StandardInvoiceClearanceApiClient(GlobalVariables).ClearInvoice(InvoiceClearanceRequest)
InvoiceClearanceRequest Parameter Type Description
Body string Required. response of above endpoint
BinaryToken string Required. Binary token from the response of Get Prod CSID endpoint
Secret string Required. Secret from the response of Get Prod CSID endpoint

Generate xml for Debit Note

  StandardInvoiceXmlGenerator.GenerateForDebitNote(StandardInvoiceAdjustment)

For parameters refer -> https://github.com/fasilmarshooq/Zatca_Integration_Helper/blob/main/Zatca-Standard-Invoice-Integration-Client/Model/StandardInvoiceAdjustment.cs

NOTE: use above clear Invoice endpoint to clear Debit Note

Generate xml for Credit Note

  StandardInvoiceXmlGenerator.GenerateForCreditNote(StandardInvoiceAdjustment)

For parameters refer -> https://github.com/fasilmarshooq/Zatca_Integration_Helper/blob/main/Zatca-Standard-Invoice-Integration-Client/Model/StandardInvoiceAdjustment.cs

NOTE: use above clear Invoice endpoint to clear Credit Note

Generate xml for Simplified Invoice

  StandardInvoiceXmlGenerator.GenerateForSimplifiedInvoice(StandardInvoiceAdjustment,Certificate,PrivateKey)

For parameters refer -> https://github.com/fasilmarshooq/Zatca_Integration_Helper/blob/main/Zatca-Standard-Invoice-Integration-Client/Model/StandardInvoice.cs

  • Certificate : Binary token received using Get Prod CSID API
  • PrivateKey : your private key generated using above openSsl commands
  • feel free to use certifcate and private key from test project for testing purpose

NOTE: reporting api is still under developement it has a bug in zatca sandbox till then feel free to use compliance API


Rest API supprt for non .net apps

Zatca Reporting API bug fixes


License

MIT

Trouble Shooting