### Get Company Trial Balance OpenAPI Definition Source: https://firm-pennylane.readme.io/reference/company-trial-balance-1 This OpenAPI 3.0.1 definition outlines the 'company-trial-balance' endpoint. It specifies the request parameters such as company ID, period start and end dates, and optional parameters for auxiliary accounts and pagination. The response schema details the structure of the returned trial balance data, including ledger account number, label, debits, credits, and formatted number. ```json { "openapi": "3.0.1", "info": { "title": "Referentials", "contact": { "email": "tech@pennylane.com" }, "version": "1.0" }, "servers": [ { "url": "https://app.pennylane.com" } ], "paths": { "/api/external/firm/v1/companies/{company_id}/trial_balance": { "get": { "operationId": "company-trial-balance", "summary": "Get the trial balance of a company", "description": "This endpoint returns the trial balance of the company for the given period.\n\n> ℹ️\n> This endpoint requires the following scope: `trial_balance:readonly`", "tags": [ "Trial balance" ], "security": [ { "oauth2": [ "trial_balance:readonly" ] } ], "parameters": [ { "name": "company_id", "description": "Existing company identifier (id)", "in": "path", "schema": { "type": "integer", "example": 1 }, "required": true }, { "name": "period_start", "description": "The start of the period you want the trial balance for.", "in": "query", "schema": { "type": "string", "example": "2022-01-01" }, "required": true }, { "name": "period_end", "description": "The end of the period you want the trial balance for.", "in": "query", "schema": { "type": "string", "example": "2022-12-31" }, "required": true }, { "name": "is_auxiliary", "description": "Whether to include auxiliary accounts or not.", "in": "query", "schema": { "type": "boolean", "example": true } }, { "name": "page", "description": "Items are paginated, this is the current page which will be returned. The page index is starting at 1.", "in": "query", "schema": { "type": "integer", "example": 1 } }, { "name": "per_page", "description": "Items are paginated. By default, you get 500 items per page. You can specify another number of items per page.", "in": "query", "schema": { "type": "integer", "example": 20, "minimum": 1, "maximum": 1000 } } ], "responses": { "200": { "description": "Returns a list of balances grouped by ledger account.", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "properties": { "items": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "number": { "description": "Ledger account number", "type": "string", "example": "512" }, "label": { "description": "Ledger account label", "type": "string", "example": "Capital souscrit - appelé, versé" }, "debits": { "description": "Ledger account debits", "type": "string", "example": "45353.95" }, "credits": { "description": "Ledger account credits", "type": "string", "example": "2343.05" }, "formatted_number": { "description": "Formatted ledger account number", "type": "string", "example": "51200000" } }, "required": [ "number", "label", "debits", "credits", "formatted_number" ] } }, "total_pages": { "type": "integer", "example": 5, "description": "The total number of pages available" } } } } } } } } } } } ``` -------------------------------- ### Get All Categories Source: https://firm-pennylane.readme.io/reference/getcategories Retrieves a list of all available categories. ```APIDOC ## GET /categories ### Description Retrieves a list of all available categories. ### Method GET ### Endpoint /categories ### Response #### Success Response (200) - **categories** (array) - A list of category objects. - **id** (string) - The unique identifier for the category. - **name** (string) - The name of the category. #### Response Example ```json { "categories": [ { "id": "cat_123", "name": "Electronics" }, { "id": "cat_456", "name": "Books" } ] } ``` #### Error Response (401) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response (403) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response (404) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. ``` -------------------------------- ### Get Ledger Entry Line Changes Source: https://firm-pennylane.readme.io/reference/getledgerentrylinechanges Fetches a paginated list of changes to ledger entry lines. ```APIDOC ## GET /ledger/entry_line_changes ### Description Retrieves a list of changes made to ledger entry lines. Supports pagination using `cursor` and `limit` parameters. ### Method GET ### Endpoint /ledger/entry_line_changes ### Query Parameters - **cursor** (string) - Optional - The cursor to retrieve the next set of results. Include the `next_cursor` value from a previous response. - **limit** (integer) - Optional - The maximum number of items to return in this request. Defaults to 100. ### Response #### Success Response (200) - **items** (array) - A list of ledger entry line change objects. - **has_more** (boolean) - Indicates whether additional results are available. - **next_cursor** (string, nullable) - Cursor for the next set of results. `null` if no further results. #### Response Example ```json { "items": [ { "id": "ch_123", "object": "ledger.entry_line_change", "created_at": 1678886400, "entry_id": "en_123", "line_id": "li_123", "field_name": "amount", "old_value": { "amount": 1000, "currency": "usd" }, "new_value": { "amount": 1500, "currency": "usd" } } ], "has_more": true, "next_cursor": "MjAyNS0wMS0wOVQwODoyNDozOC44MTI0NTha" } ``` #### Error Response (400) - **error** (string) - A message describing the error. - **status** (integer) - The HTTP status code. #### Error Response Example ```json { "error": "Invalid cursor provided.", "status": 400 } ``` ``` -------------------------------- ### Get the trial balance of a company Source: https://firm-pennylane.readme.io/reference Requires 'trial_balance:readonly' scope. Retrieves the trial balance for a company. ```APIDOC ## Get the trial balance of a company ### Description Gets the trial balance of a company. ### Method GET ### Endpoint /companies/{company_id}/trial_balance ``` -------------------------------- ### Get All Customers Source: https://firm-pennylane.readme.io/reference/getcustomers Retrieves a list of all customers. This endpoint can be used to fetch all customer records from the system. ```APIDOC ## GET /customers ### Description Retrieves a list of all customers. ### Method GET ### Endpoint /customers ### Response #### Success Response (200) - **customers** (array) - A list of customer objects. #### Response Example { "customers": [ { "id": 1, "name": "Example Company", "billing_iban": "FR1420041010050500013M02606", "payment_conditions": "30_days", "recipient": { "address": "123 Main St", "postal_code": "10001", "city": "New York", "country_alpha2": "US" }, "phone": "+1234567890", "reference": "REF123", "notes": "Some notes here.", "vat_number": "VAT12345", "reg_no": "REG123", "ledger_account": "ACC123", "emails": [ "contact@example.com" ], "billing_address": { "address": "123 Main St", "postal_code": "10001", "city": "New York", "country_alpha2": "US" }, "delivery_address": { "address": "456 Delivery Ave", "postal_code": "10002", "city": "New York", "country_alpha2": "US" }, "created_at": "2023-08-30T10:08:08.146343Z", "updated_at": "2023-08-30T10:08:08.146343Z", "customer_type": "company", "external_reference": "ext-ref-123", "billing_language": "en_GB" } ] } ``` -------------------------------- ### Get Company Trial Balance Source: https://firm-pennylane.readme.io/reference/company-trial-balance-1 Retrieves the trial balance for a specified company. You can filter the results by providing a date. ```APIDOC ## GET /companies/{companyId}/trial-balance ### Description Retrieves the trial balance for a specified company. You can filter the results by providing a date. ### Method GET ### Endpoint /companies/{companyId}/trial-balance #### Query Parameters - **date** (string) - Optional - The date to retrieve the trial balance for. Format: YYYY-MM-DD. ### Response #### Success Response (200) - **data** (array) - An array of trial balance entries. - **accountId** (string) - The ID of the account. - **accountName** (string) - The name of the account. - **debit** (number) - The total debit amount for the account. - **credit** (number) - The total credit amount for the account. - **balance** (number) - The net balance of the account. #### Response Example ```json { "data": [ { "accountId": "acc_123", "accountName": "Sales Revenue", "debit": 0, "credit": 10000, "balance": 10000 }, { "accountId": "acc_456", "accountName": "Cost of Goods Sold", "debit": 5000, "credit": 0, "balance": -5000 } ] } ``` #### Error Responses - **401** - Access token is missing or invalid. - **403** - Access to this resource forbidden. - **404** - The resource was not found. - **422** - Unprocessable content (e.g., entry lines are not balanced). ``` -------------------------------- ### Get Ledger Entry Line Changes Source: https://firm-pennylane.readme.io/reference/getledgerentrylinechanges Retrieves a list of changes for a specific ledger entry line. ```APIDOC ## GET /ledger/entry/{id}/line/{line_id}/changes ### Description Retrieves a list of changes for a specific ledger entry line. ### Method GET ### Endpoint /ledger/entry/{id}/line/{line_id}/changes ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the ledger entry. - **line_id** (string) - Required - The ID of the ledger entry line. ### Response #### Success Response (200) - **changes** (array) - A list of changes made to the ledger entry line. - **id** (string) - The ID of the change. - **created_at** (string) - The timestamp when the change was made. - **field** (string) - The field that was changed. - **old_value** (string) - The previous value of the field. - **new_value** (string) - The new value of the field. - **user_id** (string) - The ID of the user who made the change. #### Response Example ```json { "changes": [ { "id": "chg_123", "created_at": "2023-10-27T10:00:00Z", "field": "amount", "old_value": "100.00", "new_value": "150.00", "user_id": "usr_abc" } ] } ``` #### Error Response (401) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example (401) ```json { "error": "The access token is invalid", "status": 401 } ``` #### Error Response (403) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example (403) ```json { "error": "Access to this resource requires scope \"ledger\".", "status": 403 } ``` #### Error Response (404) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example (404) ```json { "error": "Not Found", "status": 404 } ``` #### Error Response (422) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example (422) ```json { "error": "Entry lines are not balanced", "status": 422 } ``` #### Error Response (500) - **description** (string) - Internal server error. ``` -------------------------------- ### Get Supplier Invoices Changes Source: https://firm-pennylane.readme.io/reference/getsupplierinvoiceschanges Retrieves a list of changes for supplier invoices. You can filter by a start date and paginate the results. Changes are retained for the last 4 weeks and returned in ascending order of `processed_at`. ```APIDOC ## GET /api/external/firm/v1/companies/{company_id}/changelogs/supplier_invoices ### Description Returns the list of changes based on the provided `start_date`. If no `start_date` is provided, it returns the oldest set of recorded changes. Changes for the last 4 weeks are retained. The items will be returned using `processed_at` in ASC order (oldest first). This endpoint requires the following scope: `supplier_invoices:readonly` ### Method GET ### Endpoint /api/external/firm/v1/companies/{company_id}/changelogs/supplier_invoices ### Parameters #### Path Parameters - **company_id** (integer) - Required - Existing company identifier (id) #### Query Parameters - **cursor** (string) - Optional - Cursor for pagination. Use this to fetch the next set of results. The cursor is an opaque string returned in the previous response's metadata. Leave empty for the first request. - **limit** (integer) - Optional - Number of items to return per request. Defaults to 20 if not specified. Must be between 1 and 1000. - **start_date** (string) - Optional - Filter the changes based on the event date. The date should follow RFC3339 format. If no date is provided, the oldest changes will be returned. Changes for the last 4 weeks are retained, thus providing a `start_date` older than that will result in a 422 response. Providing both `start_date` and `cursor` parameters will result in a 400 response. ### Response #### Success Response (200) - **items** (array) - A list of supplier invoices changes - **id** (integer) - Unique identifier of the supplier invoice record - **operation** (string) - Enum: "insert", "update", "delete" - **processed_at** (string) - Timestamp when the event arrived in the change log pipeline - **updated_at** (string) - Timestamp when the record was updated in the database (can vary due to data restoration) - **created_at** (string) - Timestamp when the record was initially created #### Response Example { "items": [ { "id": 123, "operation": "update", "processed_at": "2023-10-26T10:00:00Z", "updated_at": "2023-10-26T10:00:00Z", "created_at": "2023-10-26T09:55:00Z" } ] } ``` -------------------------------- ### Create a new folder Source: https://firm-pennylane.readme.io/reference/postdmsfolders Use this endpoint to create a new folder. You need to provide the folder name and optionally the parent folder ID. ```APIDOC ## POST /dms/folders ### Description Creates a new folder in the Document Management System. ### Method POST ### Endpoint /dms/folders ### Request Body - **name** (string) - Required - The name of the folder to create. - **parent_id** (string) - Optional - The ID of the parent folder. If not provided, the folder will be created at the root level. ### Request Example { "name": "New Project Folder", "parent_id": "123e4567-e89b-12d3-a456-426614174000" } ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the newly created folder. - **name** (string) - The name of the created folder. - **parent_id** (string) - The ID of the parent folder. - **created_at** (string) - The timestamp when the folder was created. #### Response Example { "id": "987e6543-e21b-12d3-a456-426614174001", "name": "New Project Folder", "parent_id": "123e4567-e89b-12d3-a456-426614174000", "created_at": "2023-10-27T10:00:00Z" } #### Error Response (400 Bad Request) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example { "error": "Invalid input data", "status": 400 } #### Error Response (409 Conflict) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example { "error": "Folder with the same name already exists in this location", "status": 409 } ``` -------------------------------- ### Create a DMS folder Source: https://firm-pennylane.readme.io/reference/postdmsfolders This endpoint creates a new DMS folder for the company. It requires the `dms_files:all` scope. ```APIDOC ## POST /api/external/firm/v1/companies/{company_id}/dms/folders ### Description Creates a new DMS folder for the company. > ℹ️ > This endpoint requires the following scope: `dms_files:all` ### Method POST ### Endpoint /api/external/firm/v1/companies/{company_id}/dms/folders ### Parameters #### Path Parameters - **company_id** (integer) - Required - Existing company identifier (id) #### Request Body - **name** (string) - Required - The name of the folder - **parent_folder_id** (integer) - Optional - ID of the parent folder. If not provided, the folder will be at root level. ### Request Example ```json { "name": "Folder 1", "parent_folder_id": 123 } ``` ### Response #### Success Response (201) - **id** (integer) - ID of the folder - **name** (string) - Name of the folder - **path** (string) - Path of the folder - **parent_folder** (object) - Parent folder containing this folder. `null` if folder is at root level. - **id** (integer) - ID of the parent folder - **files** (object) - **url** (string) - URL to retrieve the files in this folder - **created_at** (string) - Timestamp of creation - **updated_at** (string) - Timestamp of last update #### Response Example ```json { "id": 124, "name": "folder_name", "path": "/path/to/folder", "parent_folder": { "id": 234 }, "files": { "url": "https://app.pennylane.com/api/external/firm/v1/companies/1/dms/files?filter=%5B%7B%22field%22:%22parent_folder_id%22,%22operator%22:%22eq%22,%22value%22:%22124%22%7D%5D" }, "created_at": "2023-08-30T10:08:08.146343Z", "updated_at": "2023-08-30T10:08:08.146343Z" } ``` ``` -------------------------------- ### Get DMS Files Changes Events Source: https://firm-pennylane.readme.io/reference/getdmsfileschanges Fetches a list of changes from DMS files, optionally filtered by a start date. Results are sorted by `processed_at` in ascending order and are retained for the last 4 weeks. ```APIDOC ## Get DMS Files Changes Events ### Description Returns the list of changes based on the provided `start_date`. If no `start_date` is provided it returns the oldest set of recorded changes. Changes for the last 4 weeks are retained. The items will be returned using `processed_at` in ASC order (oldest first). > ℹ️ > This endpoint requires one of the following scopes: `dms_files:all`, `dms_files:readonly` ### Method GET ### Endpoint `/dms/files/changes` ### Query Parameters - **start_date** (string) - Optional - The date from which to retrieve changes. Format: `YYYY-MM-DD`. ``` -------------------------------- ### Get DMS Files Changes Source: https://firm-pennylane.readme.io/reference/getdmsfileschanges Fetches a list of DMS file change events for a given company. You can filter by a start date and paginate results using a cursor. Changes are retained for the last 4 weeks and ordered by `processed_at`. ```APIDOC ## GET /api/external/firm/v1/companies/{company_id}/changelogs/dms_files ### Description Returns the list of changes based on the provided `start_date`. If no `start_date` is provided it returns the oldest set of recorded changes. Changes for the last 4 weeks are retained. The items will be returned using `processed_at` in ASC order (oldest first). > ℹ️ > This endpoint requires one of the following scopes: `dms_files:all`, `dms_files:readonly` ### Method GET ### Endpoint /api/external/firm/v1/companies/{company_id}/changelogs/dms_files ### Parameters #### Path Parameters - **company_id** (integer) - Required - Existing company identifier (id) #### Query Parameters - **cursor** (string) - Optional - Cursor for pagination. Use this to fetch the next set of results. The cursor is an opaque string returned in the previous response's metadata. Leave empty for the first request. - **limit** (integer) - Optional - Number of items to return per request. Defaults to 20 if not specified. Must be between 1 and 1000. - **start_date** (string) - Optional - Filter the changes based on the event date. The date should follow RFC3339 format. If no date is provided, the oldest changes will be returned. Changes for the last 4 weeks are retained, thus providing a `start_date` older than that will result in a 422 response. Providing both `start_date` and `cursor` parameters will result in a 400 response. ### Response #### Success Response (200) - **items** (array) - A list of DMS files changes - **id** (integer) - Unique identifier of the dms file record - **operation** (string) - Enum: "insert", "update", "delete" - **processed_at** (string) - Timestamp when the event arrived in the change log pipeline - **updated_at** (string) - Timestamp when the record was updated in the database (can vary due to data restoration) - **created_at** (string) - Timestamp when the record was initially created ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "items": [ { "id": 123, "operation": "update", "processed_at": "2025-06-25T11:54:18.589480Z", "updated_at": "2025-06-25T11:54:18.589480Z", "created_at": "2025-06-25T11:54:18.589480Z" } ] } ``` ``` -------------------------------- ### Create a ledger account Source: https://firm-pennylane.readme.io/reference Requires 'ledger_accounts:all' scope. Creates a new ledger account. ```APIDOC ## Create a ledger account ### Description Creates a ledger account. ### Method POST ### Endpoint /companies/{company_id}/ledger_accounts ``` -------------------------------- ### Create a ledger entry Source: https://firm-pennylane.readme.io/reference Requires 'ledger_entries:all' scope. Creates a new ledger entry. ```APIDOC ## Create a ledger entry ### Description Creates a ledger entry. ### Method POST ### Endpoint /companies/{company_id}/ledger_entries ``` -------------------------------- ### Get Customer by ID Source: https://firm-pennylane.readme.io/reference/getcustomers Retrieves a specific customer by their unique ID. Use this endpoint to get detailed information about a single customer. ```APIDOC ## GET /customers/{id} ### Description Retrieves a specific customer by their unique ID. ### Method GET ### Endpoint /customers/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the customer. ### Response #### Success Response (200) - **customer** (object) - The customer object with all its details. #### Response Example { "customer": { "id": 42, "name": "John Doe", "billing_iban": null, "payment_conditions": "upon_receipt", "recipient": { "address": "123 Main St", "postal_code": "10001", "city": "New York", "country_alpha2": "US" }, "phone": "+1234567890", "reference": "REF456", "notes": "Individual customer notes.", "vat_number": null, "reg_no": null, "ledger_account": "ACC456", "emails": [ "john.doe@example.com" ], "billing_address": { "address": "123 Main St", "postal_code": "10001", "city": "New York", "country_alpha2": "US" }, "delivery_address": { "address": "456 Delivery Ave", "postal_code": "10002", "city": "New York", "country_alpha2": "US" }, "created_at": "2023-08-30T10:08:08.146343Z", "updated_at": "2023-08-30T10:08:08.146343Z", "customer_type": "individual", "external_reference": "ext-ref-456", "billing_language": "en_GB" } } ``` -------------------------------- ### Create Company Source: https://firm-pennylane.readme.io/reference/companies-1 Creates a new company. ```APIDOC ## POST /companies ### Description Creates a new company. ### Method POST ### Endpoint /companies ### Request Body - **name** (string) - Required - The name of the company. ### Request Example { "name": "New Company" } ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created company. - **name** (string) - The name of the company. - **created_at** (string) - The timestamp when the company was created. - **updated_at** (string) - The timestamp when the company was last updated. #### Response Example { "id": "cmp_456", "name": "New Company", "created_at": "2023-01-02T10:00:00Z", "updated_at": "2023-01-02T10:00:00Z" } ``` -------------------------------- ### Get Company by ID Source: https://firm-pennylane.readme.io/reference/companies-1 Retrieves a specific company by its ID. ```APIDOC ## GET /companies/{company_id} ### Description Retrieves a specific company by its ID. ### Method GET ### Endpoint /companies/{company_id} ### Parameters #### Path Parameters - **company_id** (string) - Required - The unique identifier of the company. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the company. - **name** (string) - The name of the company. - **created_at** (string) - The timestamp when the company was created. - **updated_at** (string) - The timestamp when the company was last updated. #### Response Example { "id": "cmp_123", "name": "Acme Corp", "created_at": "2023-01-01T12:00:00Z", "updated_at": "2023-01-01T12:00:00Z" } ``` -------------------------------- ### List Ledger Entry Lines Source: https://firm-pennylane.readme.io/reference/getledgerentrylinesletteredledgerentrylines Fetches a paginated list of ledger entry lines for a given ledger entry. You can use `next_cursor` to retrieve subsequent pages. ```APIDOC ## GET /ledger_entries/{ledger_entry_id}/lines ### Description Retrieves a list of ledger entry lines for a specific ledger entry. ### Method GET ### Endpoint /ledger_entries/{ledger_entry_id}/lines ### Query Parameters - **limit** (integer) - Optional - The maximum number of items to return. Defaults to 25. - **cursor** (string) - Optional - The cursor for the next page of results. ### Response #### Success Response (200) - **has_more** (boolean) - Indicates if there are more results available. - **next_cursor** (string) - The cursor to use for fetching the next page of results. - **items** (array) - An array of ledger entry line objects. - **id** (string) - Unique identifier for the ledger entry line. - **debit** (number) - The debit amount. - **credit** (number) - The credit amount. - **label** (string) - A description or label for the entry line. - **ledger_account** (string) - The ID of the associated ledger account. - **journal** (string) - The ID of the journal this entry line belongs to. - **date** (string) - The date of the ledger entry line in ISO 8601 format. - **ledger_entry** (string) - The ID of the parent ledger entry. - **lettered_ledger_entry_lines** (array) - A list of lettered ledger entry lines associated with this entry. - **created_at** (string) - The timestamp when the entry line was created. - **updated_at** (string) - The timestamp when the entry line was last updated. #### Error Response (400) - **error** (string) - A message describing the error. - **status** (integer) - The HTTP status code. - **message** (string) - A detailed error message. - **code** (string) - An error code indicating the type of error (e.g., InvalidDateFormat, InvalidUUIDFormat). ``` -------------------------------- ### Create Ledger Entry Source: https://firm-pennylane.readme.io/reference/postledgerentries This endpoint allows you to create a new ledger entry. A ledger entry consists of a date, a label, a journal ID, and an array of ledger entry lines. Each ledger entry line must have a debit or credit amount, a ledger account ID, and an optional label. The entry lines must be balanced, and a maximum of 1000 lines can be created per request. ```APIDOC ## POST /ledger_entries ### Description Creates a new ledger entry with specified details. ### Method POST ### Endpoint /ledger_entries ### Request Body - **date** (string) - Required - The date of the ledger entry in YYYY-MM-DD format. - **label** (string) - Required - A label that describes the ledger entry. - **journal_id** (integer) - Required - The ID of the journal the entry belongs to. - **ledger_entry_lines** (array) - Required - An array of ledger entry lines. Maximum 1000 items. - **debit** (string) - Required - Debit amount for the entry line. Format: "100.00". - **credit** (string) - Required - Credit amount for the entry line. Format: "0.00". - **ledger_account_id** (integer) - Required - The ID of the ledger account. - **label** (string) - Optional - Label that describes the entry line. ### Request Example ```json { "date": "2023-10-27", "label": "Initial setup", "journal_id": 123, "ledger_entry_lines": [ { "debit": "100.00", "credit": "0.00", "ledger_account_id": 987, "label": "Transaction label" }, { "debit": "0.00", "credit": "100.00", "ledger_account_id": 654 } ] } ``` ### Response #### Success Response (201) - **id** (integer) - The ID of the created ledger entry. - **date** (string) - The date of the ledger entry. - **label** (string) - The label of the ledger entry. - **journal_id** (integer) - The ID of the journal. - **ledger_entry_lines** (array) - An array of ledger entry lines. - **id** (integer) - The ID of the ledger entry line. - **debit** (string) - The debit amount. - **credit** (string) - The credit amount. - **ledger_account_id** (integer) - The ID of the ledger account. - **label** (string) - The label of the entry line. #### Response Example ```json { "id": 1, "date": "2023-10-27", "label": "Initial setup", "journal_id": 123, "ledger_entry_lines": [ { "id": 1, "debit": "100.00", "credit": "0.00", "ledger_account_id": 987, "label": "Transaction label" }, { "id": 2, "debit": "0.00", "credit": "100.00", "ledger_account_id": 654, "label": null } ] } ``` ``` -------------------------------- ### Get Ledger Entry Source: https://firm-pennylane.readme.io/reference/getledgerentry Retrieves a specific entry from the ledger by its ID. ```APIDOC ## GET /ledger/{id} ### Description Retrieves a specific entry from the ledger by its ID. ### Method GET ### Endpoint /ledger/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the ledger entry. ### Response #### Success Response (200) - **entry** (object) - The ledger entry details. - **id** (string) - The unique identifier of the entry. - **timestamp** (string) - The timestamp of the entry. - **data** (object) - The data associated with the entry. #### Error Response (403) - **error** (string) - Description of the error. Example: "Access to this resource requires scope \"ledger\"." - **status** (integer) - The HTTP status code. Example: 403 #### Error Response (404) - **error** (string) - Description of the error. Example: "Not Found" - **status** (integer) - The HTTP status code. Example: 404 ``` -------------------------------- ### Get Journals Source: https://firm-pennylane.readme.io/reference/getjournals Retrieves a list of journals with optional filtering and pagination. ```APIDOC ## GET /journals ### Description Retrieves a list of journals. Supports filtering by `journal_id` and pagination using `limit` and `offset`. ### Method GET ### Endpoint /journals ### Query Parameters - **journal_id** (string) - Optional - Filters journals by their ID. - **limit** (integer) - Optional - Specifies the maximum number of journals to return. Defaults to 20. - **offset** (integer) - Optional - Specifies the number of journals to skip. Defaults to 0. ### Response #### Success Response (200) - **journals** (array) - A list of journal objects. - **journal_id** (string) - The unique identifier for the journal. - **name** (string) - The name of the journal. - **issn** (string) - The ISSN of the journal. #### Response Example { "journals": [ { "journal_id": "jrn_123", "name": "Journal of Science", "issn": "1234-5678" } ] } #### Error Response (400) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code (400). #### Error Response (404) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code (404). ``` -------------------------------- ### List Ledger Entry Lines Source: https://firm-pennylane.readme.io/reference/getledgerentrylines Fetches a list of ledger entry lines for a given company. Supports pagination, filtering by various fields, and sorting. ```APIDOC ## GET /api/external/firm/v1/companies/{company_id}/ledger_entry_lines ### Description List ledger entry lines > ℹ️ > This endpoint requires one of the following scopes: `ledger_entries:all`, `ledger_entries:readonly` ### Method GET ### Endpoint /api/external/firm/v1/companies/{company_id}/ledger_entry_lines ### Parameters #### Path Parameters - **company_id** (integer) - Required - Existing company identifier (id) #### Query Parameters - **cursor** (string) - Optional - Cursor for pagination. Use this to fetch the next set of results. The cursor is an opaque string returned in the previous response's metadata. Leave empty for the first request. - **limit** (integer) - Optional - Number of items to return per request. Defaults to 20 if not specified. Must be between 1 and 100. - **filter** (string) - Optional - You can choose to filter items on specific fields. Available fields : `id`, `journal_id`, `ledger_account_id`, `ledger_entry_id`, `date`. Available operators : `lt`, `lteq`, `gt`, `gteq`, `eq`, `not_eq`, `in`, `not_in` - **sort** (string) - Optional - You can choose to sort items on specific attributes. Sort field may be prefixed with `-` for descending order. Example : `id` will sort by ascending order, `-id` will sort by descending order. Available fields : `id`, `date`. Defaults to `-id`. ### Response #### Success Response (200) - **has_more** (boolean) - Indicates whether additional results are available beyond this set. Use this flag to determine if another request is needed. - **next_cursor** (string) - Cursor to retrieve the next set of results. Include this value in the cursor parameter of your next request to fetch subsequent items. A `null` `next_cursor` in the response indicates no further results. - **items** (array) - An array of ledger entry line objects. - **id** (integer) - ID of the entry line - **debit** (string) - Debit amount for the entry line - **credit** (string) - Credit amount for the entry line - **label** (string) - Description of the entry line - **date** (string) - Date of the entry line in YYYY-MM-DD format - **journal_id** (integer) - ID of the journal the entry line belongs to - **ledger_account_id** (integer) - ID of the ledger account the entry line belongs to - **ledger_entry_id** (integer) - ID of the ledger entry the entry line belongs to - **created_at** (string) - Timestamp of when the entry line was created - **updated_at** (string) - Timestamp of when the entry line was last updated #### Response Example { "has_more": true, "next_cursor": "dXBkYXRlZF9hdDoxNjc0MTIzNDU2", "items": [ { "id": 42, "debit": "100.00", "credit": "0.00", "label": "Example Label", "date": "2023-01-01", "journal_id": 1, "ledger_account_id": 10, "ledger_entry_id": 5, "created_at": "2023-01-01T10:00:00Z", "updated_at": "2023-01-01T10:00:00Z" } ] } ``` -------------------------------- ### Get All Category Groups Source: https://firm-pennylane.readme.io/reference/getcategorygroups Retrieves a list of all available category groups. ```APIDOC ## GET /category_groups ### Description Retrieves a list of all available category groups. ### Method GET ### Endpoint /category_groups ### Response #### Success Response (200) - **category_groups** (array) - A list of category group objects. - **id** (string) - The unique identifier for the category group. - **name** (string) - The name of the category group. #### Response Example { "category_groups": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Electronics" }, { "id": "123e4567-e89b-12d3-a456-426614174001", "name": "Books" } ] } #### Error Response (401) - **error** (string) - Description of the error. - **status** (integer) - The HTTP status code. #### Error Response Example { "error": "The access token is invalid", "status": 401 } ``` -------------------------------- ### Get Ledger Entry Line Changes Source: https://firm-pennylane.readme.io/reference/getledgerentrylinechanges Fetches ledger entry line changes. If `start_date` is not provided, it returns the oldest changes. Data is retained for 4 weeks and ordered by `processed_at`. ```APIDOC ## GET /ledger/entry_line_changes ### Description Returns the list of changes based on the provided `start_date`. If no `start_date` is provided it returns the oldest set of recorded changes. Changes for the last 4 weeks are retained. The items will be returned using `processed_at` in ASC order (oldest first). ### Method GET ### Endpoint /ledger/entry_line_changes ### Query Parameters - **start_date** (string) - Optional - The date from which to retrieve changes. Format YYYY-MM-DD. ### Request Example GET /ledger/entry_line_changes?start_date=2023-01-01 ### Response #### Success Response (200) - **changes** (array) - A list of ledger entry line change events. - **change** (object) - Represents a single change event. - **id** (string) - The unique identifier for the change. - **ledger_entry_id** (string) - The ID of the ledger entry affected. - **type** (string) - The type of change (e.g., 'created', 'updated', 'deleted'). - **processed_at** (string) - The timestamp when the change was processed. - **created_at** (string) - The timestamp when the change was created. - **updated_at** (string) - The timestamp when the change was last updated. #### Response Example { "changes": [ { "id": "chg_123", "ledger_entry_id": "le_456", "type": "updated", "processed_at": "2023-10-26T10:00:00Z", "created_at": "2023-10-26T09:59:00Z", "updated_at": "2023-10-26T10:00:00Z" } ] } > ℹ️ > This endpoint requires one of the following scopes: `ledger_entries:all`, `ledger_entries:readonly` ```