You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Install dependencies
pip install -r requirements.txt
# Run the API
uvicorn api.main:app --reload --port 8000
# Open interactive docs
open http://127.0.0.1:8000/docs
Environment Variables
Variable
Default
Description
DATABASE_URL
sqlite:///./zatca.db
Database connection
ZATCA_ENVIRONMENT
sandbox
sandbox, simulation, production
ZATCA_TIMEOUT
30
API timeout in seconds
ZATCA_MAX_RETRIES
3
Retry attempts
LOG_LEVEL
INFO
Logging level
API Workflow
1. Onboarding
POST /keys → Generate EC key pair
POST /csr → Create CSR from key
POST /onboarding/compliance → Get compliance CSID
POST /invoices/{id}/compliance-check → Validate test invoices
POST /onboarding/production → Get production CSID
2. Invoice Lifecycle
POST /invoices → Create invoice (simplified/standard)
GET /invoices/{id}/xml → Get unsigned XML
POST /invoices/{id}/sign → Sign with certificate
POST /invoices/{id}/report → Submit simplified (B2C)
POST /invoices/{id}/clear → Submit standard (B2B)
POST /invoices/{id}/cancel → Cancel if needed
3. Credit/Debit Notes
POST /invoices/credit-note → Reference original invoice
POST /invoices/debit-note → Reference original invoice
POST /invoices/{id}/sign → Sign the note
POST /invoices/{id}/report → Submit the note
4. CSID Renewal
POST /onboarding/renewal → Renew before expiry
License
MIT
About
Hey, I don't think the project is ready just yet. Tried running Java but it's rejecting the path.