Bee.ZatcaHelper
1.0.1
See the version list below for details.
dotnet add package Bee.ZatcaHelper --version 1.0.1
NuGet\Install-Package Bee.ZatcaHelper -Version 1.0.1
<PackageReference Include="Bee.ZatcaHelper" Version="1.0.1" />
paket add Bee.ZatcaHelper --version 1.0.1
#r "nuget: Bee.ZatcaHelper, 1.0.1"
// Install Bee.ZatcaHelper as a Cake Addin #addin nuget:?package=Bee.ZatcaHelper&version=1.0.1 // Install Bee.ZatcaHelper as a Cake Tool #tool nuget:?package=Bee.ZatcaHelper&version=1.0.1
Zatca | Fatoora - Integeration Helper
This project helps in integertation of systems to Zatca systems. Currently tested using their sandbox APIs.
Follow below shell commands to generate CSR
we need a csr token to initiate compliance API request , more about what is CSR here → https://en.wikipedia.org/wiki/Certificate_signing_request
#generate private key using below command
openssl ecparam -name secp256k1 -genkey -noout -out privatekey.pem
#generate csr using below command
openssl req -new -sha256 -key privatekey.pem -extensions v3_req -config cert.cnf -out generatedCSR.csr
#convert to base64
echo -n `cat generatedCSR.csr` | openssl enc -base64 -a -A >> csr_Output.txt
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 |
Roadmap
implement Allowance charge / Discount
implement reporting api for simplified tax invoices
🔗 Contact
Write to me at fasil@dev-bee.com
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Newtonsoft.Json (>= 13.0.2-beta2)
- Serilog (>= 2.12.0)
- System.Security.Cryptography.Xml (>= 7.0.0-rc.1.22426.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.