### Create Invoice Response Example Source: https://docs.invoiless.com/docs/invoices Example of a successful response when creating a new invoice. It returns the unique ID of the created invoice and a URL for its preview. ```json { "id": "invoice_id", "url": "https://invoiless.com/i/invoice_id" } ``` -------------------------------- ### Example: Removing Field Values in JSON Source: https://docs.invoiless.com/docs/api-usage Demonstrates how to clear or remove field values when updating a resource via the API by setting them to an empty string or null. This is useful for resetting specific fields without affecting others. ```json { "notes": "", "terms": null } ``` -------------------------------- ### Create Estimate - API Request Example Source: https://docs.invoiless.com/docs/estimates This example demonstrates how to create a new estimate using the Invoiless API. It requires customer and item details, and allows specifying the initial status. The request body should follow the structure shown. ```json { "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Consulting Service", "quantity": 10, "price": 150 } ], "status": "Draft" } ``` -------------------------------- ### Get Product Source: https://docs.invoiless.com/docs/products Retrieve a specific product by its ID. ```APIDOC ## GET /v1/items/:id ### Description Retrieve a specific product by ID. ### Method GET ### Endpoint https://api.invoiless.com/v1/items/:id ### Parameters #### Path Parameters - **id** (string) - Required - Product id ### Response #### Success Response (200) - **object** (object) - The product object. ``` -------------------------------- ### Send Estimate - API Request Example Source: https://docs.invoiless.com/docs/estimates This example shows how to send an existing estimate to a customer via email using the Invoiless API. You can optionally provide a custom email address, subject, and body, or schedule the send date. ```json { "email": "customer@example.com", "subject": "Your Estimate from Invoiless", "body": "Please find your estimate attached.", "date": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### Get All Retainers API Request Source: https://docs.invoiless.com/docs/retainers Retrieves a paginated list of all retainer invoices by sending a GET request to the /v1/invoices endpoint and filtering with 'isRetainer: true'. Supports pagination and search functionalities. ```http GET https://api.invoiless.com/v1/invoices ``` -------------------------------- ### Get Products Source: https://docs.invoiless.com/docs/products Retrieve a paginated list of all products. Supports filtering by name or tags. ```APIDOC ## GET /v1/items ### Description Retrieve a paginated list of all products. ### Method GET ### Endpoint https://api.invoiless.com/v1/items ### Parameters #### Query Parameters - **page** (number) - Optional - Page number (default is 1) - **limit** (number) - Optional - Page limit (default is 50) - **search** (string) - Optional - Search by product name or tags ### Response #### Success Response (200) - **data** (array) - An array of product objects. - **pagination** (object) - Pagination details. ``` -------------------------------- ### Get All Product Items Source: https://docs.invoiless.com/docs/products Retrieves a paginated list of all available product items. Supports filtering and searching through query parameters like 'page', 'limit', and 'search'. ```http GET https://api.invoiless.com/v1/items?page=1&limit=50&search=example ``` -------------------------------- ### Get All Transaction Categories (GET) Source: https://docs.invoiless.com/docs/transactions/categories Retrieves a list of all transaction categories configured in the system. This endpoint is useful for getting an overview of all existing categories. ```http GET https://api.invoiless.com/v1/transactions/categories ``` -------------------------------- ### Get Specific Retainer API Request Source: https://docs.invoiless.com/docs/retainers Retrieves a specific retainer by its unique ID using a GET request to the /v1/invoices/:id endpoint. This is useful for fetching the details of a single retainer. ```http GET https://api.invoiless.com/v1/invoices/:id ``` -------------------------------- ### Get Specific Product Item Source: https://docs.invoiless.com/docs/products Retrieves a single product item by its unique identifier. This is useful for fetching detailed information about a specific product. ```http GET https://api.invoiless.com/v1/items/:id ``` -------------------------------- ### Get Retainers Source: https://docs.invoiless.com/docs/retainers Retrieve a paginated list of all retainer invoices. You can filter the results by providing search terms. ```APIDOC ## GET /v1/invoices ### Description Retrieve a paginated list of all retainer invoices. Filter by `isRetainer: true` to specifically get retainers. ### Method GET ### Endpoint https://api.invoiless.com/v1/invoices ### Parameters #### Query Parameters - **page** (number) - Optional - The page number for pagination. Defaults to `1`. - **limit** (number) - Optional - The number of results per page. Defaults to `50`. - **search** (string) - Optional - Search by retainer number, customer name, or tags. ``` -------------------------------- ### Get Customer Source: https://docs.invoiless.com/docs/customers Retrieves the details of a specific customer using their unique ID. ```APIDOC ## GET /v1/customers/:id ### Description Retrieve a specific customer by ID. ### Method GET ### Endpoint https://api.invoiless.com/v1/customers/:id ### Parameters #### Path Parameters - **id** (`string`) - Required - Customer id ### Response #### Success Response (200) - **id** (`string`) - Unique identifier for the customer. - **billTo** (`object`) - Bill to address details. - **shipTo** (`object`) - Ship to address details. - **cc** (`array[string]`) - Cc email recipients. - **bcc** (`array[string]`) - Bcc email recipients. - **currency** (`string`) - ISO 4217 currency code. - **lang** (`string`) - Customer language. - **dateFormat** (`string`) - Date format. - **attachPdf** (`bool`) - Indicates if PDF is attached to emails. - **notes** (`string`) - Private notes. - **tags** (`array[string]`) - Customer tags. #### Response Example ```json { "id": "cus_123abc", "billTo": { "company": "Invoiless", "email": "customer@example.com", "phone": "202-555-0113", "address": "4320 Ryder Avenue" }, "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:30:00Z" } ``` ``` -------------------------------- ### GET /v1/estimates Source: https://docs.invoiless.com/docs/estimates Retrieve a paginated list of all estimates. Supports filtering and searching through query parameters. ```APIDOC ## GET /v1/estimates ### Description Retrieve a paginated list of all estimates. You can control the number of results per page and search using various criteria. ### Method GET ### Endpoint https://api.invoiless.com/v1/estimates ### Parameters #### Query Parameters - **page** (number) - Optional - The page number to retrieve. Defaults to `1`. - **limit** (number) - Optional - The maximum number of estimates to return per page. Defaults to `50`. - **search** (string) - Optional - Search by estimate number, customer name, or tags. ### Response #### Success Response (200 OK) - **estimates** (array) - An array of estimate objects. - **pagination** (object) - Pagination details. - **currentPage** (number) - The current page number. - **totalPages** (number) - The total number of pages. - **totalItems** (number) - The total number of estimates. #### Response Example ```json { "estimates": [ { "id": "EST_12345", "customer": {"company": "Invoiless"}, "status": "Draft", "createdAt": "2023-10-27T10:00:00Z" }, { "id": "EST_67890", "customer": {"company": "Example Corp"}, "status": "Sent", "createdAt": "2023-10-26T15:00:00Z" } ], "pagination": { "currentPage": 1, "totalPages": 5, "totalItems": 250 } } ``` ``` -------------------------------- ### Get Single Transaction Category (GET) Source: https://docs.invoiless.com/docs/transactions/categories Retrieves a specific transaction category by its unique ID. This endpoint is used to fetch the details of a single category. ```http GET https://api.invoiless.com/v1/transactions/categories/:id ``` -------------------------------- ### GET /v1/transactions/categories Source: https://docs.invoiless.com/docs/transactions/categories Retrieve all categories. ```APIDOC ## GET /v1/transactions/categories ### Description Retrieve all categories. ### Method GET ### Endpoint https://api.invoiless.com/v1/transactions/categories ### Response #### Success Response (200) Returns a list of category objects. #### Response Example ```json [ { "id": "cat_123", "name": "Consulting", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" }, { "id": "cat_456", "name": "Software License", "created_at": "2023-10-26T09:00:00Z", "updated_at": "2023-10-26T09:00:00Z" } ] ``` ``` -------------------------------- ### Get Specific Transaction Source: https://docs.invoiless.com/docs/transactions Retrieves details of a specific transaction using its unique ID. This is a GET request to the transaction endpoint with the ID specified in the path. ```http GET https://api.invoiless.com/v1/transactions/:id ``` -------------------------------- ### Get Customers Source: https://docs.invoiless.com/docs/customers Retrieves a paginated list of all customers. You can specify the page number and the number of results per page, and also search by customer name, email, or phone. ```APIDOC ## GET /v1/customers ### Description Retrieve a paginated list of all customers. ### Method GET ### Endpoint https://api.invoiless.com/v1/customers ### Parameters #### Query Parameters - **page** (`number`) - Optional - Page number, default is `1` - **limit** (`number`) - Optional - Page limit, default is `50` - **search** (`string`) - Optional - Search by customer name, email, or phone ### Response #### Success Response (200) - **customers** (`array[object]`) - A list of customer objects. - Each customer object contains fields like `id`, `billTo`, `shipTo`, `createdAt`, `updatedAt`, etc. #### Response Example ```json { "customers": [ { "id": "cus_123abc", "billTo": { "company": "Invoiless", "email": "customer1@example.com" }, "createdAt": "2023-10-27T10:00:00Z" }, { "id": "cus_456def", "billTo": { "company": "Another Company", "email": "customer2@example.com" }, "createdAt": "2023-10-27T10:05:00Z" } ], "total": 100, "page": 1, "limit": 50 } ``` ``` -------------------------------- ### Get Retainer Source: https://docs.invoiless.com/docs/retainers Retrieve the details of a specific retainer invoice by providing its unique ID. ```APIDOC ## GET /v1/invoices/:id ### Description Retrieve a specific retainer invoice by its ID. ### Method GET ### Endpoint https://api.invoiless.com/v1/invoices/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the retainer to retrieve. ``` -------------------------------- ### Get Invoice Source: https://docs.invoiless.com/docs/invoices Retrieves a specific invoice by its ID. ```APIDOC ## Get Invoice ### Description Retrieves a specific invoice by its ID. ### Method GET ### Endpoint `/v1/invoices/:id` ### Parameters #### Path Parameters - **id** (string) - Required - Invoice id #### Query Parameters None ### Request Example ``` GET /v1/invoices/invoice_id ``` ### Response #### Success Response (200 OK) (Details not provided in the source text, typically returns the invoice object) #### Response Example (Details not provided in the source text) ``` -------------------------------- ### Get Transaction Source: https://docs.invoiless.com/docs/transactions Retrieve a specific transaction by its unique ID. ```APIDOC ## GET /v1/transactions/:id ### Description Retrieve a specific transaction by ID. ### Method GET ### Endpoint https://api.invoiless.com/v1/transactions/:id ### Parameters #### Path Parameters - **id** (string) - Required - Transaction id #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Returns the transaction object. #### Response Example ```json { "id": "txn_12345", "type": "Income", "amount": 1500.0, "currency": "USD", "date": "2024-01-15", "customer": "customer_id", "category": "category_id", "method": "BankTransfer", "referenceId": "INV-2024-001", "notes": "Payment for invoice #001", "taxes": [ { "name": "VAT", "type": "Percentage", "value": 20 } ], "createdAt": "2024-01-15T10:00:00Z", "updatedAt": "2024-01-15T10:00:00Z" } ``` ``` -------------------------------- ### GET /v1/estimates/:id Source: https://docs.invoiless.com/docs/estimates Retrieve the details of a specific estimate by providing its unique identifier (ID) in the URL. ```APIDOC ## GET /v1/estimates/:id ### Description Retrieve a specific estimate by its ID. This endpoint is useful for fetching the complete details of a single estimate. ### Method GET ### Endpoint https://api.invoiless.com/v1/estimates/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the estimate to retrieve. ### Response #### Success Response (200 OK) - **estimate** (object) - The requested estimate object. #### Response Example ```json { "id": "EST_12345", "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Consulting Service", "quantity": 10, "price": 150 } ], "status": "Draft", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Get Transactions Source: https://docs.invoiless.com/docs/transactions Retrieve a paginated list of all transactions. Supports filtering via search. ```APIDOC ## GET /v1/transactions ### Description Retrieve a paginated list of all transactions. ### Method GET ### Endpoint https://api.invoiless.com/v1/transactions ### Parameters #### Path Parameters None #### Query Parameters - **page** (number) - Optional - Page number, default is `1` - **limit** (number) - Optional - Page limit, default is `50` - **search** (string) - Optional - Search by reference ID or notes #### Request Body None ### Request Example `GET https://api.invoiless.com/v1/transactions?page=2&limit=20&search=INV-2024` ### Response #### Success Response (200) Returns a list of transaction objects. #### Response Example ```json { "data": [ { "id": "txn_12345", "type": "Income", "amount": 1500.0, "currency": "USD", "date": "2024-01-15", "customer": "customer_id", "category": "category_id", "method": "BankTransfer", "referenceId": "INV-2024-001", "notes": "Payment for invoice #001", "taxes": [ { "name": "VAT", "type": "Percentage", "value": 20 } ], "createdAt": "2024-01-15T10:00:00Z", "updatedAt": "2024-01-15T10:00:00Z" } ], "pagination": { "currentPage": 1, "totalPages": 10, "pageSize": 50, "totalItems": 450 } } ``` ``` -------------------------------- ### Get All Customers (Paginated) - Invoiless API Source: https://docs.invoiless.com/docs/customers This snippet illustrates how to fetch a paginated list of all customers from the Invoiless API. You can control the results using optional query parameters like 'page' for the page number and 'limit' for the number of results per page. A 'search' parameter is also available to filter customers by name, email, or phone. ```http GET https://api.invoiless.com/v1/customers?page=2&limit=20&search=John ``` -------------------------------- ### GET /v1/transactions/categories/:id Source: https://docs.invoiless.com/docs/transactions/categories Retrieve a specific category by ID. ```APIDOC ## GET /v1/transactions/categories/:id ### Description Retrieve a specific category by ID. ### Method GET ### Endpoint https://api.invoiless.com/v1/transactions/categories/:id ### Parameters #### Path Parameters - **id** (string) - Required - Category id ### Response #### Success Response (200) Returns the category object. #### Response Example ```json { "id": "cat_123", "name": "Consulting", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Get Invoices Source: https://docs.invoiless.com/docs/invoices Retrieves a paginated list of all invoices. Supports filtering by page, limit, and search terms. ```APIDOC ## Get Invoices ### Description Retrieves a paginated list of all invoices. Supports filtering by page, limit, and search terms. ### Method GET ### Endpoint `/v1/invoices` ### Parameters #### Path Parameters None #### Query Parameters - **page** (number) - Optional - Page number, default is `1` - **limit** (number) - Optional - Page limit, default is `50` - **search** (string) - Optional - Search by invoice number, customer name, or tags ### Request Example ``` GET /v1/invoices?page=2&limit=10&search=JohnDoe ``` ### Response #### Success Response (200 OK) (Details not provided in the source text, typically returns an array of invoice objects) #### Response Example (Details not provided in the source text) ``` -------------------------------- ### Get Specific Customer - Invoiless API Source: https://docs.invoiless.com/docs/customers This snippet shows how to retrieve details for a specific customer using their unique ID. The ':id' placeholder in the URL must be replaced with the customer's actual ID. This endpoint returns the full customer object. ```http GET https://api.invoiless.com/v1/customers/:id ``` -------------------------------- ### Get All Transactions Source: https://docs.invoiless.com/docs/transactions Retrieves a paginated list of all transactions. Supports filtering through query parameters such as page number, limit per page, and search by reference ID or notes. ```http GET https://api.invoiless.com/v1/transactions?page=1&limit=50&search=INV-2024 ``` -------------------------------- ### Create Product Item Source: https://docs.invoiless.com/docs/products Creates a new product item. Accepts product details such as name, description, price, and inventory tracking settings. Returns the newly created product object upon successful creation. ```json { "name": "Premium Subscription", "description": "Monthly premium subscription plan", "price": 49.99, "url": "https://example.com/products/premium", "trackInventory": true, "stock": 100, "tags": ["subscription", "premium"] } ``` -------------------------------- ### Create Customer - Invoiless API Source: https://docs.invoiless.com/docs/customers This snippet demonstrates how to create a new customer using the Invoiless API. It requires at least the 'billTo' object, which must contain billing details. Optional parameters include 'shipTo', email recipients ('cc', 'bcc'), currency, language, date format, PDF attachment preference, private notes, and tags. ```json { "billTo": { "company": "Invoiless", "email": "customer@example.com", "phone": "202-555-0113", "address": "4320 Ryder Avenue" } } ``` -------------------------------- ### Create Product Source: https://docs.invoiless.com/docs/products Create a new product item that can be used in invoices. Returns the created product object upon success. ```APIDOC ## POST /v1/items ### Description Create a new product item that can be used in invoices. ### Method POST ### Endpoint https://api.invoiless.com/v1/items ### Parameters #### Request Body - **name** (string) - Required - Product name (max 100 characters) - **price** (number) - Required - Product price (must be >= 0) - **url** (string) - Optional - Product URL - **description** (string) - Optional - Product description (max 1000 characters) - **trackInventory** (bool) - Optional - Enable inventory tracking - **stock** (number) - Optional - Stock quantity (integer, required if trackInventory is true) - **tags** (array[string]) - Optional - Product tags (max 10 tags, each max 50 characters) ### Request Example ```json { "name": "Premium Subscription", "description": "Monthly premium subscription plan", "price": 49.99, "url": "https://example.com/products/premium", "trackInventory": true, "stock": 100, "tags": ["subscription", "premium"] } ``` ### Response #### Success Response (201) - **object** (object) - The created product object. ``` -------------------------------- ### Support Contact Information Source: https://docs.invoiless.com/docs/errors-support Information on how to contact Invoiless support for assistance with API-related issues. ```APIDOC ## Need Help? ### Description Contact Invoiless support for any assistance required regarding API errors or other inquiries. ### Method Contact ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response - **contact_email** (string) - The support email address. #### Response Example ``` Contact us at contact@invoiless.com ``` ``` -------------------------------- ### API Key Authentication Source: https://docs.invoiless.com/docs/intro All API requests must be authenticated using an API key. Retrieve your API key from Settings > Integrations > API key and include it in the request headers. ```APIDOC ## API Key Authentication ### Description To authenticate your API requests, you must include your unique API key in the request headers. This key is obtained from your Invoiless account settings. ### Method All HTTP methods (GET, POST, PUT, DELETE, etc.) require authentication. ### Endpoint All API endpoints. ### Headers - **api-key** (string) - Required - Your unique API key provided by Invoiless. ### Request Example ```json { "Header": { "api-key": "your-api-key" } } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating authentication was successful. #### Response Example ```json { "message": "Authentication successful" } ``` ``` -------------------------------- ### Create Customer Source: https://docs.invoiless.com/docs/customers Creates a new customer record with associated billing and shipping information. You can also specify CC and BCC email recipients, currency, language, date format, PDF attachment preference, private notes, and tags. ```APIDOC ## POST /v1/customers ### Description Create a new customer with billing and shipping information. ### Method POST ### Endpoint https://api.invoiless.com/v1/customers ### Parameters #### Request Body - **billTo** (`object`) - Required - Bill to address - **shipTo** (`object`) - Optional - Ship to address - **cc** (`array[string]`) - Optional - Cc email recipients (max 3, unique, cannot duplicate billTo.email or bcc emails) - **bcc** (`array[string]`) - Optional - Bcc email recipients (max 3, unique, cannot duplicate billTo.email or cc emails) - **currency** (`string`) - Optional - ISO 4217 currency code - **lang** (`string`) - Optional - Customer language, possible values are `en`, `fr`, `de`, `nl`, `es`, `bg`, `ro`, `ja`, `mn`, `da`, `sv`, `lt`, `fi`, `hu`, `cs`, `it`, `et`, `lv`, `pt`, `pl`, `sk`, or `zh` - **dateFormat** (`string`) - Optional - Date format, possible values are `DD/MM/YYYY`, `MM/DD/YYYY`, `YYYY/MM/DD`, or `YYYY/DD/MM`, with 3 possible separators: `/`, `-`, or `.` - **attachPdf** (`bool`) - Optional - Attach PDF copy to emails - **notes** (`string`) - Optional - Private notes (max 1000 characters) - **tags** (`array[string]`) - Optional - Customer tags (max 10 tags, each max 50 characters) #### Bill To / Ship To Parameters > Either `firstName` and `lastName`, or `company`, is required. - **firstName** (`string`) - Optional - First name (max 100 characters). If provided, `lastName` must also be provided. - **lastName** (`string`) - Optional - Last name (max 100 characters) - **company** (`string`) - Optional - Company name (max 100 characters) - **email** (`string`) - Optional - Email address (lowercase) - **phone** (`string`) - Optional - Phone number (max 50 characters) - **address** (`string`) - Optional - Full address (max 500 characters) - **legal** (`string`) - Optional - Legal info, e.g. Company number (max 100 characters) ### Request Example ```json { "billTo": { "company": "Invoiless", "email": "customer@example.com", "phone": "202-555-0113", "address": "4320 Ryder Avenue" } } ``` ### Response #### Success Response (200) - **id** (`string`) - Unique identifier for the created customer. - **billTo** (`object`) - Bill to address details. - **shipTo** (`object`) - Ship to address details. - **cc** (`array[string]`) - Cc email recipients. - **bcc** (`array[string]`) - Bcc email recipients. - **currency** (`string`) - ISO 4217 currency code. - **lang** (`string`) - Customer language. - **dateFormat** (`string`) - Date format. - **attachPdf** (`bool`) - Indicates if PDF is attached to emails. - **notes** (`string`) - Private notes. - **tags** (`array[string]`) - Customer tags. #### Response Example ```json { "id": "cus_123abc", "billTo": { "company": "Invoiless", "email": "customer@example.com", "phone": "202-555-0113", "address": "4320 Ryder Avenue" }, "createdAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Update Product Source: https://docs.invoiless.com/docs/products Update an existing product using either PUT or PATCH. Accepts the same parameters as Create Product. ```APIDOC ## PUT /v1/items/:id ## PATCH /v1/items/:id ### Description Update an existing product. See PUT vs PATCH for details on the differences. ### Method PUT, PATCH ### Endpoint https://api.invoiless.com/v1/items/:id ### Parameters #### Path Parameters - **id** (string) - Required - Product id #### Request Body - **name** (string) - Optional - Product name (max 100 characters) - **price** (number) - Optional - Product price (must be >= 0) - **url** (string) - Optional - Product URL - **description** (string) - Optional - Product description (max 1000 characters) - **trackInventory** (bool) - Optional - Enable inventory tracking - **stock** (number) - Optional - Stock quantity (integer, required if trackInventory is true) - **tags** (array[string]) - Optional - Product tags (max 10 tags, each max 50 characters) ### Response #### Success Response (200) - **object** (object) - The updated product object. ``` -------------------------------- ### Create Retainer Source: https://docs.invoiless.com/docs/retainers Create a new retainer invoice by setting `isRetainer` to `true` in the request body. This endpoint accepts the same parameters as the 'Create Invoice' endpoint, with the addition of `isRetainer`. ```APIDOC ## POST /v1/invoices ### Description Create a new retainer invoice. Retainers are upfront payments that secure services for a period of time. ### Method POST ### Endpoint https://api.invoiless.com/v1/invoices ### Parameters #### Request Body - **isRetainer** (bool) - Required - Set to `true` for retainer invoices. - Accepts the same parameters as Create Invoice. ### Request Example ```json { "isRetainer": true, "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Monthly Retainer", "quantity": 1, "price": 5000 } ], "status": "Draft" } ``` ### Response #### Success Response (201) Returns the created retainer object. #### Response Example ```json { "id": "ret_12345", "isRetainer": true, "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Monthly Retainer", "quantity": 1, "price": 5000 } ], "status": "Draft", "createdAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Create Invoice with Customer ID and Line Items Source: https://docs.invoiless.com/docs/invoices This code snippet illustrates creating an invoice by referencing an existing customer using their ID. It specifies the customer ID and provides an array of line items to be included in the invoice. This approach is efficient when customer data is already stored and managed within your system. ```json { "customer": "CUSTOMER_ID", "items": [ { "name": "Demo product", "quantity": 1, "price": 42 } ] } ``` -------------------------------- ### Create Invoice with Customer Details and Line Items Source: https://docs.invoiless.com/docs/invoices This code snippet demonstrates how to create a new invoice using the Invoiless API. It includes essential customer information and line item details. This method is useful when you need to provide a complete customer object rather than just a customer ID. The API expects a JSON payload containing customer details and an array of items. ```json { "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Demo product", "quantity": 1, "price": 42 } ] } ``` -------------------------------- ### Create Invoice Source: https://docs.invoiless.com/docs/invoices Creates a new invoice with specified tax parameters. Returns the ID and preview URL of the created invoice. ```APIDOC ## Create Invoice ### Description Creates a new invoice with specified tax parameters. Returns the ID and preview URL of the created invoice. ### Method POST ### Endpoint /websites/invoiless/invoices (Assuming this is the base endpoint from context) ### Parameters #### Query Parameters None #### Request Body ##### Taxes Parameters - **name** (string) - Optional - Tax name (max 15 characters) - **type** (string) - Optional - Tax type, possible values are `Flat` or `Percentage`, default is `Percentage` - **value** (number) - Required - Tax value ### Request Example ```json { "taxes": [ { "name": "VAT", "type": "Percentage", "value": 10 } ] } ``` ### Response #### Success Response (201 Created) - **id** (string) - Invoice id - **url** (string) - Invoice preview url #### Response Example ```json { "id": "invoice_id", "url": "https://invoiless.com/i/invoice_id" } ``` ``` -------------------------------- ### POST /v1/estimates Source: https://docs.invoiless.com/docs/estimates Create a new estimate. This endpoint accepts parameters similar to those used for creating invoices to define the estimate details. ```APIDOC ## POST /v1/estimates ### Description Create a new estimate using the same fields as invoices. This helps in formalizing price quotes for customers before work begins. ### Method POST ### Endpoint https://api.invoiless.com/v1/estimates ### Parameters #### Request Body - **customer** (object) - Required - The customer associated with the estimate. - **internalId** (string) - Required - The internal ID of the customer. - **billTo** (object) - Required - Billing details for the customer. - **company** (string) - Required - The company name for billing. - **items** (array) - Required - An array of items included in the estimate. - **name** (string) - Required - The name of the item. - **quantity** (number) - Required - The quantity of the item. - **price** (number) - Required - The price per unit of the item. - **status** (string) - Required - The current status of the estimate (e.g., "Draft"). ### Request Example ```json { "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Consulting Service", "quantity": 10, "price": 150 } ], "status": "Draft" } ``` ### Response #### Success Response (201 Created) - **estimate** (object) - The created estimate object. #### Response Example ```json { "id": "EST_12345", "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Consulting Service", "quantity": 10, "price": 150 } ], "status": "Draft", "createdAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Create Retainer API Request Source: https://docs.invoiless.com/docs/retainers Creates a new retainer invoice by sending a POST request to the /v1/invoices endpoint. The request body must include 'isRetainer: true' to designate it as a retainer. This operation accepts parameters similar to creating a regular invoice. ```json { "isRetainer": true, "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Monthly Retainer", "quantity": 1, "price": 5000 } ], "status": "Draft" } ``` -------------------------------- ### Update Customer - Invoiless API (PUT/PATCH) Source: https://docs.invoiless.com/docs/customers This demonstrates how to update an existing customer via the Invoiless API using either PUT or PATCH methods. The ':id' in the URL should be replaced with the actual customer ID. The request body accepts the same parameters as the 'Create Customer' endpoint, allowing for partial or full updates. ```http PUT https://api.invoiless.com/v1/customers/:id { "billTo": { "company": "Updated Company Name", "email": "updated.customer@example.com" } } ``` ```http PATCH https://api.invoiless.com/v1/customers/:id { "billTo": { "phone": "123-456-7890" } } ``` -------------------------------- ### Send Retainer API Request Source: https://docs.invoiless.com/docs/retainers Sends a retainer invoice to the customer via email using a POST request to the /v1/invoices/:id/send endpoint. Optional parameters allow customization of the email's subject, body, and scheduled send date. ```http POST https://api.invoiless.com/v1/invoices/:id/send ``` -------------------------------- ### Delete Product Source: https://docs.invoiless.com/docs/products Permanently delete a product by its ID. ```APIDOC ## DELETE /v1/items/:id ### Description Permanently delete a product. ### Method DELETE ### Endpoint https://api.invoiless.com/v1/items/:id ### Parameters #### Path Parameters - **id** (string) - Required - Product id ### Response #### Success Response (204) No Content. ``` -------------------------------- ### Create Invoice Source: https://docs.invoiless.com/docs/invoices Creates a new invoice with customer information and line items. ```APIDOC ## POST /v1/invoices ### Description Create a new invoice with customer information and line items. ### Method POST ### Endpoint `https://api.invoiless.com/v1/invoices` ### Parameters #### Header Parameters - **scope-id** (string) - Optional - Scope id #### Request Body - **slug** (string) - Optional - Invoice slug (max 50 characters) - **header** (string) - Optional - Invoice header text (max 20 characters) - **number** (string) - Optional - Invoice number (max 20 characters) - **date** (date) - Optional - Invoice date - **dueDate** (date) - Optional - Invoice due date (must be >= date) - **currency** (string) - Optional - ISO 4217 currency code - **lang** (string) - Optional - Invoice language (default: `en`) - **status** (string) - Optional - Invoice status (default: `Draft`) - **customer** (string, object) - Required - Customer id or customer details with your internal user id - **shipTo** (bool) - Optional - Show or hide the ship to address (default: `false`) - **items** (array) - Required - Invoice line items (min 1 item required) - **extraCharges** (object) - Optional - Invoice extra charges - **discount** (object) - Optional - Invoice discount - **extraFields** (array) - Optional - Invoice extra fields (max 3 fields) - **taxes** (array) - Optional - Invoice taxes (max 3 taxes) - **taxIncluded** (bool) - Optional - Tax is included in prices (default: `false`) - **terms** (string) - Optional - Invoice terms (max 1000 characters, HTML sanitized) - **notes** (string) - Optional - Invoice notes (max 1000 characters, HTML sanitized) - **tags** (array[string]) - Optional - Invoice tags (max 10 tags, each max 50 characters) - **isRetainer** (bool) - Optional - Mark invoice as a retainer #### Customer Parameters (if customer is an object) - **internalId** (string) - Required - The internal id is used to identify an individual customer in your application - **billTo** (object) - Required - Bill to address - **shipTo** (object) - Optional - Ship to address #### Bill To / Ship To Parameters - **firstName** (string) - Optional - First name - **lastName** (string) - Optional - Last name - **company** (string) - Optional - Company name - **email** (string) - Optional - Email - **phone** (string) - Optional - Phone - **address** (string) - Optional - Address - **legal** (string) - Optional - Legal info (e.g. Company number) #### Items Parameters - **item** (string) - Optional - Item id that refers to a global item - **name** (string) - Required - Item name (max 100 characters) - **url** (string) - Optional - Item url - **description** (string) - Optional - Item description (max 1000 characters, HTML sanitized) - **quantity** (number) - Required - Item quantity (must be > 0) - **unit** (string) - Optional - Item unit (max 20 characters) - **price** (number) - Required - Item unit price (must be >= 0) - **discount** (object) - Optional - Item discount - **taxes** (array) - Optional - Item taxes (max 3 taxes) #### Item Discount Parameters - **name** (string) - Optional - Discount name (max 15 characters) - **value** (number) - Required - Discount value (cannot exceed item total) #### Item Taxes Parameters - **name** (string) - Required - Tax name (max 15 characters) - **value** (number) - Required - Tax value #### Extra Charges Parameters - **type** (string) - Optional - Extra charges type (default: `Percentage`) - **value** (number) - Required - Extra charges value (must be >= 0) #### Discount Parameters - **type** (string) - Optional - Discount type (default: `Percentage`) - **value** (number) - Required - Discount value (Flat: cannot exceed subtotal, Percentage: max 100) #### Extra Fields Parameters - **name** (string) - Required - Extra field name (max 15 characters) - **type** (string) - Optional - Extra field type (default: `Percentage`) - **value** (number) - Required - Extra field value ### Request Example ```json { "customer": { "internalId": "INTERNAL_USER_ID", "billTo": { "company": "Invoiless" } }, "items": [ { "name": "Demo product", "quantity": 1, "price": 42 } ] } ``` ### Response #### Success Response (200) - **invoiceId** (string) - The ID of the created invoice. - **status** (string) - The status of the created invoice. #### Response Example ```json { "invoiceId": "INV-12345", "status": "Draft" } ``` ```