### GET /websites/developer_wefact/invoice Source: https://developer.wefact.com/invoice/edit Retrieves a specific invoice or a list of invoices based on query parameters. The example output shows the details of a single retrieved invoice. ```APIDOC ## GET /websites/developer_wefact/invoice ### Description Retrieves detailed information for a specific invoice. ### Method GET ### Endpoint /websites/developer_wefact/invoice ### Parameters #### Query Parameters - **identifier** (integer) - Optional - The unique identifier of the invoice to retrieve. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **controller** (string) - The controller handling the request. - **action** (string) - The action performed by the controller. - **status** (string) - The status of the operation (e.g., "success"). - **date** (string) - The date and time of the response. - **invoice** (object) - An object containing the invoice details. - **Identifier** (integer) - The unique ID of the invoice. - **InvoiceCode** (string) - The code of the invoice. - **Debtor** (integer) - The ID of the debtor. - **DebtorCode** (string) - The code of the debtor. - **Status** (integer) - The status code of the invoice. - **Date** (string) - The date the invoice was issued. - **Term** (integer) - The payment term in days. - **PayBefore** (string) - The date before which payment is due. - **AmountExcl** (number) - The total amount excluding tax. - **AmountTax** (number) - The total tax amount. - **AmountIncl** (number) - The total amount including tax. - **AmountOutstanding** (number) - The outstanding amount. - **CompanyName** (string) - The name of the company issuing the invoice. - **Address** (string) - The address of the company. - **ZipCode** (string) - The zip code of the company. - **City** (string) - The city of the company. - **Country** (string) - The country of the company. - **EmailAddress** (string) - The email address for the company. - **LanguageCode** (string) - The language code for the invoice. - **Currency** (string) - The currency of the invoice. - **InvoiceLines** (array) - An array of invoice line items. - **Identifier** (integer) - The identifier of the invoice line. - **Date** (string) - The date of the invoice line. - **ProductCode** (string) - The product code for the line item. - **Description** (string) - The description of the line item. - **PriceExcl** (number) - The price excluding tax for the line item. - **TaxCode** (string) - The tax code applied to the line item. - **TaxPercentage** (number) - The tax percentage for the line item. - **Created** (string) - The creation date of the invoice. - **Modified** (string) - The last modified date of the invoice. #### Response Example ```json { "controller": "invoice", "action": "edit", "status": "success", "date": "2024-01-21T12:00:00+02:00", "invoice": { "Identifier": 1, "InvoiceCode": "[concept]0001", "Debtor": 2, "DebtorCode": "DB10001", "Status": 0, "Date": "2023-11-22", "Term": 30, "PayBefore": "2023-12-22", "AmountExcl": 206.68, "AmountTax": 43.40, "AmountIncl": 250.08, "AmountOutstanding": 250.08, "CompanyName": "Bedrijfsnaam", "Address": "Keizersgracht 100", "ZipCode": "1015 AA", "City": "Amsterdam", "Country": "NL", "EmailAddress": "info@example.com", "InvoiceLines": [ { "Identifier": 1, "Date": "2023-11-22", "ProductCode": "P0001", "Description": "Werkzaamheden gebaseerd op uurtarief", "PriceExcl": 100, "TaxCode": "V21", "TaxPercentage": 21 }, { "Identifier": 2, "Date": "2023-11-22", "ProductCode": "P0002", "Description": "Reiskosten à € 0,19 per km", "PriceExcl": 0.19, "TaxCode": "V21", "TaxPercentage": 21 } ], "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00", "LanguageCode": "nl_nl", "Currency": "EUR" } } ``` ``` -------------------------------- ### PHP - Product ophalen met ProductCode Source: https://developer.wefact.com/product/show Deze code toont hoe u productinformatie kunt ophalen met behulp van de 'show' actie van de 'product' controller. Het vereist een API-instantie en een array van parameters, waarbij 'ProductCode' een mogelijke invoer is. De uitvoer is een array met gedetailleerde productinformatie. ```php $parameters = [ "ProductCode" => "P0001" ]; $api->sendRequest('product', 'show', $parameters); ``` -------------------------------- ### Send Quote via Email (PHP) Source: https://developer.wefact.com/pricequote/sendbyemail Verstuurt een offerte per e-mail. Vereist een offerte 'Identifier' of 'PriceQuoteCode' als invoer. De functie retourneert een statusbericht en details van de verzonden offerte. ```php $parameters = [ "Identifier" => 1 ]; $api->sendRequest('pricequote', 'sendbyemail', $parameters); ``` -------------------------------- ### Invoice Part Payment Example Source: https://developer.wefact.com/invoice/partpayment__locale=nl_NL This section provides an example of a successful response when processing a part payment for an invoice. ```APIDOC ## POST /api/invoices/partpayment ### Description Processes a partial payment for a specified invoice. ### Method POST ### Endpoint /api/invoices/partpayment ### Parameters #### Query Parameters - **invoice_id** (integer) - Required - The ID of the invoice to process the part payment for. - **amount** (float) - Required - The amount to be paid as a part payment. ### Request Body This endpoint does not require a request body. ### Request Example (No request body example available) ### Response #### Success Response (200) - **controller** (string) - The controller handling the request. - **action** (string) - The action performed. - **status** (string) - The status of the operation (e.g., 'success'). - **date** (string) - The timestamp of the operation. - **success** (array) - An array of success messages. - **invoice** (object) - An object containing details of the processed invoice. - **Identifier** (integer) - **InvoiceCode** (string) - **Debtor** (integer) - **DebtorCode** (string) - **Status** (integer) - **SubStatus** (string) - **PaymentPausedEndDate** (string) - **PaymentPausedReason** (string) - **Date** (string) - **Term** (integer) - **PayBefore** (string) - **PaymentURL** (string) - **AmountExcl** (float) - **AmountTax** (float) - **AmountIncl** (float) - **AmountPaid** (float) - **AmountOutstanding** (float) - **Discount** (float) - **VatCalcMethod** (string) - **IgnoreDiscount** (string) - **ReferenceNumber** (string) - **CompanyName** (string) - **Initials** (string) - **SurName** (string) - **Sex** (string) - **Address** (string) - **ZipCode** (string) - **City** (string) - **Country** (string) - **EmailAddress** (string) - **ExtraClientContactId** (integer) - **InvoiceMethod** (integer) - **SentDate** (string) - **Sent** (integer) - **Reminders** (integer) - **ReminderDate** (string) - **Summations** (integer) - **SummationDate** (string) - **Authorisation** (string) - **PaymentMethod** (string) - **PayDate** (string) - **TransactionID** (string) - **LanguageCode** (string) - **Currency** (string) - **Description** (string) - **Comment** (string) - **InvoiceLines** (array) - Array of invoice line items. - Each invoice line object contains fields like Identifier, Date, Number, ProductCode, Description, PriceExcl, TaxCode, TaxPercentage, etc. - **Created** (string) - **Modified** (string) #### Response Example ```json { "controller": "invoice", "action": "partpayment", "status": "success", "date": "2024-01-21T12:00:00+02:00", "success": [ "Deelbetaling factuur F2024-0001 is verwerkt" ], "invoice": { "Identifier": 1, "InvoiceCode": "F2024-0001", "Debtor": 1, "DebtorCode": "DB10000", "Status": 3, "SubStatus": "", "PaymentPausedEndDate": "", "PaymentPausedReason": "", "Date": "2023-11-22", "Term": 14, "PayBefore": "2023-12-06", "PaymentURL": "https://www.mijnwefact.nl/betalen/?payment=F2024-0001&key=ad6be15c96d08ad343bf79ae7c21303c&wa=12345678", "AmountExcl": 229.64, "AmountTax": 48.22, "AmountIncl": 277.86, "AmountPaid": 25.00, "AmountOutstanding": 252.86, "Discount": 0, "VatCalcMethod": "excl", "IgnoreDiscount": "no", "ReferenceNumber": "", "CompanyName": "Jan Janssen B.V.", "Initials": "Jan", "SurName": "Janssen", "Sex": "m", "Address": "Keizersgracht 100", "ZipCode": "1015 AA", "City": "Amsterdam", "Country": "NL", "EmailAddress": "info@example.com", "ExtraClientContactId": 0, "InvoiceMethod": 0, "SentDate": "2024-01-01 00:00:00", "Sent": 1, "Reminders": 0, "ReminderDate": "", "Summations": 0, "SummationDate": "", "Authorisation": "no", "PaymentMethod": "wire", "PayDate": "", "TransactionID": "", "LanguageCode": "nl_nl", "Currency": "EUR", "Description": "", "Comment": "", "InvoiceLines": [ { "Identifier": 1, "Date": "2023-11-22", "Number": 2, "NumberSuffix": "", "ProductCode": "P0001", "Description": "Werkzaamheden gebaseerd op uurtarief", "PriceExcl": 100, "DiscountPercentage": 0, "DiscountPercentageType": "line", "TaxCode": "V21", "TaxPercentage": 21, "PeriodicID": 0, "Periods": 1, "Periodic": "", "StartDate": "", "EndDate": "", "StartPeriod": "", "EndPeriod": "" }, { "Identifier": 2, "Date": "2023-11-22", "Number": 155, "NumberSuffix": "km", "ProductCode": "P0002", "Description": "Reiskosten à € 0,19 per km", "PriceExcl": 0.19, "DiscountPercentage": 0, "DiscountPercentageType": "line", "TaxCode": "V21", "TaxPercentage": 21, "PeriodicID": 0, "Periods": 1, "Periodic": "", "StartDate": "", "EndDate": "", "StartPeriod": "", "EndPeriod": "" }, { "Identifier": 3, "Date": "2023-11-22", "Number": 1, "NumberSuffix": "", "ProductCode": "P0002", "Description": "Reiskosten à € 0,19 per km", "PriceExcl": 0.19, "DiscountPercentage": 0, "DiscountPercentageType": "line", "TaxCode": "V21", "TaxPercentage": 21, "PeriodicID": 0, "Periods": 1, "Periodic": "", "StartDate": "", "EndDate": "", "StartPeriod": "", "EndPeriod": "" } ], "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00" } } ``` ``` -------------------------------- ### Debtor API - Add Debtor Example Source: https://developer.wefact.com/debtor/add__locale=nl_BE This section provides an example of the response structure when adding a new debtor via the WeFact API. It details the fields and their expected values. ```APIDOC ## POST /api/debtors ### Description This endpoint is used to add a new debtor to the WeFact system. The response includes details of the newly created debtor. ### Method POST ### Endpoint /api/debtors ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body (Not detailed in the provided text, but would typically include debtor information) ### Request Example ```json { "debtor_data": "..." } ``` ### Response #### Success Response (200) - **controller** (string) - The controller responsible for the action. - **action** (string) - The action performed (e.g., 'add'). - **status** (string) - The status of the operation (e.g., 'success'). - **date** (string) - The date and time of the operation in ISO 8601 format. - **debtor** (object) - An object containing the details of the added debtor. - **Identifier** (integer) - Unique identifier for the debtor. - **DebtorCode** (string) - The code assigned to the debtor. - **CompanyName** (string) - The name of the company. - **CompanyNumber** (string) - The company registration number. - **TaxNumber** (string) - The tax identification number. - **Sex** (string) - The sex of the contact person (m/f). - **Initials** (string) - The initials of the contact person. - **SurName** (string) - The surname of the contact person. - **Address** (string) - The street and number of the address. - **ZipCode** (string) - The postal code. - **City** (string) - The city. - **Country** (string) - The country code (e.g., 'NL'). - **EmailAddress** (string) - The primary email address. - **PhoneNumber** (string) - The primary phone number. - **MobileNumber** (string) - The mobile phone number. - **FaxNumber** (string) - The fax number. - **Comment** (string) - Internal comments. - **InvoiceMethod** (string) - The method for sending invoices (e.g., '0' for email). - **DirectDebitApplyTo** (string) - Setting for direct debit. - **InvoiceAuthorisation** (string) - Invoice authorisation setting. - **MandateDate** (string) - Date of mandate. - **MandateID** (string) - Mandate identifier. - **AccountNumber** (string) - Bank account number. - **AccountIban** (string) - IBAN of the bank account. - **AccountBIC** (string) - BIC/SWIFT code of the bank account. - **AccountName** (string) - Name associated with the bank account. - **AccountBank** (string) - Name of the bank. - **AccountCity** (string) - City where the bank account is registered. - **Mailing** (string) - Whether to send mail. - **InvoiceTerm** (integer) - Default payment term in days. - **PeriodicInvoiceDays** (integer) - Setting for periodic invoices. - **PaymentMail** (integer) - Setting for payment reminders. - **LanguageCode** (string) - The language code for communication (e.g., 'nl_nl'). - **Currency** (string) - The default currency (e.g., 'EUR'). - **CustomTaxCode** (string) - Custom tax code. - **ReminderEmailAddress** (string) - Email address for reminders. - **Groups** (array) - Array of groups the debtor belongs to. - **id** (integer) - Group identifier. - **GroupName** (string) - Name of the group. - **Created** (string) - Date and time the debtor was created. - **Modified** (string) - Date and time the debtor was last modified. - **DefaultBillingContactId** (integer) - ID of the default billing contact. - **DefaultQuoteContactId** (integer) - ID of the default quote contact. - **ExtraClientContacts** (array) - Array of extra client contacts. - **InvoiceDataForPriceQuote** (string) - Setting for invoice data for price quotes. - **InvoiceCompanyName** (string) - Company name for invoicing. - **InvoiceSex** (string) - Sex for invoicing contact. - **InvoiceInitials** (string) - Initials for invoicing contact. - **InvoiceSurName** (string) - Surname for invoicing contact. - **InvoiceAddress** (string) - Address for invoicing. - **InvoiceZipCode** (string) - Zip code for invoicing. - **InvoiceCity** (string) - City for invoicing. - **InvoiceCountry** (string) - Country for invoicing. - **InvoiceEmailAddress** (string) - Email address for invoicing. - **Translations** (object) - Translation of certain fields. - **Country** (string) - Translated country name. - **InvoiceMethod** (string) - Translated invoice method. - **LanguageLabel** (string) - Translated language label. #### Response Example ```json { "controller": "debtor", "action": "add", "status": "success", "date": "2024-01-21T12:00:00+02:00", "debtor": { "Identifier": 1, "DebtorCode": "DB10000", "CompanyName": "Jan Janssen B.V.", "CompanyNumber": "123456789", "TaxNumber": "NL123456789B01", "Sex": "m", "Initials": "Jan", "SurName": "Janssen", "Address": "Keizersgracht 100", "ZipCode": "1015 AA", "City": "Amsterdam", "Country": "NL", "EmailAddress": "info@example.com", "PhoneNumber": "010 - 22 33 44", "MobileNumber": "", "FaxNumber": "", "Comment": "", "InvoiceMethod": "0", "DirectDebitApplyTo": "none", "InvoiceAuthorisation": "no", "MandateDate": "", "MandateID": "", "AccountNumber": "", "AccountIban": "", "AccountBIC": "", "AccountName": "", "AccountBank": "", "AccountCity": "", "Mailing": "yes", "InvoiceTerm": -1, "PeriodicInvoiceDays": -1, "PaymentMail": -1, "LanguageCode": "nl_nl", "Currency": "EUR", "CustomTaxCode": "", "ReminderEmailAddress": "", "Groups": [ { "id": 1, "GroupName": "Laadpaal" } ], "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00", "DefaultBillingContactId": 0, "DefaultQuoteContactId": 0, "ExtraClientContacts": [], "InvoiceDataForPriceQuote": "no", "InvoiceCompanyName": "", "InvoiceSex": "m", "InvoiceInitials": "", "InvoiceSurName": "", "InvoiceAddress": "", "InvoiceZipCode": "", "InvoiceCity": "", "InvoiceCountry": "NL", "InvoiceEmailAddress": "", "Translations": { "Country": "Nederland", "InvoiceMethod": "Per e‑mail", "InvoiceCountry": "Nederland", "LanguageLabel": "Nederlands" } } } ``` ``` -------------------------------- ### Download Attachment - PHP Example Source: https://developer.wefact.com/pricequote/attachment/download__locale=nl_NL This function allows you to download an attachment from a price quote. The file is returned as a Base64 encoded string. Requires 'ReferenceIdentifier' or 'PriceQuoteCode', and 'Type'. 'Identifier' or 'Filename' is also required. ```php $parameters = [ "ReferenceIdentifier" => 1, "Type" => "pricequote", "Filename" => "sample.pdf" ]; $api->sendRequest('attachment', 'download', $parameters); ``` -------------------------------- ### Product Show API Source: https://developer.wefact.com/product/show Retrieves detailed information about a specific product using its identifier or product code. ```APIDOC ## GET /websites/developer_wefact/product/show ### Description Middels deze functie kunt u meer informatie over een product ophalen. ### Method GET ### Endpoint /websites/developer_wefact/product/show ### Parameters #### Query Parameters - **Identifier** (int) - Required - De unieke ID van een product - **ProductCode** (string) - Optional - Het productnummer ### Request Example ```json { "query": { "Identifier": 123, "ProductCode": "P0001" } } ``` ### Response #### Success Response (200) - **controller** (string) - The name of the controller. - **action** (string) - The name of the action. - **status** (string) - The status of the request (e.g., "success"). - **date** (string) - The timestamp of the response. - **product** (object) - An object containing the product details. - **Identifier** (int) - The unique ID of the product. - **ProductCode** (string) - The product number. - **ProductName** (string) - The name of the product. - **ProductKeyPhrase** (string) - A key phrase for the product. - **ProductDescription** (string) - A description of the product. - **NumberSuffix** (string) - Suffix for the product number. - **Barcode** (string) - Barcode of the product. - **PriceExcl** (number) - Price excluding tax. - **PricePeriod** (string) - Price period. - **TaxCode** (string) - Tax code. - **TaxPercentage** (number) - Tax percentage. - **Groups** (array) - Array of groups the product belongs to. - **Created** (string) - Creation timestamp. - **Modified** (string) - Modification timestamp. - **Translations** (object) - Object containing translations. #### Response Example ```json { "controller": "product", "action": "show", "status": "success", "date": "2024-01-21T12:00:00+02:00", "product": { "Identifier": 1, "ProductCode": "P0001", "ProductName": "Uurtarief", "ProductKeyPhrase": "Werkzaamheden gebaseerd op uurtarief", "ProductDescription": "", "NumberSuffix": "", "Barcode": "", "PriceExcl": 100, "PricePeriod": "", "TaxCode": "V21", "TaxPercentage": 21, "Groups": [ { "id": 1, "GroupName": "Consultancy" } ], "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00", "Translations": { "PricePeriod": "geen abonnement" } } } ``` ``` -------------------------------- ### Debtor API - Example Output Source: https://developer.wefact.com/debtor/edit__locale=nl_BE This section provides an example of the output structure when retrieving debtor information. It details various fields related to a debtor, including their identification, contact information, addresses, and payment preferences. ```APIDOC ## GET /websites/developer_wefact/debtor ### Description Retrieves detailed information about a specific debtor. This endpoint returns a comprehensive object containing all relevant data for a debtor, including contact details, addresses, payment settings, and associated contacts. ### Method GET ### Endpoint /websites/developer_wefact/debtor ### Parameters #### Query Parameters - **Identifier** (integer) - Required - The unique identifier of the debtor to retrieve. ### Request Example ``` GET /websites/developer_wefact/debtor?Identifier=1 ``` ### Response #### Success Response (200) - **controller** (string) - Indicates the controller handling the request. - **action** (string) - Indicates the action performed by the controller. - **status** (string) - The status of the operation (e.g., "success"). - **date** (string) - The timestamp of the response. - **debtor** (object) - An object containing detailed debtor information: - **Identifier** (integer) - The unique identifier of the debtor. - **DebtorCode** (string) - The debtor's code. - **CompanyName** (string) - The company name of the debtor. - **CompanyNumber** (string) - The company registration number. - **TaxNumber** (string) - The debtor's tax identification number. - **Sex** (string) - The gender of the contact person. - **Initials** (string) - The initials of the contact person. - **SurName** (string) - The last name of the contact person. - **Address** (string) - The street address. - **ZipCode** (string) - The postal code. - **City** (string) - The city. - **Country** (string) - The country code. - **EmailAddress** (string) - The primary email address. - **PhoneNumber** (string) - The primary phone number. - **MobileNumber** (string) - The mobile phone number. - **FaxNumber** (string) - The fax number. - **Comment** (string) - Any additional comments. - **InvoiceMethod** (string) - The preferred method for sending invoices. - **DirectDebitApplyTo** (string) - Specifies if direct debit applies. - **InvoiceAuthorisation** (string) - Indicates invoice authorization status. - **MandateDate** (string) - The date of the mandate. - **MandateID** (string) - The ID of the mandate. - **AccountNumber** (string) - The bank account number. - **AccountIban** (string) - The IBAN of the bank account. - **AccountBIC** (string) - The BIC/SWIFT code of the bank. - **AccountName** (string) - The name associated with the bank account. - **AccountBank** (string) - The name of the bank. - **AccountCity** (string) - The city of the bank. - **Mailing** (string) - Indicates if mailing is enabled. - **InvoiceTerm** (string) - The payment term for invoices. - **PeriodicInvoiceDays** (string) - Specifies days for periodic invoices. - **PaymentMail** (string) - Indicates if payment reminders are emailed. - **LanguageCode** (string) - The language code for communication. - **Currency** (string) - The default currency. - **CustomTaxCode** (string) - Any custom tax code. - **ReminderEmailAddress** (string) - Email address for reminders. - **Groups** (array) - An array of groups the debtor belongs to. - **Created** (string) - The timestamp when the debtor was created. - **Modified** (string) - The timestamp when the debtor was last modified. - **DefaultBillingContactId** (integer) - The ID of the default billing contact. - **DefaultQuoteContactId** (integer) - The ID of the default quote contact. - **ExtraClientContacts** (array) - An array of additional client contacts. - **InvoiceDataForPriceQuote** (string) - Indicates if invoice data is used for price quotes. - **InvoiceCompanyName** (string) - The company name used for invoicing. - **InvoiceSex** (string) - The gender for invoicing contact. - **InvoiceInitials** (string) - The initials for invoicing contact. - **InvoiceSurName** (string) - The last name for invoicing contact. - **InvoiceAddress** (string) - The invoice street address. - **InvoiceZipCode** (string) - The invoice postal code. - **InvoiceCity** (string) - The invoice city. - **InvoiceCountry** (string) - The invoice country code. - **InvoiceEmailAddress** (string) - The email address for invoices. - **Translations** (object) - Translations for various fields. #### Response Example ```json { "controller": "debtor", "action": "edit", "status": "success", "date": "2024-01-21T12:00:00+02:00", "debtor": { "Identifier": 1, "DebtorCode": "DB10000", "CompanyName": "Jan Janssen B.V.", "CompanyNumber": "123456789", "TaxNumber": "NL123456789B01", "Sex": "m", "Initials": "Jan", "SurName": "Janssen", "Address": "Keizersgracht 100", "ZipCode": "1015 AA", "City": "Amsterdam", "Country": "NL", "EmailAddress": "info@example.com", "PhoneNumber": "010 - 22 33 44", "MobileNumber": "", "FaxNumber": "", "Comment": "", "InvoiceMethod": "0", "DirectDebitApplyTo": "none", "InvoiceAuthorisation": "no", "MandateDate": "", "MandateID": "", "AccountNumber": "", "AccountIban": "", "AccountBIC": "", "AccountName": "", "AccountBank": "", "AccountCity": "", "Mailing": "yes", "InvoiceTerm": "-1", "PeriodicInvoiceDays": "-1", "PaymentMail": "-1", "LanguageCode": "nl_nl", "Currency": "EUR", "CustomTaxCode": "", "ReminderEmailAddress": "", "Groups": [], "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00", "DefaultBillingContactId": 1, "DefaultQuoteContactId": 0, "ExtraClientContacts": [ { "Identifier": 1, "ClientId": 1, "CompanyName": "Bedrijfsnaam", "Salutation": "m", "FirstName": "Jan", "LastName": "Janssen", "Address": "Keizersgracht 100", "ZipCode": "1015 AA", "City": "Amsterdam", "Country": "NL", "EmailAddress": "info@example.com", "PhoneNumber": "010 - 22 33 44", "MobileNumber": "012 - 22 33 44", "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00" } ], "InvoiceDataForPriceQuote": "no", "InvoiceCompanyName": "Bedrijfsnaam", "InvoiceSex": "m", "InvoiceInitials": "Jan", "InvoiceSurName": "Janssen", "InvoiceAddress": "Keizersgracht 100", "InvoiceZipCode": "1015 AA", "InvoiceCity": "Amsterdam", "InvoiceCountry": "NL", "InvoiceEmailAddress": "info@example.com", "Translations": { "Country": "Nederland", "InvoiceMethod": "Per e‑mail", "InvoiceCountry": "Nederland", "LanguageLabel": "Nederlands" } } } ``` ``` -------------------------------- ### Example API Limit Reached Response Source: https://developer.wefact.com/limits This snippet shows an example of the response received when an API rate limit is exceeded. It indicates the status is an error and provides a specific reason, such as an IP address being in the firewall. ```php Array ( [controller] => invalid [action] => invalid [status] => error [date] => 2022-01-01T12:00:00+01:00 [errors] => Array ( [0] => IP 123.456.78.9 currently in firewall ) ) ``` -------------------------------- ### Product Management - Add Product Source: https://developer.wefact.com/product/add__locale=nl_NL Add a new product to the system. Product details such as name, price, and inventory information can be provided. ```APIDOC ## POST /websites/developer_wefact/product/add ### Description This endpoint allows you to add a new product with specified details. ### Method POST ### Endpoint /websites/developer_wefact/product/add ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **ProductCode** (string) - Optional - The product number. If not provided, it will be automatically determined. - **ProductName** (string) - Required - The name of the product. - **ProductKeyPhrase** (string) - Required - A short description of the product for invoices. - **ProductDescription** (string) - Optional - A detailed internal description of the product. - **NumberSuffix** (string) - Optional - Unit of measurement (e.g., 'Kg.'). - **Barcode** (string) - Optional - The product's barcode. - **PriceExcl** (float) - Required - The price per unit excluding VAT. - **PricePeriod** (string) - Optional - Subscription period. Refer to the variables list. Defaults to '' (no subscription). - **TaxCode** (string) - Optional - The VAT tax code. - **AccountingCostCentre** (string) - Optional - The cost center code for the accounting package. Only available if activated. - **AccountingProject** (string) - Optional - The project code for the accounting package. Only available if activated. - **Groups** (array) - Optional - An array of product group IDs, or an empty string for no groups. - **ProductInventory** (array) - Optional - Inventory management details: - **IsProductInventoryEnabled** ('yes' or 'no') - Optional - Whether to track inventory. Defaults to 'yes'. - **TotalStock** (float) - Optional - The current stock quantity. - **StockWarningThreshold** (string) - Optional - The threshold for low stock warnings. Leave empty to use the default from settings. - **SupplierIds** (array) - Optional - An array of linked supplier IDs, or an empty string for no suppliers. - **WarehouseID** (int) - Optional - The warehouse location ID. ### Request Example ```json { "ProductName": "Service contract", "ProductKeyPhrase": "Service contract", "PriceExcl": 150, "PricePeriod": "m" } ``` ### Response #### Success Response (200) - **Identifier** (int) - The unique identifier for the newly created product. - **ProductCode** (string) - The generated product code. - **ProductName** (string) - The name of the product. - **ProductKeyPhrase** (string) - The short description for invoices. - **ProductDescription** (string) - The detailed internal description. - **NumberSuffix** (string) - The unit of measurement. - **Barcode** (string) - The product's barcode. - **PriceExcl** (float) - The price per unit excluding VAT. - **PricePeriod** (string) - The subscription period. - **TaxCode** (string) - The VAT tax code. - **TaxPercentage** (float) - The VAT percentage. - **Groups** (array) - An array of product group IDs. - **Created** (string) - The timestamp when the product was created. - **Modified** (string) - The timestamp when the product was last modified. - **Translations** (object) - Translations for product fields, e.g., PricePeriod. #### Response Example ```json { "controller": "product", "action": "add", "status": "success", "date": "2024-01-21T12:00:00+02:00", "product": { "Identifier": 1, "ProductCode": "P0001", "ProductName": "Service contract", "ProductKeyPhrase": "Service contract", "ProductDescription": "", "NumberSuffix": "", "Barcode": "", "PriceExcl": 150, "PricePeriod": "m", "TaxCode": "V21", "TaxPercentage": 21, "Groups": [], "Created": "2024-01-21 11:00:00", "Modified": "2024-01-21 11:00:00", "Translations": { "PricePeriod": "maand" } } } ``` ``` -------------------------------- ### Download Offerte Source: https://developer.wefact.com/pricequote/download__locale=nl_NL Hiermee kunt u een offerte downloaden als een Base64-gecodeerde PDF-string. ```APIDOC ## POST /pricequote/download ### Description Middels deze functie kunt u de offerte in PDF downloaden. De PDF wordt als Base64 encoded string teruggegeven. ### Method POST ### Endpoint /pricequote/download ### Parameters #### Request Body - **Identifier** (int) - Required - De unieke ID van een offerte - **PriceQuoteCode** (string) - Required - Het offertenummer _**Verplichte velden:** Identifier of PriceQuoteCode _ ### Request Example ```json { "PriceQuoteCode": "OF2024-0001" } ``` ### Response #### Success Response (200) - **pricequote** (object) - Bevat informatie over de gedownloade offerte - **Filename** (string) - De naam van het PDF-bestand - **Base64** (string) - De offerte als Base64 encoded string - **MimeType** (string) - Het MIME-type van het bestand (application/pdf) #### Response Example ```json { "controller": "pricequote", "action": "download", "status": "success", "date": "2024-01-21T12:00:00+02:00", "pricequote": { "Filename": "Offerte-OF2024-0001.pdf", "Base64": "JVBERi0xLj...UlRU9GCg==", "MimeType": "application/pdf" } } ``` ``` -------------------------------- ### GET /group/show Source: https://developer.wefact.com/group/show Retrieves detailed information about a specific group using its identifier. ```APIDOC ## GET /group/show ### Description Retrieves detailed information about a specific group using its unique identifier. ### Method GET ### Endpoint /group/show ### Parameters #### Query Parameters - **Identifier** (int) - Required - The unique ID of the group. ### Request Example ```json { "Identifier": "1" } ``` ### Response #### Success Response (200) - **controller** (string) - The controller name. - **action** (string) - The action performed. - **status** (string) - The status of the request (e.g., "success"). - **date** (string) - The timestamp of the response. - **group** (object) - An object containing group details: - **Identifier** (int) - The unique ID of the group. - **GroupName** (string) - The name of the group. - **Type** (string) - The type of the group. - **Items** (array) - An array of items within the group. #### Response Example ```json { "controller": "group", "action": "show", "status": "success", "date": "2024-01-21T12:00:00+02:00", "group": { "Identifier": 1, "GroupName": "Consultancy", "Type": "product", "Items": [] } } ``` ```