agentsclimarketplace

Green invoice integration

Skill skillim-hub/skills/green-invoice-integration

Production-grade AI agent skills & MCP servers for the Israeli market — סקילים

Install
npx -y skills add skillim-hub/skills --skill green-invoice-integration

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Integrate with the Green Invoice API for Israeli invoicing workflows: create, list, retrieve, and cancel documents; manage customers; prepare payment-link requests; receive webhooks; and map Israeli document types such as חשבונית מס, חשבונית מס/קבלה, and קבלה. Use for Israeli small businesses, freelancers, bookkeepers, and consumer-service businesses that need safe automation around invoices, receipts, customers, VAT, allocation-number checks, and payment status.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

10.0 KB, ~2.2k tokens by cl100k_base, as published. Nobody here has run it

Green Invoice Integration

Use this skill to automate Israeli invoicing operations with Green Invoice while keeping tax-sensitive choices explicit. Treat API calls that issue documents as consequential actions: validate customer identity, document type, currency, VAT treatment, payment details, and allocation-number obligations before sending the request.

Activation checklist

Apply this skill when the task mentions Green Invoice, Morning, חשבונית ירוקה, חשבונית מס, חשבונית מס/קבלה, קבלה, Israeli VAT invoices, customer synchronization, payment links, or Green Invoice webhooks.

Do not apply this skill for direct Tax Authority API filing, standalone payment-gateway settlement, bookkeeping advice beyond operational API handling, payroll, or legal/tax opinions. Escalate threshold and deductibility questions to an Israeli accountant or tax adviser.

Current facts to carry into every workflow

  • Standard Israeli VAT is 18% for ordinary taxable domestic transactions as of 2026.
  • Allocation numbers are required for input-tax deduction on qualifying B2B tax invoices above the current Israel Invoices threshold. As of 01-06-2026, the threshold is ₪5,000 before VAT.
  • Green Invoice announced a June 2026 API infrastructure update: use api.greeninvoice.co.il/api rather than the retired www.greeninvoice.co.il/api base path, and include grant_type: client_credentials in token requests.
  • API keys and webhooks are dashboard features. Confirm plan access before debugging missing menus.
  • Payment links exist in the product UI, but public endpoint coverage can vary by account and API revision. Prefer a documented API endpoint from the current developer portal when available; otherwise automate document issuance with payment buttons or route a human to the payment-link UI.

Decision tree

flowchart TD
    A[Start: billing or customer task] --> B{Customer exists?}
    B -- No --> C[Create or search customer]
    B -- Yes --> D[Validate customer details]
    C --> D
    D --> E{Payment already received?}
    E -- Yes --> F{Israeli taxable sale?}
    F -- Yes --> G[Use type 320: Tax Invoice-Receipt]
    F -- No --> H[Use receipt or exempt/foreign flow]
    E -- No --> R{Need tax invoice now?}
    R -- Yes --> J[Use type 305: Tax Invoice]
    R -- No --> K[Use type 300: Transaction Invoice]
    G --> L{B2B over allocation threshold?}
    J --> L
    L -- Yes --> M[Confirm Tax Authority authorization and inspect allocation number]
    L -- No --> N[Create document]
    M --> N
    H --> N
    K --> N
    N --> O{Need payment collection?}
    O -- Yes --> P[Create payment link if endpoint is enabled or send payment-enabled document]
    O -- No --> Q[Store PDF/link and sync status]
    P --> Q

Document type mapping

CodeHebrewEnglishUse
10הצעת מחירPrice quoteQuote before commitment
100הזמנהOrderApproved order
200תעודת משלוחDelivery noteGoods delivery
210תעודת החזרהReturn noteGoods return
300חשבון עסקהTransaction invoiceDemand for payment before receipt
305חשבונית מסTax invoiceVAT invoice when payment is not recorded in the same document
320חשבונית מס / קבלהTax invoice-receiptImmediate payment for a taxable Israeli sale
330חשבונית זיכויCredit noteCorrection, cancellation, or refund
400קבלהReceiptPayment receipt without new VAT invoice
405קבלה על תרומהDonation receiptNonprofit donation receipt
500הזמנת רכשPurchase orderProcurement
600קבלת פיקדוןDeposit receiptDeposit received
610משיכת פיקדוןDeposit withdrawalDeposit returned

API sequence

  1. Obtain an access token with POST /account/token and body {"id":"...","secret":"...","grant_type":"client_credentials"}.
  2. Verify credentials with GET /users/me.
  3. Search the customer with POST /clients/search; create the customer with POST /clients only when no match exists.
  4. Build a document payload with the correct type, client, income, payment, currency, date, and lang.
  5. Create the document with POST /documents.
  6. Retrieve the created document with GET /documents/{id} and inspect status, file links, totals, and allocation number where relevant.
  7. For cancellation, prefer a credit-note or official cancel endpoint documented for the exact document type. Store the original document id and cancellation reason.
  8. Register webhooks in the dashboard and keep the handler idempotent.

Concrete examples

Example 1: paid Israeli consulting invoice

Request: create a paid Israeli consulting invoice for ₪1,180 including VAT on 05-06-2026.

Use type 320. Set currency to ILS, lang to he, date to 2026-06-05, income[0].price to 1000 if the API expects net amounts, or use taxIncludedInPrice when issuing a gross-price document. Add a payment item for the actual method. Verify that total equals ₪1,180.

python scripts/green_invoice_integration_cli.py create-document \
  --env sandbox \
  --token "$GREEN_INVOICE_TOKEN" \
  --type 320 \
  --client-name "Demo Client Ltd" \
  --client-email [email protected] \
  --description "Consulting service" \
  --amount 1000 \
  --currency ILS \
  --date 2026-06-05 \
  --payment-method wire-transfer

Example 2: unpaid invoice, then receipt

Use type 300 for a payment demand when the customer has not paid. After payment arrives, create type 400 and link it to the original document when the account API supports document linking.

Example 3: B2B tax invoice above ₪5,000

Before creating type 305 or type 320, confirm the customer is a business and the net amount exceeds ₪5,000. Confirm the Tax Authority authorization in the dashboard. After issuing the document, fetch it and inspect the allocation number. If absent, pause delivery and resolve authorization status.

Example 4: payment link handoff

Create a payment-link request only after payment services are connected in the dashboard. Include amount, currency, description, customer email, and document behavior. If the endpoint returns 404 or 403, use the dashboard payment-link flow or send a payment-enabled document instead.

Example 5: webhook filing

Register document/created, client/created, and payment/received as needed. In the receiver, deduplicate by webhook id or document id, persist the raw payload, then route by document type.

Webhook handler rules

  • Require HTTPS for public receivers.
  • Respond within six seconds.
  • Store the event id before doing slow work.
  • Treat retries as normal; make processing idempotent.
  • Verify any configured secret. If the platform only sends the secret as a shared value, compare it using constant-time comparison. If it sends an HMAC signature, verify the digest before parsing side effects.
  • Never trust total, email, or downloadLinks until the associated document is fetched through the authenticated API.

Troubleshooting

SymptomLikely causeAction
401 UnauthorizedExpired token, missing bearer prefix, old token-body formatRe-authenticate with grant_type: client_credentials; verify Authorization: Bearer ...
403 ForbiddenPlan lacks API/webhook/payment feature or key lacks scopeCheck dashboard plan, feature access, and API-key permissions
404 Not FoundWrong base URL or endpoint not enabledUse https://api.greeninvoice.co.il/api/v1; verify current developer docs
VAT total differsNet/gross mismatch or stale VAT rateUse 18%; mark gross prices clearly when needed
Missing allocation numberTax Authority authorization missing or expiredRenew authorization and fetch the document again
Duplicate webhook workRetry after timeoutDeduplicate before side effects
Hebrew text appears reversedMissing UTF-8/RTL handling in downstream systemPreserve UTF-8 and set RTL rendering in the target system
Payment link failsPayment service not connected or endpoint unavailableConnect digital payments and confirm endpoint coverage

Anti-patterns

  • Do not issue type 320 just because a user says “invoice”; confirm whether payment was received.
  • Do not create duplicate customers when clients/search finds a likely match.
  • Do not hard-code 17% VAT in 2026 workflows.
  • Do not ignore allocation-number checks on B2B documents above ₪5,000 before VAT.
  • Do not process webhooks without idempotency.
  • Do not paste API secrets into logs, Markdown, tickets, or chat transcripts.
  • Do not assume payment links are available through the same endpoint for every account.
  • Do not cancel a document by deleting local records; issue an official cancellation or credit document.

File index

  • scripts/green_invoice_integration_client.py: typed sync and async Python client.
  • scripts/green_invoice_integration_cli.py: Typer CLI for auth, customers, documents, payment-link requests, and webhook verification.
  • references/api-reference.md: endpoint, regulation, source, and error reference.
  • references/troubleshooting.md: operational debugging guide.
  • references/test-scenarios.md: practical scenario checklist.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.