Automated analysis: 4 risk factor(s) detected (Script Execution, Network Access, File System Access, Environment Variable Access). Permissions: 62/100, Data handling: 65/100.
Starting January 2025, the Israeli Tax Authority requires electronic invoices with allocation numbers from the SHAAM system. The threshold drops to 5,000 NIS in June 2026, affecting virtually every business in Israel. Developers building invoicing systems need to integrate the SHAAM API with OAuth2 authentication, specific JSON format, and validation checks.
Author: @skills-il
Build SHAAM-compliant electronic invoices with allocation numbers per Israeli Tax Authority requirements
npx skills-il add skills-il/accounting --skill israeli-shaam-e-invoice-builderThe SHAAM (Shnot Asmachta Mekuvenet -- שע"ם) system is the Israeli Tax Authority's platform for electronic invoice allocation numbers. Starting January 2025, invoices above certain thresholds require an allocation number (mispar haktsa'a -- מספר הקצאה) for the buyer to deduct input VAT. This skill automates the end-to-end process: authentication, invoice construction, validation, submission, and allocation number retrieval.
| Date | Threshold | Scope |
|---|---|---|
| January 2025 | 25,000 NIS (incl. VAT) | Invoices above threshold require allocation number |
| January 2026 | 10,000 NIS (incl. VAT) | Lowered threshold |
| June 2026 | 5,000 NIS (incl. VAT) | Final planned threshold |
Without a valid allocation number, the buyer cannot deduct input VAT on the transaction.
Set up OAuth2 credentials for the SHAAM platform. You need a client ID and client secret issued by the Israeli Tax Authority after registering your software with them.
Store credentials in environment variables:
export SHAAM_CLIENT_ID="your-client-id"
export SHAAM_CLIENT_SECRET="your-client-secret"
export SHAAM_ENV="production" # or "sandbox" for testingAPI base URLs:
https://ita-api-sandbox.taxes.gov.il/shaam/api/v2https://ita-api.taxes.gov.il/shaam/api/v2OAuth2 token endpoint:
https://ita-api-sandbox.taxes.gov.il/auth/oauth2/tokenhttps://ita-api.taxes.gov.il/auth/oauth2/tokenObtain a bearer token using the client credentials grant:
curl -X POST "${SHAAM_TOKEN_URL}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=${SHAAM_CLIENT_ID}" \
-d "client_secret=${SHAAM_CLIENT_SECRET}" \
-d "scope=invoice:write invoice:read"The response returns an access token valid for 60 minutes:
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "invoice:write invoice:read"
}Cache the token and refresh it before expiry. Do not request a new token for every API call.
Build the invoice object per ITA technical specs v2.0. The required JSON structure:
{
"invoice_type": "hashbonit_mas",
"invoice_number": "INV-2026-001234",
"invoice_date": "2026-03-08",
"supplier": {
"tax_id": "123456789",
"name": "Supplier Ltd",
"address": {
"street": "Rothschild Blvd 1",
"city": "Tel Aviv",
"postal_code": "6688101"
}
},
"buyer": {
"tax_id": "987654321",
"name": "Buyer Corp",
"address": {
"street": "Herzl St 10",
"city": "Jerusalem",
"postal_code": "9423201"
}
},
"line_items": [
{
"description": "Software Development Services",
"quantity": 1,
"unit_price": 15000.00,
"vat_rate": 17,
"total_before_vat": 15000.00,
"vat_amount": 2550.00,
"total_with_vat": 17550.00
}
],
"totals": {
"total_before_vat": 15000.00,
"total_vat": 2550.00,
"total_with_vat": 17550.00
},
"currency": "ILS",
"payment_terms": "net30"
}Supported invoice types:
| Type | Hebrew | Description |
|---|---|---|
hashbonit_mas |
חשבונית מס | Tax invoice (standard) |
hashbonit_mas_kabala |
חשבונית מס / קבלה | Tax invoice with receipt |
hashbonit_zikuy |
חשבונית זיכוי | Credit note |
kabala |
קבלה | Receipt |
Before submitting, validate the invoice locally:
Buyer VAT number validation: Verify the buyer's tax ID (osek murshe number) is a valid 9-digit Israeli VAT number. The check digit algorithm uses a weighted sum modulo 10 with weights [1,2,1,2,1,2,1,2,1].
Threshold check: Determine if the invoice total (including VAT) exceeds the current threshold. If below threshold, an allocation number is not required but can still be requested.
Required fields: Ensure all mandatory fields are populated: invoice_type, invoice_number, invoice_date, supplier.tax_id, buyer.tax_id, line items with valid VAT calculations.
VAT calculation verification: Confirm that vat_amount equals total_before_vat * vat_rate / 100 for each line item, and totals are consistent.
Date validation: invoice_date must not be in the future and must not be more than 6 months in the past.
Submit the validated invoice to the SHAAM API:
curl -X POST "${SHAAM_BASE_URL}/invoices" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d @invoice.jsonSuccessful response (HTTP 201):
{
"allocation_number": "IL-2026-0308-A1B2C3D4",
"invoice_reference": "INV-2026-001234",
"status": "approved",
"valid_until": "2026-04-07T23:59:59Z",
"qr_code_data": "https://www.invoice.gov.il/verify/IL-2026-0308-A1B2C3D4"
}The allocation_number (mispar haktsa'a) must be printed on the invoice. The qr_code_data URL allows the buyer to verify the invoice online.
For high-volume invoicing, use the batch endpoint:
curl -X POST "${SHAAM_BASE_URL}/invoices/batch" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"invoices": [
{ ... },
{ ... }
]
}'Batch response:
{
"batch_id": "BATCH-20260308-001",
"total_submitted": 15,
"accepted": 13,
"rejected": 2,
"results": [
{
"invoice_reference": "INV-2026-001234",
"status": "approved",
"allocation_number": "IL-2026-0308-A1B2C3D4"
},
{
"invoice_reference": "INV-2026-001235",
"status": "rejected",
"error_code": "BUYER_TAX_ID_INVALID",
"error_message": "Buyer tax ID failed validation"
}
]
}Maximum batch size is 100 invoices per request. For larger volumes, split into multiple batches with a 1-second delay between requests.
Check the status of a previously submitted invoice:
curl -X GET "${SHAAM_BASE_URL}/invoices/{invoice_reference}/status" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"Response:
{
"invoice_reference": "INV-2026-001234",
"allocation_number": "IL-2026-0308-A1B2C3D4",
"status": "approved",
"created_at": "2026-03-08T10:30:00Z",
"valid_until": "2026-04-07T23:59:59Z"
}When issuing a credit note (hashbonit zikuy), reference the original invoice:
{
"invoice_type": "hashbonit_zikuy",
"invoice_number": "CN-2026-000045",
"invoice_date": "2026-03-08",
"original_invoice_reference": "INV-2026-001234",
"original_allocation_number": "IL-2026-0308-A1B2C3D4",
"reason": "Partial service cancellation",
"line_items": [
{
"description": "Software Development Services - Credit",
"quantity": -1,
"unit_price": 5000.00,
"vat_rate": 17,
"total_before_vat": -5000.00,
"vat_amount": -850.00,
"total_with_vat": -5850.00
}
],
"totals": {
"total_before_vat": -5000.00,
"total_vat": -850.00,
"total_with_vat": -5850.00
}
}Credit notes receive their own allocation number and must reference the original.
User says: "Create an e-invoice for 30,000 NIS plus VAT to buyer with tax ID 514788338 for consulting services"
Actions:
invoice_type: "hashbonit_mas"POST /invoices endpointIL-2026-0308-X7Y8Z9W0Result: Tax invoice created with allocation number IL-2026-0308-X7Y8Z9W0. Buyer can deduct 5,100 NIS input VAT.
User says: "Submit all 25 invoices from March 2026 billing cycle to SHAAM"
Actions:
POST /invoices/batchResult: 22 invoices received allocation numbers. 3 invoices require attention (2 invalid tax IDs, 1 duplicate number).
User says: "Issue a credit note for 8,000 NIS against invoice INV-2026-000789"
Actions:
GET /invoices/INV-2026-000789/statusinvoice_type: "hashbonit_zikuy", negative amountsoriginal_invoice_reference and original_allocation_numberPOST /invoicesResult: Credit note CN-2026-000120 issued with its own allocation number, referencing original invoice.
Cause: The buyer's 9-digit VAT number (osek murshe) failed the check digit validation, or the tax ID is not registered as an active VAT-registered business with the Tax Authority.
Solution:
https://www.misim.gov.il/mm-hofashosek/Cause: An invoice with the same invoice_number was already submitted to SHAAM by your supplier tax ID.
Solution:
GET /invoices/{invoice_number}/statusCause: The OAuth2 access token has expired (tokens are valid for 60 minutes) or credentials are invalid.
Solution:
SHAAM_CLIENT_ID and SHAAM_CLIENT_SECRET are correctCause: The submitted VAT amounts do not match the expected calculation based on the line item totals and VAT rate.
Solution:
vat_amount = total_before_vat * vat_rate / 100totals.total_vat equals the sum of all line item vat_amount valuestotals.total_with_vat equals totals.total_before_vat + totals.total_vatCause: The invoice date is either in the future or more than 6 months in the past.
Solution:
invoice_date to today's date or the actual transaction dateYYYY-MM-DDSupported Agents
Build an electronic tax invoice in SHAAM JSON format for a sale of 25,000 NIS + VAT.
Submit the invoice to SHAAM and obtain an allocation number. Handle possible errors.
Generate a credit note referencing original invoice number 12345.
Trust Score
This skill can execute scripts and commands on your system.
1 occurrences found in code
This skill can make network requests to external services.
4 occurrences found in code
This skill can read and write files on your system.
1 occurrences found in code
This skill can access environment variables which may contain secrets.
8 occurrences found in code
Import and export data between Hashavshevet accounting software and modern formats like JSON, CSV, and Excel, including Hebrew encoding conversion and cloud migration
OCR and parse Israeli receipts and invoices with Hebrew and English text extraction
Automate bank reconciliation for Israeli banks, including discrepancy detection and reconciliation report generation
Want to build your own skill? Try the Skill Creator · Submit a Skill