saudi-vat-pro

v1.0.1
io.github.Morouna1/saudi-vat-pro Checked 15 hours ago Published 2 months ago

Submit and manage ZATCA-compliant Saudi e-invoices through Saudi VAT Pro.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_invoices

List ZATCA invoices with optional filters. Returns paginated invoice summaries including status, totals, and ZATCA submission results.

ParameterTypeDescription
invoiceTypestringFilter by type. Use 'standard' for B2B or 'simplified' for B2C (consumer) invoices
pageintegerPage number (default: 1)
pageSizeintegerResults per page (default: 20, max: 100)
searchstringSearch by invoice number, buyer name, or order reference
statusstringFilter by status, for example: pending, pending_submission, generated, signed, reported, cleared, failed, needs_data, or awaiting_buyer_data

get_invoice

Get full invoice detail including line items, ZATCA submission status, error messages, QR code, and the event timeline showing every step of the compliance pipeline.

ParameterTypeDescription
id *stringInvoice ID (e.g. inv_8f7d6e5c)

create_invoice

Create a Saudi e-invoice and run the available ZATCA pipeline. Before calling, use get_zatca_status and confirm environment='production' for a legally submitted invoice; sandbox submissions are tests only. Standard (B2B) invoices require buyerName, buyerVatNumber, and buyerCity and normally clear; simplified invoices normally report. Always inspect the returned status: cleared/reported means submitted, generated/signed/pending means not yet submitted, needs_data/awaiting_buyer_data requires correction, and failed requires action.

ParameterTypeDescription
invoiceType *stringZATCA invoice profile: 'standard' for B2B tax invoices (buyer name, VAT number, and city required); 'simplified' for eligible B2C transactions
lines *arrayInvoice line items (at least one required)
buyerCitystringBuyer city. Required for standard (B2B) invoices.
buyerNamestringBuyer company or person name. Required for standard (B2B) invoices.
buyerPostalCodestringBuyer postal code. Optional for B2B invoices.
buyerStreetstringBuyer street address. Optional for B2B invoices.
buyerVatNumberstringBuyer VAT registration number. Required for standard (B2B) invoices. Must be 15 digits starting and ending with 3 (e.g. 310000000000006).
currencystringUppercase ISO 4217 currency code (default: SAR).
issueDatestringIssue date in YYYY-MM-DD format (for example 2026-09-07). Defaults to today.
notestringHuman-readable note or memo (e.g. credit note reason). Optional.
orderReferencestringYour order/invoice reference. Should be unique per invoice to avoid ZATCA duplicate errors (BV-000001).
paymentMeansstringUNTDID 4461 payment means code: 10=cash, 30=credit transfer, 42=bank account, 48=bank card. Optional.

create_credit_note

Issue a ZATCA credit note (document type 381) against a cleared or reported invoice. Omit lines for the remaining full refundable balance, or provide positive partial-refund lines that do not exceed the parent's remaining quantities and amounts. Supply a stable idempotencyKey so agent/network retries cannot create a duplicate credit note.

ParameterTypeDescription
idempotencyKey *stringStable unique key for this refund intent. Reuse the same value when retrying the same request; use a new value for a different refund.
invoiceId *stringID of the parent invoice to credit (must be in 'cleared' or 'reported' status)
linesarrayLines to credit. Omit for a full refund of all parent invoice lines.
notestringAdditional note explaining the reason
reasonCodestringReason for the credit note. Default: 'return'

retry_invoice

Re-run the ZATCA compliance pipeline for a failed invoice after correcting it in the Saudi VAT Pro dashboard. Returns the updated status; always inspect it rather than assuming submission succeeded.

ParameterTypeDescription
id *stringInvoice ID to retry

explain_invoice_error

Get an AI-generated plain-language explanation of why an invoice failed ZATCA validation, along with specific suggested actions to fix it. Most useful for 'failed' or 'needs_data' invoices.

ParameterTypeDescription
id *stringInvoice ID to explain

get_zatca_status

Check certificate (CSID) enrollment, expiry, environment, and readiness before creating invoices. environment='sandbox' is test-only and does not constitute legal ZATCA submission; confirm environment='production' for live invoices.

get_merchant_profile

Get the merchant's business profile including business name, VAT number, address, default invoice settings, and subscription plan.

get_dashboard_summary

Get a compliance health summary: total invoices, counts by status (cleared, failed, pending), VAT totals for the current period, and any outstanding issues requiring attention.