AccountIT Direct API Reference
Welcome to the AccountIT developer documentation. The AccountIT Direct API allows third-party platforms to integrate document generation, catalog management, customer databases, and real-time report querying.
The system exposes two styles of endpoints: a lightweight REST-like JSON/GET API and a robust SOAP web service. Both utilize the same underlying core features.
Endpoints
| Environment | REST / JSON URL | SOAP WSDL URL |
|---|---|---|
| Testing (SandBox) | https://mytest.accountit.co.il/api_wp.php |
https://mytest.accountit.co.il/api_ws.php?wsdl |
| Production | https://my.accountit.co.il/api_wp.php |
https://my.accountit.co.il/api_ws.php?wsdl |
ממשק ה־API של AccountIT
ברוכים הבאים למרכז התיעוד של מפתחי AccountIT. ממשק ה־Direct API מאפשר למערכות חיצוניות להפיק מסמכים דיגיטליים, לנהל פריטי קטלוג, לעדכן חשבונות לקוחות/ספקים ולשאול דוחות כספיים בזמן אמת.
המערכת חושפת שני ממשקים מקבילים: ממשק REST-like מבוסס JSON/GET קל וממשק SOAP Web Service מלא. שני הממשקים מסתמכים על אותן פונקציות ליבה.
כתובות קצה (Endpoints)
| סביבה | כתובת REST / JSON | כתובת SOAP WSDL |
|---|---|---|
| בדיקות (Sandbox) | https://mytest.accountit.co.il/api_wp.php |
https://mytest.accountit.co.il/api_ws.php?wsdl |
| ייצור (Production) | https://my.accountit.co.il/api_wp.php |
https://my.accountit.co.il/api_ws.php?wsdl |
Authentication
Every API call must provide user verification parameters. You can send credentials in the JSON body or as query string parameters:
company_code(or legacyprefix) — The unique system-assigned prefix or registration number of your company.app_key(or legacyappKey) — Your developer access key found in AccountIT Settings under the API tab.
Note: All JSON requests must declare the request header Content-Type: application/json.
אימות והרשאות
כל פנייה לממשק ה־API מחייבת זיהוי ואימות של החברה והמשתמש. ניתן להעביר את פרטי האימות בתוך גוף ה־JSON או כפרמטרים בכתובת (Query String):
company_code(או בגרסאות ישנותprefix) — מזהה החברה הייחודי במערכת (או ח.פ / עוסק מורשה).app_key(או בגרסאות ישנותappKey) — מפתח ה־API האישי שנוצר תחת הגדרות המערכת בטאב ה־API.
שים לב: קריאות JSON חייבות לכלול את כותרת ה־HTTP: Content-Type: application/json.
create_document
Creates a new billing document (invoice, receipt, invoice-receipt, or credit note) and registers the items and payments details in the account book.
/api_wp.php
Request Body Payload
{
"action": "create_document",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"docdata": {
"doctype": 9,
"account": 113,
"company": "New Customer Ltd",
"vatnum": "123456789",
"email_client": 1,
"billing_email": "client@example.com",
"currency_sign": "ILS",
"comments": "Thank you for your business!",
"language": "heb"
},
"docdetails": [
{
"cat_num": 1,
"description": "Software Implementation Services",
"qty": 5,
"unit_price": 250,
"price": 1250,
"discount_price": 0
}
],
"rcptdetials": [
{
"type": 1,
"sum": 1250,
"cheque_num": "4567"
}
]
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
docdata.doctype |
Integer | Yes | Document Type: 8 = Invoice/Receipt, 9 = Receipt, 1 = Sales Invoice, 2 = Credit Note. |
docdata.company |
String | Yes | Name of the client/recipient. |
docdata.billing_email |
String | No | Client's email for sending the PDF automatically. |
docdata.email_client |
Integer | No | Set to 1 to mail the document automatically on creation. |
docdetails |
Array | Yes | List of items included in this document. |
rcptdetials |
Array | Yes* | Required for receipts (Type 9 or Type 8 with payments). List of payment methods. |
Response on Success
{
"success": true,
"data": 4321,
"doc_num": 4321,
"pdf_access_public_id": "8c459fbe30d22ba",
"pdf_url": "https://my.accountit.co.il/pdf.php?id=8c459fbe30d22ba"
}
יצירת מסמך (create_document)
מפיק מסמך כספי חדש (חשבונית מס, קבלה, חשבונית מס/קבלה, או תעודת זיכוי) ורושם את הפריטים והתקבולים בפנקס החשבונות של החברה.
/api_wp.php
דוגמת גוף קריאה
{
"action": "create_document",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"docdata": {
"doctype": 9,
"account": 113,
"company": "לקוח חדש בעמ",
"vatnum": "123456789",
"email_client": 1,
"billing_email": "client@example.com",
"currency_sign": "ILS",
"comments": "תודה רבה על שיתוף הפעולה!",
"language": "heb"
},
"docdetails": [
{
"cat_num": 1,
"description": "שעות ייעוץ והטמעת תוכנה",
"qty": 5,
"unit_price": 250,
"price": 1250,
"discount_price": 0
}
],
"rcptdetials": [
{
"type": 1,
"sum": 1250,
"cheque_num": "4567"
}
]
}
שדות הקריאה העיקריים
| שם שדה | סוג | חובה | פירוט |
|---|---|---|---|
docdata.doctype |
מספר שלם | כן | סוג מסמך: 8 = חשבונית מס/קבלה, 9 = קבלה, 1 = חשבונית מס, 2 = תעודת זיכוי. |
docdata.company |
מחרוזת | כן | שם הלקוח / מקבל המסמך. |
docdata.billing_email |
מחרוזת | לא | מייל הלקוח למשלוח אוטומטי של המסמך החתום. |
docdata.email_client |
מספר שלם | לא | יש להעביר 1 כדי שהמערכת תשלח את המסמך מיד במייל. |
docdetails |
מערך פריטים | כן | רשימת הפריטים / השורות הכלולים במסמך. |
rcptdetials |
מערך תקבולים | כן* | חובה בקבלה או חשבונית/קבלה. רשימת אמצעי התשלום. |
תשובת שרת בהצלחה
{
"success": true,
"data": 4321,
"doc_num": 4321,
"pdf_access_public_id": "8c459fbe30d22ba",
"pdf_url": "https://my.accountit.co.il/pdf.php?id=8c459fbe30d22ba"
}
resend_document
Locates an existing document in the company account book (using either its internal unique ID or its Type and Document Number), updates its print counter, and automatically delivers a digital **"Certified True Copy" (העתק נאמן למקור)** PDF attachment to the requested email.
/api_wp.php
Request Body Payload
{
"action": "resend_document",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"num": 4321,
"email": "archive@example.com"
}
Alternatively, locate the document using the Document Type and Document Number:
{
"action": "resend_document",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"doc_type": 8,
"doc_num": 125,
"email": "archive@example.com"
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
num |
Integer | Optional* | The internal unique transaction sequence number (num or id). Required if doc_type is not sent. |
doc_type |
Integer | Optional* | The document type code (e.g., 8, 9). Must be sent alongside doc_num. |
doc_num |
Integer | Optional* | The printed document serial number. Must be sent alongside doc_type. |
email |
String | Yes | Target email address where the True Copy PDF will be emailed. |
Response on Success
{
"success": true,
"message": "Faithful copy has been emailed.",
"document_id": 4321,
"pdf_access_public_id": "8c459fbe30d22ba",
"pdf_url": "https://my.accountit.co.il/pdf.php?id=8c459fbe30d22ba"
}
שליחת העתק נאמן למקור (resend_document)
מאתר מסמך קיים בספרי החברה (לפי מזהה פנימי ייחודי או לפי שילוב של סוג מסמך ומספר מסמך), מעדכן את מונה ההדפסות של המסמך כדי שיוצג כ־**"העתק נאמן למקור"**, ושולח אותו כקובץ PDF חתום דיגיטלית למייל המבוקש.
/api_wp.php
דוגמת גוף קריאה (באמצעות מזהה מסמך פנימי)
{
"action": "resend_document",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"num": 4321,
"email": "archive@example.com"
}
לחלופין, איתור המסמך לפי סוג מסמך ומספר סידורי:
{
"action": "resend_document",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"doc_type": 8,
"doc_num": 125,
"email": "archive@example.com"
}
שדות הקריאה
| שם שדה | סוג | חובה | פירוט |
|---|---|---|---|
num |
מספר שלם | חלקי* | מספר מזהה ייחודי פנימי של המסמך במערכת. חובה אם לא נשלחו doc_type ו־doc_num. |
doc_type |
מספר שלם | חלקי* | קוד סוג המסמך (לדוגמה: 8 לחשבונית/קבלה). יש לשלוח יחד עם doc_num. |
doc_num |
מספר שלם | חלקי* | המספר הסידורי המודפס של המסמך (המספר הרשמי). יש לשלוח יחד עם doc_type. |
email |
מחרוזת | כן | כתובת הדוא"ל אליה יישלח קובץ ה־PDF החתום. |
תשובת שרת בהצלחה
{
"success": true,
"message": "Faithful copy has been emailed.",
"document_id": 4321,
"pdf_access_public_id": "8c459fbe30d22ba",
"pdf_url": "https://my.accountit.co.il/pdf.php?id=8c459fbe30d22ba"
}
create_item
Creates a catalog item record directly in the product database so it can be reused in future invoices or inventory queries.
/api_wp.php
Request Body Payload
{
"action": "create_item",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"item": {
"name": "Consulting hour",
"description": "Developer consulting session",
"defprice": 250,
"cost_price": 100,
"details": "Hourly rate"
}
}
Response on Success
{
"success": true,
"data": 1234,
"item_num": 1234
}
יצירת פריט קטלוגי (create_item)
יוצר פריט קטלוגי חדש במאגר המוצרים של החברה לשימוש עתידי בהפקת מסמכים ומעקב מלאי.
/api_wp.php
דוגמת גוף קריאה
{
"action": "create_item",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"item": {
"name": "שעת ייעוץ",
"description": "שעת ייעוץ והטמעת תוכנה",
"defprice": 250,
"cost_price": 100,
"details": "מחיר שעתי קבוע"
}
}
תשובת שרת בהצלחה
{
"success": true,
"data": 1234,
"item_num": 1234
}
create_account
Creates a new ledger account or customer profile in the company account book databases.
/api_wp.php
Request Body Payload
{
"action": "create_account",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"account_data": {
"type": 0,
"company": "Acme Corporation Ltd",
"vatnum": "514234567",
"email": "billing@acme.com",
"phone": "039876543",
"address": "12 Main St",
"city": "Tel Aviv",
"zip": "67890"
}
}
Account Type Reference
| Value | Description |
|---|---|
0 |
Customers (לקוחות) |
1 |
Suppliers (ספקים) |
2 |
Expenses (הוצאות) |
3 |
Incomes (הכנסות) |
7 |
Banks (בנקים) |
Response on Success
{
"success": true,
"data": 5678,
"account_num": 5678
}
יצירת כרטיס חשבון / לקוח (create_account)
יוצר כרטיס חשבון חדש (לקוח, ספק, בנק או קוד הוצאה) במאגר הלקוחות וחשבונות הספר הראשי של החברה.
/api_wp.php
דוגמת גוף קריאה
{
"action": "create_account",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY",
"account_data": {
"type": 0,
"company": "אקמי מערכות בעמ",
"vatnum": "514234567",
"email": "billing@acme.com",
"phone": "039876543",
"address": "רחוב ראשי 12",
"city": "תל אביב",
"zip": "67890"
}
}
מפתח סוגי חשבונות (Type)
| ערך מספרי | משמעות |
|---|---|
0 |
לקוחות |
1 |
ספקים |
2 |
הוצאות |
3 |
הכנסות |
7 |
בנקים |
תשובת שרת בהצלחה
{
"success": true,
"data": 5678,
"account_num": 5678
}
get_documents
Queries existing documents registered inside the company profile based on search parameters.
/api_wp.php
Request Body Payload
{
"action": "get_documents",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY"
}
Response on Success
[
{
"num": 4321,
"docnum": 125,
"doctype": 8,
"company": "New Customer Ltd",
"total": 1250,
"vat": 172.6,
"currency_sign": "ILS"
}
]
שאילתת מסמכים (get_documents)
שולף רשימת מסמכים שהופקו במערכת תחת הגדרות הסינון וההרשאות של מפתח ה־API.
/api_wp.php
דוגמת גוף קריאה
{
"action": "get_documents",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY"
}
תשובת שרת בהצלחה
[
{
"num": 4321,
"docnum": 125,
"doctype": 8,
"company": "לקוח חדש בעמ",
"total": 1250,
"vat": 172.6,
"currency_sign": "ILS"
}
]
get_items
Queries catalog items registered inside the company database.
/api_wp.php
Request Body Payload
{
"action": "get_items",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY"
}
Response on Success
[
{
"name": "Consulting hour",
"description": "Developer consulting session",
"defprice": 250,
"cost_price": 100
}
]
שאילתת מוצרים ופריטים (get_items)
שולף את רשימת המוצרים והפריטים המנוהלים בקטלוג המוצרים של המערכת.
/api_wp.php
דוגמת גוף קריאה
{
"action": "get_items",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY"
}
תשובת שרת בהצלחה
[
{
"name": "שעת ייעוץ",
"description": "שעת ייעוץ והטמעת תוכנה",
"defprice": 250,
"cost_price": 100
}
]
get_accounts
Queries existing ledger accounts or customers registered inside the company database.
/api_wp.php
Request Body Payload
{
"action": "get_accounts",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY"
}
Response on Success
[
{
"type": 0,
"company": "Acme Corporation Ltd",
"num": 5678,
"vatnum": "514234567",
"email": "billing@acme.com"
}
]
שאילתת לקוחות וחשבונות (get_accounts)
שולף את רשימת החשבונות והלקוחות המוגדרים במערכת הספר הראשי של החברה.
/api_wp.php
דוגמת גוף קריאה
{
"action": "get_accounts",
"company_code": "YOUR_COMPANY_CODE",
"app_key": "YOUR_APP_KEY"
}
תשובת שרת בהצלחה
[
{
"type": 0,
"company": "אקמי מערכות בעמ",
"num": 5678,
"vatnum": "514234567",
"email": "billing@acme.com"
}
]
SOAP/XML Web Service Integration
For enterprise systems that prefer SOAP integration, all core features of AccountIT are available under the target namespace urn:accountitws. The WSDL file automatically defines the complex types, structures, and endpoints required for type-safe code generation in languages like C#, Java, PHP, and Python.
SOAP Endpoint & WSDL URLs:
- Production WSDL:
https://my.accountit.co.il/api_ws.php?wsdl - Sandbox WSDL:
https://mytest.accountit.co.il/api_ws.php?wsdl
SOAP Request Structure
SOAP requests use standard RPC/encoded formatting. Below is an example payload to invoke resend_document:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<q1:resend_document xmlns:q1="urn:accountitws">
<company_code xsi:type="xsd:string">YOUR_COMPANY_CODE</company_code>
<app_key xsi:type="xsd:string">YOUR_APP_KEY</app_key>
<email xsi:type="xsd:string">recipient@example.com</email>
<id xsi:type="xsd:int">4321</id>
<doctype xsi:type="xsd:int">0</doctype>
<docnum xsi:type="xsd:int">0</docnum>
<subject xsi:type="xsd:string">Faithful Copy</subject>
<body xsi:type="xsd:string">Please find the document attached.</body>
</q1:resend_document>
</s:Body>
</s:Envelope>
אינטגרציה באמצעות שירות SOAP/XML
עבור מערכות ארגוניות המעדיפות אינטגרציה מבוססת SOAP, כל פונקציות הליבה של AccountIT זמינות תחת מרחב השמות (Namespace) urn:accountitws. קובץ ה־WSDL מגדיר אוטומטית את טיפוסי הנתונים המורכבים, המבנים וכתובות הקצה הנדרשות ליצירת קליינטים מבוססי טיפוסים (Type-safe) בשפות כגון C#, Java, PHP ו־Python.
כתובות ה־WSDL ונקודות הקצה:
- סביבת ייצור (Production):
https://my.accountit.co.il/api_ws.php?wsdl - סביבת בדיקות (Sandbox):
https://mytest.accountit.co.il/api_ws.php?wsdl
מבנה פניית SOAP
פניות SOAP במערכת משתמשות בפורמט RPC/encoded תקני. להלן דוגמה לגוף הפנייה עבור הפעלת resend_document:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<q1:resend_document xmlns:q1="urn:accountitws">
<company_code xsi:type="xsd:string">YOUR_COMPANY_CODE</company_code>
<app_key xsi:type="xsd:string">YOUR_APP_KEY</app_key>
<email xsi:type="xsd:string">recipient@example.com</email>
<id xsi:type="xsd:int">4321</id>
<doctype xsi:type="xsd:int">0</doctype>
<docnum xsi:type="xsd:int">0</docnum>
<subject xsi:type="xsd:string">העתק נאמן למקור</subject>
<body xsi:type="xsd:string">מצורף מסמך נאמן למקור.</body>
</q1:resend_document>
</s:Body>
</s:Envelope>
SOAP Complex Types & Structures
The SOAP service defines several complex structures. Refer to the table below to construct request payloads correctly:
Complex Types Reference
| Type Name | Structure Fields & Types | Description |
|---|---|---|
docdata |
doctype (int), account (int), company (string), vatnum (string), address (string), city (string), zip (string), phone (string), refnum (string), sub_total (float), novat_total (float), total (float), vat (float), manage_tax (int), src_tax (float), price_include_vat (int), email_client (int), billing_email (string), currency_sign (string), comments (string), notify_owner (int), footer_credit (string), language (string)
|
Document master fields (header details). Used during document creation. |
itemdata |
name (string), description (string), defprice (float), unit_price (float), currency (int), group_id (int), unit_id (int), cost_price (float), profit (float), min (float), max (float), order_point (float), details (string), name_eng (string), alt_catalog_number (string), internal_barcode (string), external_barcode (string), location_1 (string), location_2 (string), location_3 (string), color (string), item_type (int), status (int), is_default (int), created_at (string), update_at (string)
|
Catalog item parameters. Used during item registration. |
items |
cat_num (int), description (string), qty (float), unit_price (float), price (float), discount_price (float)
|
Line item detailing specific goods/services added on a document. Passed as an array (itemsArray). |
payments |
type (int), sum (float), cheque_num (string)
|
Payment method lines. Passed as an array (paymentsArray). Codes: 1=Cash, 2=Check, 3=Credit Card, 4=Bank Transfer. |
accountdata |
type (int), sub_type (int), company (string), id6111 (int), pay_terms (string), src_tax (float), src_date (string), vatnum (string), email (string), phone (string), contact (string), department (string), status (int), dir_phone (string), cellular (string), fax (string), address (string), city (string), zip (string), comments (string), include856 (int), clearance856type (string), Position (string), Assessor (string), Occupation (string), country (string), state (string), price_list_id (int), taxnumber (string), foreign_number (string), acc_bank_type (string), cash_register_used (string), payment_method_used (string), acc_bank (string), acc_branch (string), acc_bankaccount (string), deductible_tax (float), created_at (string)
|
Client/supplier account card fields. Used for ledger setup. |
resend_document_response |
success (boolean), message (string), document_id (int), pdf_access_public_id (string), pdf_url (string)
|
Return structure of the resend_document endpoint. |
balance |
account (int), account_balance (float), date (string)
|
Bank book balance details. |
SOAP Methods Reference
Click on any method header to expand the detailed parameter reference, return types, and descriptions.
create_document & create_document_id
Description: Registers and generates a new invoice, receipt, receipt-invoice, or credit note in the system ledger.
Parameters:
company_code(string) - Company prefix keyapp_key(string) - API developer keydocdata(tns:docdata) - Header detailsitems(tns:itemsArray) - Array of document itemspayments(tns:paymentsArray) - Array of payment methods
Expected Return:
xsd:int: create_document returns the generated serial document number. create_document_id returns the internal primary database ID of the document record.
resend_document
Description: Sends a faithful copy of a generated document directly to the specified email address, providing a direct download link and status feedback.
Parameters:
company_code(string)app_key(string)email(string) - Recipient email addressid(int) - The internal database ID of the document (Optional, pass0if using doctype/docnum search)doctype(int) - Document type code (Optional)docnum(int) - Document serial number (Optional)subject(string) - Custom email subject line (Optional)body(string) - Custom email body message (Optional)
Expected Return:
tns:resend_document_response: Returns a struct containing success (bool), message (string), document_id (int), pdf_access_public_id (string), and pdf_url (string - absolute URL to the PDF file).
create_item & get_items
Description: create_item registers a catalog item. get_items queries items from the company catalog.
Parameters for create_item:
company_code(string)app_key(string)itemdata(tns:itemdata)
Parameters for get_items:
company_code(string)app_key(string)num(int) - Item catalog number (Pass0to retrieve all items)
Expected Return:
create_item returns xsd:int (catalog ID). get_items returns tns:itemsArray containing matching catalog items.
create_account & get_accounts
Description: create_account registers a customer or vendor. get_accounts fetches accounts from the ledger.
Parameters for create_account:
company_code(string)app_key(string)accountdata(tns:accountdata)
Parameters for get_accounts:
company_code(string)app_key(string)account(int) - Account number (Pass0for all accounts)type(int) - Account role filter
Expected Return:
create_account returns xsd:int (Account number). get_accounts returns tns:accountsArray.
get_documents & get_documents_full
Description: Queries document records. get_documents returns document headers, while get_documents_full returns headers, line items, and payment details.
Parameters:
company_code(string)app_key(string)num(int) - Document number to search (Pass0for all documents)
Expected Return:
get_documents returns tns:documentsArray. get_documents_full returns tns:documents_fullArray.
get_bankbook_balance & set_bankbook_file
Description: Retrieves bookkeeping account balance or uploads base64 bank files to ledger processing.
Parameters:
company_code(string)app_key(string)account(int) - Account bank book codefile_type(string - set_bankbook_file only) - Bank name / format typefile_data(string - set_bankbook_file only) - Base64 encoded file data
Expected Return:
get_bankbook_balance returns tns:balance struct. set_bankbook_file returns xsd:int status code.
get_period_reports & get_saved_vat_report & get_saved_tax_report
Description: Retrives periodic tax reports (VAT / Income Tax) calculations, aggregations, and filing status summaries.
Expected Return:
Returns report summary lists or details structures matching vat_report or tax_report complex types.
מבנים וטיפוסים מורכבים (SOAP Complex Types)
שירות ה־SOAP מגדיר מספר מבנים מורכבים. יש להסתמך על הטבלה הבאה כדי לבנות את הנתונים הנשלחים בפניות ה־XML:
מילון טיפוסי נתונים
| שם הטיפוס | שדות המבנה וסוגי הנתונים | תיאור |
|---|---|---|
docdata |
doctype (int), account (int), company (string), vatnum (string), address (string), city (string), zip (string), phone (string), refnum (string), sub_total (float), novat_total (float), total (float), vat (float), manage_tax (int), src_tax (float), price_include_vat (int), email_client (int), billing_email (string), currency_sign (string), comments (string), notify_owner (int), footer_credit (string), language (string)
|
נתוני כותרת המסמך המופק (פרטי הלקוח, סוג, סכומים). משמש בעת יצירת מסמך. |
itemdata |
name (string), description (string), defprice (float), unit_price (float), currency (int), group_id (int), unit_id (int), cost_price (float), profit (float), min (float), max (float), order_point (float), details (string), name_eng (string), alt_catalog_number (string), internal_barcode (string), external_barcode (string), location_1 (string), location_2 (string), location_3 (string), color (string), item_type (int), status (int), is_default (int), created_at (string), update_at (string)
|
פרטי פריט קטלוגי ברישום מוצרים. |
items |
cat_num (int), description (string), qty (float), unit_price (float), price (float), discount_price (float)
|
שורת פריט בודדת המתווספת למסמך. מועברת כמערך (itemsArray). |
payments |
type (int), sum (float), cheque_num (string)
|
שורת תשלום במסמך קבלה/חשבונית־קבלה. מועברת כמערך (paymentsArray). קודי תשלום: 1=מזומן, 2=צ'ק, 3=כרטיס אשראי, 4=העברה בנקאית. |
accountdata |
type (int), sub_type (int), company (string), id6111 (int), pay_terms (string), src_tax (float), src_date (string), vatnum (string), email (string), phone (string), contact (string), department (string), status (int), dir_phone (string), cellular (string), fax (string), address (string), city (string), zip (string), comments (string), include856 (int), clearance856type (string), Position (string), Assessor (string), Occupation (string), country (string), state (string), price_list_id (int), taxnumber (string), foreign_number (string), acc_bank_type (string), cash_register_used (string), payment_method_used (string), acc_bank (string), acc_branch (string), acc_bankaccount (string), deductible_tax (float), created_at (string)
|
פרטי כרטיס חשבון/לקוח/ספק ברישום מאגר כרטיסים. |
resend_document_response |
success (boolean), message (string), document_id (int), pdf_access_public_id (string), pdf_url (string)
|
מבנה התשובה המוחזר מהפונקציה resend_document. |
תיעוד פונקציות SOAP
לחץ על כותרת הפונקציה כדי להציג את הפרמטרים, הערכים המוחזרים ותיאור הפעולה.
create_document & create_document_id
תיאור: רישום והפקת מסמך כספי חדש במערכת (חשבונית מס, קבלה, חשבונית־קבלה, זיכוי וכד').
פרמטרים:
company_code(string) - מפתח מזהה החברהapp_key(string) - מפתח ה־API של המפתחdocdata(tns:docdata) - פרטי כותרת המסמךitems(tns:itemsArray) - רשימת שורות פריטיםpayments(tns:paymentsArray) - רשימת שורות תקבולים (חובה בקבלות)
ערך מוחזר:
xsd:int: create_document מחזירה את מספר המסמך הסידורי שנוצר. create_document_id מחזירה את מזהה המסמך הפנימי בבסיס הנתונים (ID).
resend_document
תיאור: שליחה חוזרת של מסמך כספי כהעתק נאמן למקור לכתובת דוא"ל מבוקשת, המערכת מאתרת את המסמך ושולחת לינק ישיר להורדה.
פרמטרים:
company_code(string)app_key(string)email(string) - דוא"ל היעד למשלוח המסמךid(int) - מזהה ייחודי פנימי של המסמך (אופציונלי, העבר0אם האיתור מתבצע לפי סוג ומספר)doctype(int) - סוג המסמך (אופציונלי)docnum(int) - מספר המסמך הסידורי (אופציונלי)subject(string) - כותרת אישית להודעת המייל (אופציונלי)body(string) - גוף הודעה מותאם למייל (אופציונלי)
ערך מוחזר:
tns:resend_document_response: מחזירה מבנה המכיל הצלחה/כישלון, הודעת פידבק, מזהה מסמך פנימי, מזהה ציבורי וכתובת URL מלאה לקובץ ה־PDF שנוצר.
create_item & get_items
תיאור: יצירה ושליפת פריטים מהקטלוג העסקי של החברה.
פרמטרים ליצירת פריט (create_item):
company_code(string)app_key(string)itemdata(tns:itemdata)
פרמטרים לשליפת פריטים (get_items):
company_code(string)app_key(string)num(int) - מספר קטלוגי ספציפי (העבר0לשליפת כל הפריטים)
ערך מוחזר:
create_item מחזירה מזהה סידורי של הפריט שנוצר. get_items מחזירה מערך פריטים tns:itemsArray.
create_account & get_accounts
תיאור: ניהול כרטיסי חשבון, לקוחות וספקים בספר הראשי.
פרמטרים ליצירת חשבון (create_account):
company_code(string)app_key(string)accountdata(tns:accountdata)
פרמטרים לשליפת חשבונות (get_accounts):
company_code(string)app_key(string)account(int) - מזהה כרטיס חשבון מבוקש (או0להצגת כולם)type(int) - סינון לפי סוג כרטיס
ערך מוחזר:
create_account מחזירה את מספר כרטיס החשבון שנוצר. get_accounts מחזירה רשימת חשבונות tns:accountsArray.
get_documents & get_documents_full
תיאור: שליפת נתוני מסמכים שהופקו. get_documents_full מחזירה את כותרות המסמכים בתוספת שורות הפריטים והתקבולים שלהם.
פרמטרים:
company_code(string)app_key(string)num(int) - מספר מסמך מבוקש (העבר0לשאילתה כללית)
ערך מוחזר:
מערך נתוני מסמכים מסוג tns:documentsArray או tns:documents_fullArray בהתאמה.
get_bankbook_balance & set_bankbook_file
תיאור: בדיקת יתרות חשבון בנק או העלאת קבצי דפי בנק לעיבוד ורישום תנועות ביומן.
פרמטרים:
company_code(string)app_key(string)account(int) - מספר כרטיס חשבון הבנק בספריםfile_type(string) - סוג הפורמט של דף הבנק (לדוגמה 'poalim', 'leumi')file_data(string) - תוכן הקובץ מקודד ב־Base64
ערך מוחזר:
יתרת בנק מוחזרת במבנה tns:balance. העלאת קובץ מחזירה קוד סטטוס xsd:int.
SOAP Code Integration Examples
Use the snippets below to easily set up connection and execute requests against the AccountIT SOAP API in your programming environment:
1. PHP (SoapClient)
<?php
$wsdl = "https://my.accountit.co.il/api_ws.php?wsdl";
$client = new SoapClient($wsdl, [
'trace' => 1,
'exceptions' => true,
'encoding' => 'UTF-8'
]);
try {
$response = $client->resend_document(
"YOUR_COMPANY_CODE", // company_code
"YOUR_APP_KEY", // app_key
"recipient@example.com", // recipient email
4321, // document internal ID
0, // doctype (optional)
0, // docnum (optional)
"Faithful Copy of Document", // subject (optional)
"Hello, please find the document attached." // email body (optional)
);
if ($response->success) {
echo "Email sent! PDF Link: " . $response->pdf_url;
} else {
echo "API Error: " . $response->message;
}
} catch (SoapFault $e) {
echo "SOAP Client Fault: " . $e->getMessage();
}
?>
2. Python (using zeep)
import zeep
wsdl_url = "https://my.accountit.co.il/api_ws.php?wsdl"
client = zeep.Client(wsdl=wsdl_url)
try:
response = client.service.resend_document(
company_code="YOUR_COMPANY_CODE",
app_key="YOUR_APP_KEY",
email="recipient@example.com",
id=4321,
doctype=0,
docnum=0,
subject="Faithful Copy of Document",
body="Hello, please find the document attached."
)
if response['success']:
print(f"Sent successfully! PDF: {response['pdf_url']}")
else:
print(f"Failed: {response['message']}")
except Exception as e:
print(f"Connection failed: {e}")
3. Node.js (using soap npm package)
const soap = require('soap');
const wsdlUrl = 'https://my.accountit.co.il/api_ws.php?wsdl';
const payload = {
company_code: 'YOUR_COMPANY_CODE',
app_key: 'YOUR_APP_KEY',
email: 'recipient@example.com',
id: 4321,
doctype: 0,
docnum: 0,
subject: 'Faithful Copy of Document',
body: 'Hello, please find the document attached.'
};
soap.createClient(wsdlUrl, (err, client) => {
if (err) return console.error('Error creating client:', err);
client.resend_document(payload, (err, result) => {
if (err) return console.error('SOAP call error:', err);
if (result.success) {
console.log('Sent successfully! URL:', result.pdf_url);
} else {
console.log('API rejected request:', result.message);
}
});
});
דוגמאות קוד לאינטגרציית SOAP
להלן קטעי קוד בשפות פיתוח נפוצות המדגימים כיצד לאתחל את ממשק ה־SOAP, להעביר פרמטרים ולבצע קריאות API מול שרתי המערכת:
1. קוד דוגמה ב־PHP (SoapClient)
<?php
$wsdl = "https://my.accountit.co.il/api_ws.php?wsdl";
$client = new SoapClient($wsdl, [
'trace' => 1,
'exceptions' => true,
'encoding' => 'UTF-8'
]);
try {
$response = $client->resend_document(
"YOUR_COMPANY_CODE", // company_code
"YOUR_APP_KEY", // app_key
"recipient@example.com", // דוא"ל נמען
4321, // מזהה פנימי ID
0, // סוג מסמך (אופציונלי)
0, // מספר מסמך (אופציונלי)
"העתק נאמן למקור של מסמך", // כותרת מייל
"שלום רב, מצורף קובץ מסמך המקור לבקשתך." // גוף הודעה
);
if ($response->success) {
echo "הודעה נשלחה בהצלחה! קישור לקובץ: " . $response->pdf_url;
} else {
echo "שגיאת שירות API: " . $response->message;
}
} catch (SoapFault $e) {
echo "שגיאת חיבור SOAP: " . $e->getMessage();
}
?>
2. קוד דוגמה ב־Python (ספריית zeep)
import zeep
wsdl_url = "https://my.accountit.co.il/api_ws.php?wsdl"
client = zeep.Client(wsdl=wsdl_url)
try:
response = client.service.resend_document(
company_code="YOUR_COMPANY_CODE",
app_key="YOUR_APP_KEY",
email="recipient@example.com",
id=4321,
doctype=0,
docnum=0,
subject="העתק נאמן למקור",
body="שלום רב, מצורף מסמך נאמן למקור המבוקש."
)
if response['success']:
print(f"נשלח בהצלחה! קישור: {response['pdf_url']}")
else:
print(f"שגיאת API: {response['message']}")
except Exception as e:
print(f"חיבור נכשל: {e}")
3. קוד דוגמה ב־Node.js (חבילת soap)
const soap = require('soap');
const wsdlUrl = 'https://my.accountit.co.il/api_ws.php?wsdl';
const payload = {
company_code: 'YOUR_COMPANY_CODE',
app_key: 'YOUR_APP_KEY',
email: 'recipient@example.com',
id: 4321,
doctype: 0,
docnum: 0,
subject: 'העתק נאמן למקור של מסמך',
body: 'מצורף המסמך המבוקש נאמן למקור.'
};
soap.createClient(wsdlUrl, (err, client) => {
if (err) return console.error('שגיאה ביצירת קליינט:', err);
client.resend_document(payload, (err, result) => {
if (err) return console.error('שגיאה בפניית SOAP:', err);
if (result.success) {
console.log('נשלח בהצלחה! קישור:', result.pdf_url);
} else {
console.log('שגיאת API:', result.message);
}
});
});
Error Codes & Troubleshooting
When an API request fails, the response will carry a negative status code or a descriptive JSON structure with a boolean success: false.
| Error Code | Status Message / Cause | Resolution |
|---|---|---|
-2 |
Authentication failed or API access is disabled. | Verify that both your company_code and app_key are correct and active. |
-3 |
Unsupported API version. | Contact support or verify parameters format. |
-5 |
Database creation / operation failed. | The database failed to record transaction. Usually due to duplicate keys or validation limits. |
-10 |
Validation error / missing target fields. | Ensure all mandatory fields such as email and unique identifiers are present. |
-11 |
Target document not found. | The document combination or internal ID requested was not found under this company prefix. |
-12 |
Email delivery threshold / limits exceeded. | The company reached its daily or monthly limit for automated outbound mails. |
קודי שגיאה ופתרון בעיות
במקרה שקריאת ה־API נכשלת, השרת יחזיר קוד שגיאה שלילי או מבנה JSON המכיל מפתח success: false יחד עם הודעת שגיאה מפורטת.
| קוד שגיאה | סיבת השגיאה | דרכי פתרון ומניעה |
|---|---|---|
-2 |
אימות נכשל או הרשאת ה־API מושבתת במערכת. | יש לוודא ששדות company_code ו־app_key שהועברו אכן נכונים ופעילים בהגדרות החברה. |
-3 |
גרסת API אינה נתמכת. | יש לוודא את תקינות הפנייה והשדות שנשלחו לפי פורמט התיעוד הנוכחי. |
-5 |
פעולת הכתיבה או היצירה נכשלה בבסיס הנתונים. | המערכת נכשלה לרשום את הרשומה. ייתכן עקב מפתח כפול או מגבלה חשבונאית. |
-10 |
שגיאת ולידציה או נתונים חסרים. | יש לוודא שכל שדות החובה מולאו כראוי (לדוגמה: כתובת מייל תקינה או מזהי מסמך). |
-11 |
המסמך המבוקש לא נמצא. | מזהה המסמך או שילוב הסוג והמספר המבוקשים לא קיימים תחת חברה זו. |
-12 |
חריגה ממכסת שליחת מיילים יומית / חודשית. | החברה הגיעה לתקרת שליחת הודעות הדוא"ל שהוקצתה לה במערכת. |