{ "info": { "_postman_id": "f3448664-95f4-40fe-acaa-c84ab006efbb", "name": "Invoice4u API collection", "description": "## Invoice4u REST API\n\n**Authentication is via your Invoice4u API key only.** Login/session tokens are no longer accepted by the API. The `Invoice4u_ApiKey` collection variable is sent as `token` on every endpoint, and as `Invoice4UUserApiKey` on clearing (`ProcessApiRequestV2`) calls.\n\nCurated collection of `ApiService.svc` examples for integrating against Invoice4u: creating documents, managing customers, charging cards, and looking up clearing logs. Each request explains the business scenario it demonstrates so you can copy it as-is or adapt it.\n\n### Folder layout\n- **Authentication** - verify that your API key is active before running any business calls\n- **Customers** - create, update, retrieve and search customers\n- **Documents** - issue every supported document type (invoice, receipt, invoice-receipt, credit, proforma, order, quote, delivery note), look them up, and perform post-creation actions\n- **Branches** - list branches for multi-location organisations\n- **Clearing & Payments** - credit-card / Bit charging via `ProcessApiRequestV2`, plus clearing-log queries\n- **User Registration** - template only (restricted partner endpoint)\n\n### Variables to set before running\nOpen the collection's **Variables** tab and fill in:\n\n| Variable | Purpose |\n|---|---|\n| `baseURL` | API host, e.g. `https://api.invoice4u.co.il` |\n| `Invoice4u_ApiKey` | Your Invoice4u API key. Sent as `token` on every endpoint, and as `Invoice4UUserApiKey` on clearing calls. |\n| `ClientID` | ID of an existing customer used by the document examples |\n\n### Dynamic helpers (already wired up)\n- `{{$guid}}` - Postman built-in, used for `ApiIdentifier` to keep document creation idempotent.\n- `{{$timestamp}}` - Unix seconds, useful for ad-hoc identifiers.\n- `{{CurrentMsDate}}` - populated by the pre-request script in the Microsoft `/Date(ms+0200)/` format expected by the API.\n\n### Suggested order for first-time integrators\n1. Run **Authentication > Verify API Key** to confirm `Invoice4u_ApiKey` is valid.\n2. Run **Customers > Create Customer** and copy the returned `ID` into `ClientID`.\n3. Run a document example (start with **Documents > Invoice > Existing Customer - minimal taxable invoice**).\n4. Optionally run **Documents > Search & Retrieve > Get Document by API Identifier (REST)** with the same `ApiIdentifier` to fetch the document back.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "51026293", "_collection_link": "https://go.postman.co/collection/51026293-f3448664-95f4-40fe-acaa-c84ab006efbb?source=collection_link" }, "item": [ { "name": "πŸ” Authentication", "description": "Endpoints used to verify that your API key is active and authorized before running any business calls. Run this once whenever you change `Invoice4u_ApiKey`.", "item": [ { "name": "Verify API Key (IsAuthenticated)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/IsAuthenticated", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "IsAuthenticated" ] }, "description": "Returns the `User` object that owns the supplied API key, or an error if the key is invalid / expired. Run this first to confirm `Invoice4u_ApiKey` is set correctly before sending business calls." }, "response": [] } ] }, { "name": "πŸ‘₯ Customers", "description": "Create, update, search and retrieve customers (`Customer` entity).", "item": [ { "name": "Create Customer (with external GUID)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"cu\": {\r\n \"Name\": \"Acme Ltd.\",\r\n \"Email\": \"contact@acme.test\",\r\n \"Guid\": \"{{$guid}}\",\r\n \"Phone\": \"03-5555444\",\r\n \"Cell\": \"050-1234567\",\r\n \"UniqueID\": \"514526996\",\r\n \"Address\": \"1 Rothschild Blvd\",\r\n \"City\": \"Tel Aviv\",\r\n \"Zip\": \"6688101\",\r\n \"Active\": true,\r\n \"IsNonUniqueNameCreation\": true\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateCustomer", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateCustomer" ] }, "description": "Creates a new customer. `Guid` is the external id you control – using `{{$guid}}` ensures every run produces a unique customer. Set `IsNonUniqueNameCreation:true` to allow duplicate names in the same organisation." }, "response": [] }, { "name": "Update Customer (by ID)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"cu\": {\r\n \"ID\": {{ClientID}},\r\n \"Name\": \"Acme Ltd. (updated)\",\r\n \"Email\": \"billing@acme.test\",\r\n \"Phone\": \"03-5555444\",\r\n \"Cell\": \"050-1234567\",\r\n \"Active\": true\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/UpdateCustomer", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "UpdateCustomer" ] }, "description": "Updates an existing customer. `ID` is required and must belong to the authenticated organisation." }, "response": [] }, { "name": "Get Full Customer (by ID)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\r\n \"id\": {{ClientID}},\r\n \"orgID\": 0,\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetFullCustomer", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetFullCustomer" ] }, "description": "Returns the full `Customer` record (including extended fields such as bank details and associated emails). `orgID:0` falls back to the organisation that owns the supplied API key." }, "response": [] }, { "name": "Get Customer by GUID", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"guid\": \"b6a83eeb-casfbc0-4b01-a71b-6d6asdaf\",\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetCustomerByGuid", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetCustomerByGuid" ] }, "description": "Looks up a customer by the external `Guid` you supplied at creation time." }, "response": [] }, { "name": "Search Customers (LIKE filter on name/email/phone/UniqueID)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"cust\": {\r\n \"Name\": \"Acme\",\r\n \"Email\": \"acme.test\",\r\n \"Cell\": \"0547909700\",\r\n \"UniqueID\": \"514526996\",\r\n \"Active\": true\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetCustomers", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetCustomers" ] }, "description": "Free-text search across customers. All `cust` fields are optional – any supplied field acts as a `LIKE` filter." }, "response": [] }, { "name": "List All Customers in My Organisation", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetCustomersByOrgId", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetCustomersByOrgId" ] }, "description": "Returns every customer belonging to the organisation that owns `Invoice4u_ApiKey`." }, "response": [] }, { "name": "Quick Lookup - Search Customers by Name only", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"cust\": {\r\n \"Name\": \"Acme\"\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetCustomers", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetCustomers" ] }, "description": "Shortcut variant of `GetCustomers` that searches by `Name` only. Use this when integrating a 'customer auto-complete' style picker on your side - send the user's typed text as `Name` and display the matches." }, "response": [] } ] }, { "name": "πŸ“„ Documents", "description": "Document generation, lookup, drafts and post-creation actions.\n\n### Document type cheat-sheet\n| Type | Name | Used for |\n|---|---|---|\n| 1 | Invoice | Tax invoice (Χ—Χ©Χ‘Χ•Χ Χ™Χͺ מב) |\n| 2 | Receipt | Receipt only (Χ§Χ‘ΧœΧ”) – needs `Payments` |\n| 3 | InvoiceReceipt | Invoice + receipt combined – needs `Items` **and** `Payments` |\n| 4 | InvoiceCredit | Credit / refund invoice (Χ—Χ©Χ‘Χ•Χ Χ™Χͺ Χ–Χ™Χ›Χ•Χ™) – usually references an existing invoice |\n| 5 | ProformaInvoice | Pro-forma / Χ—Χ©Χ‘Χ•ΧŸ Χ’Χ‘Χ§Χ” |\n| 6 | InvoiceOrder | Order |\n| 7 | InvoiceQuote | Price quote |\n| 8 | InvoiceShip | Delivery note (ΧͺΧ’Χ•Χ“Χͺ ΧžΧ©ΧœΧ•Χ—) |\n\n### Common fields\n- `ClientID` – existing customer; **or** supply `GeneralCustomer` for a one-time client.\n- `ApiIdentifier` – your own idempotency key; use `{{$guid}}` to keep it unique.\n- `TaxIncluded` – `true` if `Price` already includes VAT.\n- `Items[].TaxPercentage` – `0` to mark item as tax-exempt.\n- `Payments[].PaymentType` – `1`=CreditCard, `2`=Check, `3`=Transfer, `4`=Cash, `5`=Credit, `6`=Withholding, `7`=Other, `8`=Bit, `9`=PayBox.\n- `DocumentReffType` – `1` = receipt for an existing invoice, `2` = cancellation.", "item": [ { "name": "🧾 Invoice (Type 1)", "description": "## Tax Invoice (Χ—Χ©Χ‘Χ•Χ Χ™Χͺ מב) – `DocumentType = 1`\n\nStandard tax invoice. Records what the customer owes but **does not** record payment – for a paid document use Invoice-Receipt (Type 3), and for the payment side alone use Receipt (Type 2).\n\n### When to use it\n- Standard sale where the customer will pay later (open receivable).\n- Converting an approved Quote (Type 7), Order (Type 6), Proforma (Type 5) or Delivery Note (Type 8) into an actual accounting document.\n\n### Required fields\n- `ClientID` (or `GeneralCustomer` for walk-ins).\n- `DocumentType = 1`.\n- `Items[]` – at least one line with `Name`, `Quantity`, `Price`.\n- `Currency` (e.g. `\"ILS\"`) and `TaxIncluded` (`true` if `Price` is VAT-inclusive).\n\n### Optional but recommended\n- `ApiIdentifier` (a GUID you generate) – makes the call idempotent, so retries return the same invoice instead of duplicating it.\n- `Discount` – flat (`IsNominal:true`) or percentage; `BeforeTax` controls whether it applies before or after VAT.\n- `DocumentReffType` + `Invoices[]` – set when converting from a Quote/Order/Proforma/Delivery Note so the source's status is updated.\n- `AssociatedEmails[]` – recipients that receive the PDF on creation.\n\n### Common pitfalls\n- Do **not** send `Payments[]` here – add them via a Receipt (Type 2) referencing this invoice, or use an Invoice-Receipt (Type 3).\n- Foreign-currency invoices need `TaxPercentage = 0` and the destination currency code.\n- Once created, an invoice cannot be edited – to fix it, issue a Credit Invoice (Type 4) and reissue.\n\n### After the call\nThe response contains the new document's `ID` (GUID) and `Number`. Fetch it back via **πŸ” Search & Retrieve β€Ί Get Document by GUID** or **Get Document by API Identifier**.", "item": [ { "name": "Existing Customer - minimal taxable invoice", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 1,\r\n \"Subject\": \"Monthly retainer\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"RoundAmount\": 0,\r\n \"Items\": [\r\n {\r\n \"Code\": \"001\",\r\n \"Name\": \"Consulting hours\",\r\n \"Quantity\": 1,\r\n \"Price\": 100\r\n }\r\n ],\r\n \"AssociatedEmails\": [\r\n { \"Mail\": \"user@yourcompany.test\", \"IsUserMail\": true },\r\n { \"Mail\": \"client@acme.test\", \"IsUserMail\": false }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Minimal invoice with a single taxable item. Using `CreateDocumentWithIdentifierValidation` blocks accidental duplicates that share the same `ApiIdentifier` within ~60s." }, "response": [] }, { "name": "Existing Customer - multiple line items (taxable + tax-exempt)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 1,\r\n \"Subject\": \"Mixed cart\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": false,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n {\r\n \"Code\": \"TAXABLE-01\",\r\n \"Name\": \"Taxable item\",\r\n \"Quantity\": 2,\r\n \"Price\": 50\r\n },\r\n {\r\n \"Code\": \"FREE-01\",\r\n \"Name\": \"Tax-exempt item\",\r\n \"Quantity\": 1,\r\n \"Price\": 100,\r\n \"TaxPercentage\": 0\r\n }\r\n ],\r\n \"AssociatedEmails\": [\r\n { \"Mail\": \"client@acme.test\", \"IsUserMail\": false }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Demonstrates mixing taxable and tax-exempt items in the same invoice." }, "response": [] }, { "name": "Existing Customer - with flat-amount pre-tax discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 1,\r\n \"Subject\": \"Invoice with 10 ILS off\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n {\r\n \"Code\": \"001\",\r\n \"Name\": \"Service\",\r\n \"Quantity\": 1,\r\n \"Price\": 100\r\n }\r\n ],\r\n \"Discount\": {\r\n \"Value\": 10,\r\n \"IsNominal\": true,\r\n \"BeforeTax\": true\r\n }\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "`Discount.IsNominal=true` β‡’ Value is a flat amount. Set `IsNominal:false` and use a value like `10` to apply a 10% discount instead. `BeforeTax:true` applies the discount on the pre-VAT amount." }, "response": [] }, { "name": "Walk-in (one-time) Customer - GeneralCustomer", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"GeneralCustomer\": {\r\n \"Name\": \"Walk-in customer\",\r\n \"Identifier\": \"036859484\"\r\n },\r\n \"DocumentType\": 1,\r\n \"Subject\": \"One-off invoice\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n {\r\n \"Code\": \"001\",\r\n \"Name\": \"On-site service\",\r\n \"Quantity\": 1,\r\n \"Price\": 250\r\n }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Use `GeneralCustomer` (instead of `ClientID`) when you don't want to persist a customer record. `Identifier` is the customer's Israeli ID / company number and is required for tax-invoice compliance over a certain amount." }, "response": [] }, { "name": "Existing Customer - foreign-currency export invoice (USD, 0% VAT)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 1,\r\n \"Subject\": \"Export invoice\",\r\n \"Currency\": \"USD\",\r\n \"ConversionRate\": 3.7,\r\n \"ConvertToILS\": true,\r\n \"TaxIncluded\": false,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n {\r\n \"Code\": \"EXP-01\",\r\n \"Name\": \"Export service\",\r\n \"Quantity\": 1,\r\n \"Price\": 100,\r\n \"TaxPercentage\": 0\r\n }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Foreign-currency export invoice. `ConversionRate` is the rate vs ILS used by the books; `TaxPercentage:0` is typical for true exports." }, "response": [] }, { "name": "Existing Customer - with 10% percentage discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 1,\r\n \"Subject\": \"Invoice with 10% off\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Discount\": {\r\n \"Value\": 10,\r\n \"IsNominal\": false,\r\n \"BeforeTax\": true\r\n }\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Percentage discount variant. `Discount.IsNominal:false` makes `Value` a percent (here, 10%), as opposed to a flat amount. `BeforeTax:true` applies the discount on the pre-VAT amount." }, "response": [] } ] }, { "name": "πŸ’° Receipt (Type 2)", "description": "## Receipt (Χ§Χ‘ΧœΧ”) – `DocumentType = 2`\n\nA receipt records **payment received**. It carries `Payments[]` but never `Items[]` – the goods/services must already be described on a source Invoice.\n\n### When to use it\n- Settling one or more previously issued Tax Invoices (Type 1) or Proformas (Type 5).\n- Standalone payment capture (e.g. donation receipts for NGOs).\n- Cancelling a previous receipt (`DocumentReffType = 2` + `CancelDocument = true`).\n\n### Required fields\n- `ClientID` (or `GeneralCustomer`).\n- `DocumentType = 2`.\n- `Payments[]` – at least one payment with `Amount`, `PaymentType`, and payment-type-specific fields (e.g. cheque number, credit-card last-4).\n- `Currency` matching the source invoice(s).\n\n### Settling existing invoices\n- Set `DocumentReffType = 1` (Invoice) or `5` (Proforma).\n- List each source under `Invoices[]` with `ID` (GUID), `DocumentType`, `ClientID`, `Total`, and `ReceiptAmount` (how much of it is being paid now).\n- Sum of `Invoices[].ReceiptAmount` **must equal** sum of `Payments[].Amount` (`Deduction` counts toward payments). Otherwise the API returns `PaymentAmountDoesntMatchReffDocumentsAmount` (error 55).\n- The source must be status `Open` (1) or `PartiallyCredited` (4). Fully-paid invoices are rejected with `DocumentStatusInValid` (error 49).\n\n### Common pitfalls\n- Do **not** send `Items[]` – receipts are payment-only.\n- `PaymentType` must be one of the values in `PaymentTypes` (1 = CreditCard, 2 = Check, 3 = MoneyTransfer, 4 = Cash, 6 = WithholdingTax, 8 = Bit, 9 = PayBox). Wrong values return `PaymentTypeOutOfRange` (error 51).\n- Withholding-tax amounts go in `Deduction`, not in `Payments[]`.\n\n### After the call\nThe source invoice's status becomes `Closed` (2) once fully paid. Verify via **πŸ” Search & Retrieve β€Ί Get Document by GUID**.", "item": [ { "name": "Existing Customer - simple cash receipt", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 2,\r\n \"Subject\": \"Payment received\",\r\n \"Currency\": \"ILS\",\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Payments\": [\r\n {\r\n \"Date\": \"{{CurrentMsDate}}\",\r\n \"Amount\": 100,\r\n \"PaymentType\": 4\r\n }\r\n ],\r\n \"AssociatedEmails\": [\r\n { \"Mail\": \"client@acme.test\", \"IsUserMail\": false }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Cash receipt for an existing customer. `{{CurrentMsDate}}` is generated by the collection pre-request script in the `/Date(ms+0200)/` format expected by the API." }, "response": [] }, { "name": "Walk-in (one-time) Customer - split cash + credit card", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"GeneralCustomer\": {\r\n \"Name\": \"Walk-in customer\",\r\n \"Identifier\": \"034698857\"\r\n },\r\n \"DocumentType\": 2,\r\n \"Subject\": \"Cash payment\",\r\n \"Currency\": \"ILS\",\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 1, \"PaymentType\": 4 },\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 2, \"PaymentType\": 1 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Same as above, but for a walk-in / non-persistent customer." }, "response": [] }, { "name": "Donation Receipt (NGOs / Section 46 only)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 2,\r\n \"IsDonation\": true,\r\n \"Subject\": \"Donation – thank you!\",\r\n \"Currency\": \"ILS\",\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 1, \"PaymentType\": 4 },\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 2, \"PaymentType\": 2, \"PaymentNumber\": \"12345\" }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "`IsDonation:true` flags the receipt as a tax-deductible donation receipt (Χ§Χ‘ΧœΧ” לΧͺΧ¨Χ•ΧžΧ”). Only usable by organisations approved as Section 46 (Χ‘Χ’Χ™Χ£ 46) institutions." }, "response": [] }, { "name": "Settle an existing Invoice (DocumentReffType=1)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 2,\r\n \"DocumentReffType\": 1,\r\n \"Subject\": \"Receipt for invoice\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Invoices\": [\r\n {\r\n \"ID\": \"REPLACE-WITH-INVOICE-GUID\",\r\n \"DocumentType\": 1,\r\n \"Total\": 117,\r\n \"ReceiptAmount\": 117\r\n }\r\n ],\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 117, \"PaymentType\": 3 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Closes one or more existing invoices. Set each entry under `Invoices` with the invoice `ID` (GUID), its `DocumentType` (`1` = Invoice) and the amount being settled (`ReceiptAmount`)." }, "response": [] }, { "name": "Cancel an existing Receipt (DocumentReffType=2)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 2,\r\n \"DocumentReffType\": 2,\r\n \"Subject\": \"Receipt cancellation\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"CancelDocument\": true,\r\n \"Total\": -20,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Invoices\": [\r\n { \"ID\": \"REPLACE-WITH-RECEIPT-GUID\", \"DocumentType\": 2 }\r\n ],\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": -20, \"PaymentType\": 3 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Issues a negative receipt that cancels an existing one. Amounts and `Total` must be negative; reference the original receipt under `Invoices`." }, "response": [] }, { "name": "Split payment - cash + credit card + Bit", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 2,\r\n \"Subject\": \"Split payment\",\r\n \"Currency\": \"ILS\",\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 30, \"PaymentType\": 4 },\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 40, \"PaymentType\": 1 },\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 30, \"PaymentType\": 8 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Receipt split between cash (4), credit card (1) and Bit (8)." }, "response": [] }, { "name": "Receipt with withholding tax (Deduction at source)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 2,\r\n \"Subject\": \"Payment minus withholding\",\r\n \"Currency\": \"ILS\",\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 98.8, \"PaymentType\": 4 }\r\n ],\r\n \"Deduction\": 1.2\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "`Deduction` is the amount the customer withheld at source (Χ Χ™Χ›Χ•Χ™ Χ‘ΧžΧ§Χ•Χ¨). The receipt totals to `Payments.Amount + Deduction`." }, "response": [] } ] }, { "name": "πŸ§ΎπŸ’° Invoice Receipt (Type 3)", "description": "## Invoice-Receipt (Χ—Χ©Χ‘Χ•Χ Χ™Χͺ מב/Χ§Χ‘ΧœΧ”) – `DocumentType = 3`\n\nA combined invoice + receipt in one document. Use this when the customer pays at the moment of sale, so you don't need to issue a separate invoice and receipt.\n\n### When to use it\n- Point-of-sale: customer buys and pays in one action.\n- Online checkout after successful clearing (`ProcessApiRequestV2` succeeded and you want a single accounting document).\n- Closing a Proforma/Order/Quote/Delivery Note where payment is captured at the same time.\n\n### Required fields\n- `ClientID` (or `GeneralCustomer`).\n- `DocumentType = 3`.\n- `Items[]` – the goods/services being sold.\n- `Payments[]` – how the customer paid.\n- `Currency` and `TaxIncluded`.\n\n### The one hard rule\nSum of `Payments[].Amount` (+ `Deduction`) **must equal** the items total after discount and VAT. Mismatches return `PaymentAmountDoesntMatchItemsAmount` (error 56). If you set `AutoFixPaymentsMismatchItems = true` the server will insert a small correction line for Β±0.01 rounding drift; larger drifts still fail.\n\n### Optional\n- `Discount`, `AssociatedEmails[]`, `ApiIdentifier` – same semantics as a plain Invoice.\n- `DocumentReffType` + `Invoices[]` – set when converting from Proforma (5), Order (6), Quote (7) or Delivery Note (8).\n\n### Common pitfalls\n- Do not use Type 3 to settle a previously issued Type 1 invoice – issue a Receipt (Type 2) against it instead.\n- For split payments, each entry in `Payments[]` needs its own `PaymentType` and type-specific fields.\n\n### After the call\nSingle document created with both invoice and receipt numbers. It is immediately status `Closed` (2).", "item": [ { "name": "Existing Customer - combined invoice + receipt", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 3,\r\n \"Subject\": \"Service + payment\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 100, \"PaymentType\": 4 }\r\n ],\r\n \"AssociatedEmails\": [\r\n { \"Mail\": \"client@acme.test\", \"IsUserMail\": false }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Standard invoice-receipt for an existing customer." }, "response": [] }, { "name": "Existing Customer - combined doc with flat pre-tax discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 3,\r\n \"Subject\": \"Service + payment, 10 ILS off\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Discount\": {\r\n \"Value\": 10,\r\n \"IsNominal\": true,\r\n \"BeforeTax\": true\r\n },\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 88.2, \"PaymentType\": 4 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Same as above but applies a 10β‚ͺ flat pre-tax discount. The payment total reflects the post-discount value." }, "response": [] }, { "name": "Walk-in (one-time) Customer - combined invoice + receipt", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"GeneralCustomer\": {\r\n \"Name\": \"Walk-in customer\",\r\n \"Identifier\": \"034698857\"\r\n },\r\n \"DocumentType\": 3,\r\n \"Subject\": \"Walk-in sale\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Product\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 100, \"PaymentType\": 4 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Combined invoice-receipt for a walk-in (one-time) customer." }, "response": [] }, { "name": "Existing Customer - split payment (cash + credit card + Bit)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 3,\r\n \"Subject\": \"Service + split payment\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Payments\": [\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 30, \"PaymentType\": 4 },\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 40, \"PaymentType\": 1 },\r\n { \"Date\": \"{{CurrentMsDate}}\", \"Amount\": 30, \"PaymentType\": 8 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Single invoice-receipt whose 100 ILS total is split across cash (PaymentType=4), credit card (1) and Bit (8). The sum of `Payments[].Amount` must equal the items total." }, "response": [] } ] }, { "name": "↩️ Credit Invoice (Type 4)", "description": "## Credit Invoice (Χ—Χ©Χ‘Χ•Χ Χ™Χͺ Χ–Χ™Χ›Χ•Χ™) – `DocumentType = 4`\n\nA credit invoice **reverses or reduces** a previously issued Invoice (Type 1) or Invoice-Receipt (Type 3). It is a legally distinct accounting document – you never edit or delete the original; instead you issue a credit that offsets it.\n\n### When to use it\n- **Full refund** – the customer is being refunded the entire amount of an invoice.\n- **Partial refund** – only part of the original invoice is being reversed (specific line items, wrong quantity, wrong price).\n- **Correction** – the original invoice was issued with wrong details and needs to be voided so a corrected invoice can be issued.\n- **Bad debt / write-off** – you no longer expect to collect the invoice.\n\n### How to build the request\n1. **Pick the source document.** You need its `Guid` (the value returned as `ID` when it was created, or fetched via `GetDocumentByApiIdentifier` / `GetDocumentByGuid`).\n2. **Set `DocumentType = 4`** on the outer document.\n3. **Set `DocumentReffType` to match the source type** – this is the #1 source of `DocumentReffTypeNotInRange` (error 53) errors:\n - Source is an **Invoice (Type 1)** β‡’ `DocumentReffType = 1`\n - Source is an **Invoice-Receipt (Type 3)** β‡’ `DocumentReffType = 3`\n - Any other value will be rejected.\n4. **List the source document(s) under `Invoices[]`.** Each entry needs `ID` (GUID), `DocumentType` (matching `DocumentReffType`), `ClientID`, `Total` (of the source), and `ReceiptAmount` (how much of it you are crediting now).\n5. **Set `Total` and `CreditAmount`** on the outer document to the amount actually being credited. They must be equal, and their sum across all past credits cannot exceed the source `Total` (else `CreditAmountExceedsTotal`, error 155).\n6. **Add `Items[]` only for a partial credit.** For a full credit against a single invoice you can omit `Items` and the server will credit the full source amount. For a partial credit, list the exact refunded lines so the PDF shows what is being reversed.\n\n### Rules the API will enforce\n- The source document must belong to the same organisation and the same `ClientID` (or use a `GeneralCustomer`).\n- The source document status must **not** already be `FullyCredited` (3). Partially-credited sources are fine as long as `CreditAmount` doesn't exceed the remaining balance.\n- `Invoices[]` is **required** – a credit invoice with no `Invoices`, no `Payments` and no `Items` returns `InvoiceCreditMustHaveRefDocuments` (error 57).\n- `ApiIdentifier` (a GUID you generate) makes the call idempotent – re-sending the same identifier returns the existing credit instead of duplicating it. Highly recommended for retry logic.\n\n### After the call\nThe source document's status becomes `PartiallyCredited` (4) or `FullyCredited` (3) automatically. You can verify with **πŸ” Search & Retrieve β€Ί Get Document by GUID**.", "item": [ { "name": "Full credit of a Tax Invoice (Type 1 source)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 4,\r\n \"DocumentReffType\": 1,\r\n \"Subject\": \"Full credit for invoice\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Total\": 100,\r\n \"CreditAmount\": 100,\r\n \"Invoices\": [\r\n {\r\n \"ID\": \"REPLACE-WITH-INVOICE-GUID\",\r\n \"DocumentType\": 1,\r\n \"Total\": 100,\r\n \"ReceiptAmount\": 100,\r\n \"ClientID\": {{ClientID}}\r\n }\r\n ],\r\n \"AssociatedEmails\": [\r\n { \"Mail\": \"client@acme.test\", \"IsUserMail\": false }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "**Scenario:** the customer returned everything on a Tax Invoice (Type 1) and you need to refund the full amount.\n\n**What to change before running:**\n- `REPLACE-WITH-INVOICE-GUID` β†’ the `ID` (GUID) of the source invoice, e.g. `\"a1b2c3d4-...\".\n- `Total`, `CreditAmount`, `Invoices[0].Total`, `Invoices[0].ReceiptAmount` – set them all to the same amount you are refunding (the source invoice's `Total`).\n\n**Why `DocumentReffType = 1`?** The source is a Type 1 invoice, so the reference type must also be `1`. Mismatching this returns `DocumentReffTypeNotInRange` (error 53).\n\n**Result:** the source invoice moves to status `FullyCredited` (3)." }, "response": [] }, { "name": "Partial credit of a Tax Invoice (refund specific line items)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 4,\r\n \"DocumentReffType\": 1,\r\n \"Subject\": \"Partial credit - refund service hour\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Total\": 50,\r\n \"CreditAmount\": 50,\r\n \"Items\": [\r\n { \"Code\": \"REFUND-01\", \"Name\": \"Refund - service hour\", \"Quantity\": 1, \"Price\": 50 }\r\n ],\r\n \"Invoices\": [\r\n {\r\n \"ID\": \"REPLACE-WITH-INVOICE-GUID\",\r\n \"DocumentType\": 1,\r\n \"Total\": 100,\r\n \"ReceiptAmount\": 50,\r\n \"ClientID\": {{ClientID}}\r\n }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "**Scenario:** the original invoice was 100 ILS across multiple lines, and you are refunding only one 50 ILS line item.\n\n**What to change before running:**\n- `REPLACE-WITH-INVOICE-GUID` β†’ the source invoice GUID.\n- `Items[]` β†’ list the specific refunded lines. These appear on the credit PDF, so keep names/codes recognisable to the customer.\n- `Invoices[0].Total` β†’ the source invoice's *full* total (e.g. `100`).\n- `Invoices[0].ReceiptAmount`, outer `Total`, outer `CreditAmount` β†’ the *partial* amount being refunded now (e.g. `50`). All three must match.\n\n**Result:** the source invoice moves to status `PartiallyCredited` (4). You can issue additional credits against the same source until its remaining balance reaches zero – at that point it becomes `FullyCredited` (3). Exceeding the remaining balance returns `CreditAmountExceedsTotal` (error 155)." }, "response": [] }, { "name": "Full credit of an Invoice-Receipt (Type 3 source)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 4,\r\n \"DocumentReffType\": 3,\r\n \"Subject\": \"Full credit for invoice-receipt\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Total\": 120,\r\n \"CreditAmount\": 120,\r\n \"Invoices\": [\r\n {\r\n \"ID\": \"REPLACE-WITH-INVOICE-RECEIPT-GUID\",\r\n \"DocumentType\": 3,\r\n \"Total\": 120,\r\n \"ReceiptAmount\": 120,\r\n \"ClientID\": {{ClientID}}\r\n }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "**Scenario:** the source document is an Invoice-Receipt (Type 3, Χ—Χ©Χ‘Χ•Χ Χ™Χͺ מב/Χ§Χ‘ΧœΧ”) – meaning the customer already paid. You are issuing a credit to reverse both the invoice and the receipt in one document.\n\n**Key difference from Type 1 credits:** you must set both `DocumentReffType = 3` on the outer document **and** `Invoices[0].DocumentType = 3`. Using `1` (which is a common copy-paste from the tax-invoice example) will fail with `DocumentReffTypeNotInRange` (error 53) or `ReceiptDocumentReffTypeDoesntMatchInvoiceDocumentType` (error 54).\n\n**What to change before running:**\n- `REPLACE-WITH-INVOICE-RECEIPT-GUID` β†’ the GUID of the Type 3 source.\n- Amounts β†’ set `Total`, `CreditAmount`, `Invoices[0].Total`, `Invoices[0].ReceiptAmount` to the source's `Total`.\n\n**Note on the refund itself:** this API call issues the credit *document*. If the original payment was collected via credit-card clearing and you also need to refund the money, use **πŸ’³ Clearing & Payments β€Ί ↩️ Refund a previously charged transaction** in addition to this call." }, "response": [] }, { "name": "Credit multiple source Invoices in a single credit document", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 4,\r\n \"DocumentReffType\": 1,\r\n \"Subject\": \"Consolidated credit for two invoices\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Total\": 180,\r\n \"CreditAmount\": 180,\r\n \"Invoices\": [\r\n {\r\n \"ID\": \"REPLACE-WITH-FIRST-INVOICE-GUID\",\r\n \"DocumentType\": 1,\r\n \"Total\": 100,\r\n \"ReceiptAmount\": 100,\r\n \"ClientID\": {{ClientID}}\r\n },\r\n {\r\n \"ID\": \"REPLACE-WITH-SECOND-INVOICE-GUID\",\r\n \"DocumentType\": 1,\r\n \"Total\": 80,\r\n \"ReceiptAmount\": 80,\r\n \"ClientID\": {{ClientID}}\r\n }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "**Scenario:** the customer is being refunded for two Tax Invoices at once – e.g. a 100 ILS invoice and an 80 ILS invoice, refunded together as a single 180 ILS credit.\n\n**What to change before running:**\n- Replace both `REPLACE-WITH-*-INVOICE-GUID` values with real source GUIDs.\n- Each `Invoices[]` entry must reference the **same** `ClientID` – you cannot credit different customers in one document.\n- All sources here are Type 1, so `DocumentReffType = 1` and every `Invoices[].DocumentType = 1`. To credit a mixed batch (some Type 1, some Type 3) issue separate credit documents – the reference type is a single value per document.\n- Outer `Total` / `CreditAmount` = sum of all `Invoices[].ReceiptAmount`.\n\n**Result:** each source invoice's status is updated independently based on how much of its total was credited in this call." }, "response": [] } ] }, { "name": "πŸ“‹ Proforma Invoice (Type 5)", "description": "## Proforma Invoice (Χ—Χ©Χ‘Χ•ΧŸ Χ’Χ‘Χ§Χ”) – `DocumentType = 5`\n\nA proforma is a **non-binding** statement of what will be invoiced. It doesn't book VAT and doesn't create a receivable, but it's a document the customer can pay against.\n\n### When to use it\n- Pre-billing before delivery – the customer needs a document to trigger a purchase order or payment on their side.\n- Advance-payment collection: issue a proforma, take payment via a Receipt (Type 2) with `DocumentReffType = 5`, and later convert into a Tax Invoice (Type 1).\n- Government / municipal customers that only pay against a `Χ—Χ©Χ‘Χ•ΧŸ Χ’Χ‘Χ§Χ”`.\n\n### Required fields\n- `ClientID` (or `GeneralCustomer`).\n- `DocumentType = 5`.\n- `Items[]`, `Currency`, `TaxIncluded`.\n\n### Optional\n- `Discount`, `PaymentDueDate` (used for the customer-side due-date reminder), `AssociatedEmails[]`, `ApiIdentifier`.\n\n### Common pitfalls\n- A proforma is **not** a tax invoice – the Israeli tax authority does not recognise it as a taxable event. You must eventually issue a Tax Invoice or Invoice-Receipt.\n- Do not send `Payments[]` on the proforma itself – attach payments to a subsequent Receipt (Type 2) referencing this proforma.\n\n### After the call\nThe proforma is created with status `Open` (1) and can be referenced from a later Receipt or Invoice-Receipt via `DocumentReffType = 5`.", "item": [ { "name": "Existing Customer - simple proforma", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 5,\r\n \"Subject\": \"Proforma\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Simple proforma." }, "response": [] }, { "name": "Existing Customer - proforma with flat pre-tax discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 5,\r\n \"Subject\": \"Proforma with discount\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Discount\": { \"Value\": 10, \"IsNominal\": true, \"BeforeTax\": true }\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "10β‚ͺ off, applied pre-VAT." }, "response": [] } ] }, { "name": "πŸ“¦ Order (Type 6)", "description": "## Sales Order (Χ”Χ–ΧžΧ Χ”) – `DocumentType = 6`\n\nInternal / customer-facing document representing goods or services **committed to be delivered**. Not a taxable event by itself.\n\n### When to use it\n- Customer has approved a quote and you want a formal order record before shipping / performing the work.\n- Fulfilment workflows where an Order is created first and then converted into a Delivery Note (Type 8) and finally an Invoice (Type 1) or Invoice-Receipt (Type 3).\n\n### Required fields\n- `ClientID` (or `GeneralCustomer`).\n- `DocumentType = 6`.\n- `Items[]`, `Currency`, `TaxIncluded`.\n\n### Converting from a Quote\n- An Order can be created from a Quote (Type 7) by setting `DocumentReffType = 7` and listing the source under `Invoices[]`. This is the **only** valid reference for an Order – other reference types return `DocumentReffTypeNotInRange` (error 53).\n\n### Common pitfalls\n- Orders are not accounting documents. Reports (VAT, income) won't include them until they are converted to a Tax Invoice or Invoice-Receipt.\n- Don't attach `Payments[]` – handle payment on the resulting Invoice/Receipt.\n\n### After the call\nOrder created with status `Open` (1). Reference it from a later Delivery Note, Invoice, or Invoice-Receipt to keep the fulfilment chain linked.", "item": [ { "name": "Existing Customer - simple order", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 6,\r\n \"Subject\": \"Order\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Product\", \"Quantity\": 1, \"Price\": 100 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Single-line order for an existing customer." }, "response": [] }, { "name": "Existing Customer - order with flat pre-tax discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 6,\r\n \"Subject\": \"Order with discount\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Product\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Discount\": { \"Value\": 10, \"IsNominal\": true, \"BeforeTax\": true }\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Order with a flat 10β‚ͺ pre-tax discount." }, "response": [] } ] }, { "name": "πŸ’¬ Quote / Price Offer (Type 7)", "description": "## Price Quote (Χ”Χ¦Χ’Χͺ ΧžΧ—Χ™Χ¨) – `DocumentType = 7`\n\nA proposal you send to a prospect. Nothing is booked accounting-wise; the document exists to be approved (or declined).\n\n### When to use it\n- Pre-sale proposal that the customer needs to see before committing.\n- Feeding a downstream Order (Type 6), Invoice (Type 1), or Invoice-Receipt (Type 3) once approved.\n\n### Required fields\n- `ClientID` (or `GeneralCustomer`).\n- `DocumentType = 7`.\n- `Items[]`, `Currency`, `TaxIncluded`.\n\n### Optional\n- `PaymentDueDate` – shown to the customer as the quote's validity date.\n- `Discount`, `AssociatedEmails[]`, `ApiIdentifier`.\n\n### Converting a Quote\nA Quote is a valid reference for **Invoice (1)**, **Invoice-Receipt (3)** and **Order (6)** creations – set `DocumentReffType = 7` on the target and list the quote GUID under `Invoices[]`. The quote's status will update accordingly.\n\n### Common pitfalls\n- No `Payments[]`, no `Deduction` – a quote is purely informational.\n- Editing a quote is not supported – to correct it, use **πŸ“§ Distribution & Actions β€Ί Change Document Status** to cancel and issue a new one.\n\n### After the call\nQuote created with status `Open` (1). Send it to the customer via **πŸ“§ Distribution & Actions β€Ί Send Document by Email**.", "item": [ { "name": "Existing Customer - simple quote", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 7,\r\n \"Subject\": \"Quote\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Simple quote." }, "response": [] }, { "name": "Existing Customer - quote with flat pre-tax discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 7,\r\n \"Subject\": \"Quote with discount\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Service\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Discount\": { \"Value\": 10, \"IsNominal\": true, \"BeforeTax\": true }\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Quote with 10β‚ͺ flat pre-tax discount." }, "response": [] } ] }, { "name": "🚚 Delivery Note (Type 8)", "description": "## Delivery Note (ΧͺΧ’Χ•Χ“Χͺ ΧžΧ©ΧœΧ•Χ—) – `DocumentType = 8`\n\nAccompanies a physical shipment of goods. Not a taxable event – it records **what left the warehouse and when**.\n\n### When to use it\n- Shipping physical goods that will be invoiced later.\n- Fulfilling an approved Order (Type 6) – the resulting Invoice or Invoice-Receipt can then reference the delivery note.\n\n### Required fields\n- `ClientID` (or `GeneralCustomer`) – must include a shipping address on the customer record.\n- `DocumentType = 8`.\n- `Items[]` with quantities that reflect what is physically shipped.\n- `Currency`, `TaxIncluded` (kept for consistency even though no VAT is booked).\n\n### Shipping-specific fields\n- `DepartureHour` (0–23) and `DepartureMinute` (0–59) – time the shipment leaves.\n- The source Order can be referenced by setting `DocumentReffType = 6` and listing it under `Invoices[]` (the only valid reference type for a Delivery Note).\n\n### Common pitfalls\n- Delivery notes don't book revenue. Always issue an Invoice (Type 1) or Invoice-Receipt (Type 3) afterwards for accounting.\n- Items on the delivery note should match the physical shipment quantity, which may be less than the ordered quantity for partial fulfilment.\n\n### After the call\nDelivery note created with status `Open` (1). Reference it from a later Invoice / Invoice-Receipt so the fulfilment chain (Order β†’ Delivery Note β†’ Invoice) stays linked.", "item": [ { "name": "Existing Customer - delivery note with departure time", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 8,\r\n \"Subject\": \"Delivery\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"DepartureHour\": 21,\r\n \"DepartureMinute\": 29,\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Boxed product\", \"Quantity\": 1, \"Price\": 100 }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Delivery note with a departure time of 21:29." }, "response": [] }, { "name": "Existing Customer - delivery note with flat pre-tax discount", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ClientID\": {{ClientID}},\r\n \"DocumentType\": 8,\r\n \"Subject\": \"Delivery with discount\",\r\n \"Currency\": \"ILS\",\r\n \"TaxIncluded\": true,\r\n \"ApiIdentifier\": \"{{$guid}}\",\r\n \"DepartureHour\": 21,\r\n \"DepartureMinute\": 29,\r\n \"Items\": [\r\n { \"Code\": \"001\", \"Name\": \"Boxed product\", \"Quantity\": 1, \"Price\": 100 }\r\n ],\r\n \"Discount\": { \"Value\": 10, \"IsNominal\": true, \"BeforeTax\": true }\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/CreateDocumentWithIdentifierValidation", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "CreateDocumentWithIdentifierValidation" ] }, "description": "Delivery note with a 10β‚ͺ pre-tax discount." }, "response": [] } ] }, { "name": "πŸ” Search & Retrieve", "description": "## Search & Retrieve\n\nRead-only endpoints for finding documents after they've been created. Use these to reconcile your system with Invoice4u, fetch PDFs for archival, or verify idempotency.\n\n### Which lookup to use\n- **By `ApiIdentifier`** – the recommended integration pattern. If you saved a GUID as `ApiIdentifier` at creation time, this call returns the exact document (or an empty result if it never made it in). Enables safe retries.\n- **By GUID (`ID`)** – when you have the internal document GUID (returned in the creation response).\n- **By `Number`** – when the customer or accountant references a printed document number.\n- **By date range** – bulk pulls for reporting / reconciliation. Pageable, filterable by `DocumentType`.\n- **Get Document PDF** – returns the rendered PDF as a `byte[]` (base64 over JSON) for archival or re-sending.\n\n### Common pitfalls\n- Document GUIDs are **not** the same as customer GUIDs. Use `GetCustomerByGuid` for customers.\n- Date-range searches are inclusive on both ends; timezone is the organisation's local time (Asia/Jerusalem for Israeli accounts).\n- The PDF endpoint returns the current render – if you changed the document's status (e.g. cancelled it) the PDF reflects that.", "item": [ { "name": "Search Documents (date range)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"dr\": {\r\n \"DocumentType\": 1,\r\n \"From\": \"/Date(1583186400000+0200)/\",\r\n \"To\": \"{{CurrentMsDate}}\",\r\n \"DocumentNumber\": 0,\r\n \"ClientID\": null,\r\n \"FromAmount\": 0,\r\n \"ToAmount\": 10000\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetDocuments", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetDocuments" ] }, "description": "Searches documents of a given `DocumentType` within a date / amount range. Set fields to `null`/`0` to ignore them." }, "response": [] }, { "name": "Get Document by GUID", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"docId\": \"C76C28ED-2030-4D25-979C-7A132AEC0240\",\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetDocument", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetDocument" ] }, "description": "Returns the full document by its primary key (GUID)." }, "response": [] }, { "name": "Get Document by Number", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"docNumber\": 11075,\r\n \"documentType\": 1,\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetDocumentByNumber", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetDocumentByNumber" ] }, "description": "Resolves a document by the printed running number + its type." }, "response": [] }, { "name": "Get Document by API Identifier (REST)", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"apiIdentifier\": \"WC_CLR_8477\",\r\n \"docType\": 3,\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetDocumentByApiIdentifierREST", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetDocumentByApiIdentifierREST" ] }, "description": "Idempotency lookup: returns the document originally created with the supplied `ApiIdentifier` (e.g. `{{$guid}}`)." }, "response": [] }, { "name": "Get Document PDF (byte[])", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"docId\": \"3212770B-4200-4461-926E-3A169AB03361\",\r\n \"docNumber\": \"50029\",\r\n \"isOriginal\": true,\r\n \"isReCreate\": false,\r\n \"outerToken\": \"\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://newview.invoice4u.co.il/Services/PrintService.svc/GetDocument", "protocol": "https", "host": [ "newview", "invoice4u", "co", "il" ], "path": [ "Services", "PrintService.svc", "GetDocument" ] }, "description": "Renders the document PDF and returns it as a byte array. Note this hits the **PrintService**, not `ApiService`." }, "response": [] } ] }, { "name": "πŸ“§ Distribution & Actions", "description": "## Distribution & Actions\n\nOperations you run on documents **after** they've been created – sending them to the customer and changing their lifecycle state.\n\n### Send Document by Email\nDelivers the PDF to one or more recipients on the fly. Useful when the recipient list wasn't known at creation time or when re-sending after a bounce.\n- The document must already exist; supply its GUID.\n- Multiple `AssociatedEmails[]` addresses are supported.\n- The from-address and template are controlled by the organisation's settings, not per call.\n\n### Change Document Status\nMoves a document between valid states in `EDocumentStatus`:\n- `Open` (1), `Closed` (2), `FullyCredited` (3), `PartiallyCredited` (4), `Cancelled` (5).\n- Most transitions happen automatically (e.g. paying an invoice closes it, issuing a credit updates the source). Use this endpoint for the exceptions – typically cancelling a Quote / Order / Delivery Note that will never be fulfilled.\n- Cancelling an already-issued **Tax Invoice** or **Invoice-Receipt** is not allowed via status change – issue a Credit Invoice (Type 4) instead.\n\n### Common pitfalls\n- Changing status doesn't retroactively remove accounting entries – for a booked document you must credit it.\n- Email sending is asynchronous; a `200 OK` means the request was accepted, not that the recipient has received it. Check clearing / send logs for delivery status.", "item": [ { "name": "Send Document by Email", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"doc\": {\r\n \"ID\": \"REPLACE-WITH-DOC-GUID\",\r\n \"AssociatedEmails\": [\r\n { \"Mail\": \"client@acme.test\", \"IsUserMail\": false }\r\n ]\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/SendDocumentByMail", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "SendDocumentByMail" ] }, "description": "Re-sends an existing document to one or more recipients." }, "response": [] }, { "name": "Change Document Status", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"docs\": [\r\n {\r\n \"ID\": \"REPLACE-WITH-DOC-GUID\",\r\n \"DocumentType\": 1,\r\n \"StatusID\": 1\r\n }\r\n ],\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ChangeDocumentStatus", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ChangeDocumentStatus" ] }, "description": "Updates the workflow status of one or more documents. `StatusID` values correspond to the `EDocumentStatus` enum on the server." }, "response": [] } ] } ] }, { "name": "🏒 Branches", "description": "Branch lookup. Branches are used for multi-location organisations.", "item": [ { "name": "Get Branches", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetBranches", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetBranches" ] }, "description": "Returns all branches accessible to the authenticated user." }, "response": [] } ] }, { "name": "πŸ’³ Clearing & Payments", "description": "Credit-card and wallet clearing via `ProcessApiRequestV2`. All scenarios share the same envelope (`request: { ... }`) – the toggles `AddToken`, `AddTokenAndCharge`, `ChargeWithToken`, `Refund`, `IsStandingOrderClearance`, `IsBitPayment`, `IsGooglePay` and `IsApplePay` switch the behaviour.\n\n### Common fields\n- `Invoice4UUserApiKey` – set to `{{Invoice4u_ApiKey}}` (collection variable).\n- `Sum` – charge amount.\n- `PaymentsNum` – number of instalments (use `1` for a single charge).\n- `IsDocCreate:true` – automatically issue an InvoiceReceipt (Type 3) for the charge.\n- `CallBackUrl` / `ReturnUrl` – where the client is redirected once the hosted page completes.\n- `IsGeneralClient:true` + `IsAutoCreateCustomer:true` – auto-create a one-time customer from the client name.\n\n### Wallet payments (Bit / Google Pay / Apple Pay)\nEach wallet is enabled by a single boolean on the request – **exactly one** wallet flag per call:\n- `IsBitPayment:true` β†’ hosted page opens the Bit flow.\n- `IsGooglePay:true` β†’ hosted page opens the Google Pay sheet.\n- `IsApplePay:true` β†’ hosted page opens the Apple Pay sheet (Safari / iOS only).\n\nAll three require the wallet to be **enabled on your clearing account**. If it's not, the API returns `ApiBitNotAllowedForUser`, `ApiGooglePayNotAllowedForUser` (error 316) or `ApiApplePayNotAllowedForUser` (error 317). Contact support to enable a wallet before running these examples in production.\n\n### Split-tender payments (combining wallets on one order)\n`ProcessApiRequestV2` handles **one** payment method per call. To collect a single order total across multiple wallets (e.g. 60 ILS on card + 40 ILS on Bit), issue **one call per slice** and tie them together by reusing the same `OrderIdClientUsage` GUID – the server stores it as `ClearingTraceId`, so all slices show up under one trace when you query the clearing log. Set `IsDocCreate:true` only on the **last** slice (or on none, and issue a manual Invoice-Receipt afterwards) so you don't create one accounting document per slice.", "item": [ { "name": "πŸ’³ Credit Card – Regular Clearing", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Invoice4U Clearing\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocHeadline\": \"Document headline\",\r\n \"Comments\": \"Document comments\",\r\n \"IsManualDocCreationsWithParams\": \"false\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"IsItemsBase64Encoded\": \"false\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"AddToken\": \"false\",\r\n \"AddTokenAndCharge\": \"false\",\r\n \"ChargeWithToken\": \"false\",\r\n \"Refund\": \"false\",\r\n \"IsStandingOrderClearance\": \"false\",\r\n \"StandingOrderDuration\": \"0\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Generates a hosted-payment-page URL for a one-off credit-card charge. Pipe-separated `DocItem*` fields define the line items of the auto-created InvoiceReceipt." }, "response": [] }, { "name": "⚑ Charge with Bit", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Invoice4U Clearing – Bit\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocHeadline\": \"Document headline\",\r\n \"Comments\": \"Document comments\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"IsBitPayment\": true\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Same as regular clearing but `IsBitPayment:true` routes the hosted page through Bit. Requires Bit to be enabled on your clearing account – otherwise the API returns `ApiBitNotAllowedForUser`." }, "response": [] }, { "name": "πŸ…Ά Charge with Google Pay", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Invoice4U Clearing – Google Pay\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocHeadline\": \"Document headline\",\r\n \"Comments\": \"Document comments\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"IsGooglePay\": true\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Same envelope as regular clearing – `IsGooglePay:true` routes the hosted page through Google Pay. Requires Google Pay to be enabled on your clearing account (otherwise the API returns `ApiGooglePayNotAllowedForUser`, error 316). Do **not** set `IsBitPayment` or `IsApplePay` alongside it – one wallet flag per call." }, "response": [] }, { "name": "πŸ…° Charge with Apple Pay", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Invoice4U Clearing – Apple Pay\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocHeadline\": \"Document headline\",\r\n \"Comments\": \"Document comments\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"IsApplePay\": true\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Same envelope as regular clearing – `IsApplePay:true` routes the hosted page through Apple Pay. Requires Apple Pay to be enabled on your clearing account (otherwise the API returns `ApiApplePayNotAllowedForUser`, error 317). Apple Pay only renders on Safari / iOS; on other browsers the hosted page will fall back to the standard card form. Do **not** set `IsBitPayment` or `IsGooglePay` alongside it – one wallet flag per call." }, "response": [] }, { "name": "πŸ”— Split-tender – Card + Bit (2 slices, shared OrderIdClientUsage)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"60\",\r\n \"Description\": \"Order #ACME-1001 – card slice (60 of 100 ILS)\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"SHARED-ORDER-GUID-REPLACE-ME\",\r\n \"IsDocCreate\": \"false\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "**Scenario:** the customer wants to pay a single 100 ILS order in two parts – 60 ILS on a credit card and 40 ILS on Bit.\n\n**How to run:**\n1. Generate one GUID and use it as `OrderIdClientUsage` in **both** slices – replace `SHARED-ORDER-GUID-REPLACE-ME` with that GUID. This ties the slices together in the clearing log via `ClearingTraceId`.\n2. Send this request first (card slice, `Sum:60`, `IsDocCreate:false`).\n3. Duplicate the request, change `Sum` to `40`, add `\"IsBitPayment\": true`, and set `IsDocCreate:true` on that last slice so a single Invoice-Receipt is issued for the full 100 ILS.\n\n**Notes:**\n- Only one wallet flag per call – for a card slice, leave all `Is*Pay` flags out.\n- Each slice returns its own `PaymentId` / clearing log row. Use **πŸ” Search Clearing Logs** with `OrderIdClientUsage` to reconcile.\n- If any slice fails, refund the successful ones via the ↩️ Refund request (same `OrderIdClientUsage`)." }, "response": [] }, { "name": "πŸ”— Split-tender – Card + Bit + Google Pay (3 slices)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"50\",\r\n \"Description\": \"Order #ACME-1002 – card slice (50 of 120 ILS)\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"SHARED-ORDER-GUID-REPLACE-ME\",\r\n \"IsDocCreate\": \"false\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "**Scenario:** a single 120 ILS order paid across three wallets – 50 ILS on a card, 40 ILS on Bit, 30 ILS on Google Pay. This request is **slice 1 of 3** (the card slice).\n\n**How to run:**\n1. Generate one GUID and use it as `OrderIdClientUsage` on **all three** slices – replace `SHARED-ORDER-GUID-REPLACE-ME`.\n2. Send this request as-is (`Sum:50`, no wallet flag = card).\n3. Duplicate + edit for slice 2: `Sum:40`, add `\"IsBitPayment\": true`.\n4. Duplicate + edit for slice 3: `Sum:30`, add `\"IsGooglePay\": true`, and set `\"IsDocCreate\": \"true\"` so a single Invoice-Receipt is issued for the full 120 ILS at the end. You could just as easily swap Google Pay for Apple Pay (`\"IsApplePay\": true`) on the last slice.\n\n**Notes:**\n- Never send more than one `Is*Pay` flag on the same call – the API will still accept the request, but the routing rules (Bit > Apple Pay > Google Pay) mean only one wallet actually clears. Split them across separate calls instead.\n- Slice totals must sum to your true order total. There's no server-side validation across slices – reconciliation is your responsibility via `OrderIdClientUsage`.\n- Each wallet must be enabled on your clearing account, otherwise the failing slice returns its own `ApiBitNotAllowedForUser` / `ApiGooglePayNotAllowedForUser` / `ApiApplePayNotAllowedForUser` error and the other slices are still committed." }, "response": [] }, { "name": "🎟️ Add Token (no charge)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Tokenisation\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"CallBackUrl\": \"https://webhook.site/123153\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"AddToken\": true,\r\n \"AddTokenAndCharge\": \"false\",\r\n \"ChargeWithToken\": \"false\",\r\n \"Refund\": \"false\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Tokenisation only – the customer's card is verified and stored as a token for future use; no money is captured." }, "response": [] }, { "name": "πŸ” Charge with Existing Token", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"2\",\r\n \"Description\": \"Recurring charge\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocumentHeadline\": \"Document headline\",\r\n \"Comments\": \"Document comments\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"ChargeWithToken\": \"true\",\r\n \"AddToken\": \"false\",\r\n \"AddTokenAndCharge\": \"false\",\r\n \"Refund\": \"false\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Charges a previously-tokenised customer **without** showing a hosted page. The token is resolved server-side from the customer details." }, "response": [] }, { "name": "βž• Add Token and Charge", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"First charge + tokenise\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocumentHeadline\": \"Document headline\",\r\n \"Comments\": \"Document comments\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"ChargeWithToken\": \"false\",\r\n \"AddToken\": \"true\",\r\n \"AddTokenAndCharge\": \"true\",\r\n \"Refund\": \"false\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Captures money **and** stores the token in the same hosted-page session." }, "response": [] }, { "name": "πŸ”„ Recurring Billing – 12 months", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Monthly subscription\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocumentHeadline\": \"Subscription\",\r\n \"Comments\": \"Monthly\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"ChargeWithToken\": \"false\",\r\n \"AddToken\": \"true\",\r\n \"AddTokenAndCharge\": \"false\",\r\n \"Refund\": \"false\",\r\n \"IsStandingOrderClearance\": \"true\",\r\n \"StandingOrderDuration\": \"12\",\r\n \"StandingOrderCallBackUrl\": \"https://mysitecallback.example.com/notify\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "Opens a 12-month standing order. The first charge fires immediately; subsequent charges are billed on the same day each month and notified to `StandingOrderCallBackUrl`." }, "response": [] }, { "name": "↩️ Refund", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"request\": {\r\n \"Invoice4UUserApiKey\": \"{{Invoice4u_ApiKey}}\",\r\n \"Type\": \"1\",\r\n \"CreditCardCompanyType\": \"1\",\r\n \"FullName\": \"Client Name\",\r\n \"Phone\": \"0500000000\",\r\n \"Email\": \"client@acme.test\",\r\n \"Sum\": \"1\",\r\n \"Description\": \"Refund of order #...\",\r\n \"PaymentsNum\": \"1\",\r\n \"Currency\": \"ILS\",\r\n \"OrderIdClientUsage\": \"{{$guid}}\",\r\n \"IsDocCreate\": \"true\",\r\n \"DocumentHeadline\": \"Refund\",\r\n \"Comments\": \"Refund\",\r\n \"DocItemQuantity\": \"1|1\",\r\n \"DocItemPrice\": \"10|10\",\r\n \"DocItemTaxRate\": \"17|17\",\r\n \"DocItemName\": \"first item|second item\",\r\n \"IsGeneralClient\": \"true\",\r\n \"IsAutoCreateCustomer\": \"true\",\r\n \"ReturnUrl\": \"https://www.invoice4u.co.il/\",\r\n \"ChargeWithToken\": \"false\",\r\n \"AddToken\": \"false\",\r\n \"AddTokenAndCharge\": \"false\",\r\n \"Refund\": \"true\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/ProcessApiRequestV2", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "ProcessApiRequestV2" ] }, "description": "`Refund:true` reverses a charge and (when `IsDocCreate:true`) issues a credit invoice." }, "response": [] }, { "name": "πŸ” Get Clearing Log by ID", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"clearingLogId\": 1711790,\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetClearingLogById", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetClearingLogById" ] }, "description": "Fetches a single clearing-log entry by its numeric ID." }, "response": [] }, { "name": "πŸ” Search Clearing Logs", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"searchParams\": {\r\n \"PaymentId\": 194179,\r\n \"FromAmount\": 0,\r\n \"ToAmount\": 200,\r\n \"IsSuccess\": true\r\n },\r\n \"token\": \"{{Invoice4u_ApiKey}}\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/GetClearingLogByParams", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "GetClearingLogByParams" ] }, "description": "Searches clearing logs by combination of `PaymentId`, amount range and success flag. All fields are optional." }, "response": [] } ] }, { "name": "πŸ‘€ User Registration", "description": "⚠️ **Restricted endpoint** – this is only available to a small number of partners (e.g. resellers provisioning sub-accounts). Most integrations should **not** need this. Kept here as a template only.", "item": [ { "name": "User Registration API (template)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\r\n \"user\": {\r\n \"Email\": \"new-user@example.test\",\r\n \"UserPassword\": \"NewPass1234!\",\r\n \"FirstName\": \"Israel\",\r\n \"LastName\": \"Israeli\",\r\n \"Phone\": \"034444444\",\r\n \"Mobile\": \"0522222222\",\r\n \"CompanyName\": \"new-user-reg\",\r\n \"TaxRate\": \"17\",\r\n \"OrganizationUniqueId\": \"034693671\",\r\n \"BundleID\": \"23\",\r\n \"ApiActive\": \"true\",\r\n \"ApiKey\": \"\",\r\n \"IsFinishRegistration\": \"true\"\r\n },\r\n \"token\": \"\",\r\n \"uniqueToken\": \"\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseURL}}/Services/ApiService.svc/UserRegistrationApi", "host": [ "{{baseURL}}" ], "path": [ "Services", "ApiService.svc", "UserRegistrationApi" ] }, "description": "Provisions a new Invoice4u organisation. Both `token` and `uniqueToken` are partner-issued and must be supplied by Invoice4u – do **not** use this endpoint without coordinating with the Invoice4u team." }, "response": [] } ] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "// Populate {{CurrentMsDate}} with the current time formatted as Microsoft JSON Date", "// (e.g. \"/Date(1700000000000+0200)/\") - the format expected by Invoice4u for Date fields.", "var ms = Date.now();", "var tzMinutes = -new Date().getTimezoneOffset();", "var sign = tzMinutes >= 0 ? '+' : '-';", "var abs = Math.abs(tzMinutes);", "var tzStr = sign + String(Math.floor(abs / 60)).padStart(2, '0') + String(abs % 60).padStart(2, '0');", "pm.collectionVariables.set('CurrentMsDate', '/Date(' + ms + tzStr + ')/');" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "// Light sanity check shared across the collection.", "pm.test('Status is 2xx', function () {", " pm.expect(pm.response.code).to.be.within(200, 299);", "});" ] } } ], "variable": [ { "key": "baseURL", "value": "", "type": "default", "description": "Base URL of the Invoice4u API (e.g. https://api.invoice4u.co.il or http://localhost)." }, { "key": "Invoice4u_ApiKey", "value": "", "type": "default", "description": "Your Invoice4u API key. Sent as `token` on all business endpoints and as `Invoice4UUserApiKey` on clearing (`ProcessApiRequestV2`) endpoints. Email+password login is deprecated β€” it still works during the migration period, but migrate to the API key." }, { "key": "ClientID", "value": "", "type": "default", "description": "ID of an existing customer used by the document examples." }, { "key": "CurrentMsDate", "value": "", "type": "default", "description": "Auto-populated by the collection pre-request script with /Date(ms+0200)/ formatted current time." } ] }