# RecurringLinesById Get a recurring by ID Returns the full representation of a single recurring contract, including its rows, accrual, tax reductions, calculated totals and any accumulated error logs. The `ETag` and `Last-Modified` response headers can be used for later conditional updates. ## Documentation Returns the full representation of a single recurring contract, including its rows, accrual, tax reductions, calculated totals and any accumulated error logs. The `ETag` and `Last-Modified` response headers can be used for later conditional updates. - Catalog: `Fortnox` - Schema: `RecurringBillings` This is a read-only table function. The Fortnox API may not support changing the data or the Invantive UniversalSQL driver for Fortnox does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Fortnox API. ## Parameters of Table Function The following parameters can be used to control the behaviour of the table function `RecurringLinesById`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values. Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three. Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third. | Name | Data Type | Required | Default Value | Documentation | |---|:---:|:---:|:---:|---| | `financialyear` | `` | ☐ | | Selects what financial year that should be used (does not work on every table). | | `financialyeardate` | `` | ☐ | | Selects by date, what financial year that should be used (does not work on every table). | | `fromdate` | `` | ☐ | | Defines a selection based on a start date. Only available for invoices, orders, offers, vouchers and supplierinvoices (does not work on every table). | | `lastmodified` | `` | ☐ | | Retrieves all records since the provided timestamp (does not work on every table). | | `recurring-id` | `` | ☑ | | The unique identifier of the recurring contract. | | `todate` | `` | ☐ | | Defines a selection based on an end date. Only available for invoices, orders, offers, vouchers and supplierinvoices (does not work on every table). | ## Columns of Table Function The columns of the table function `RecurringLinesById` are shown below. Each column has an SQL data type. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `account_number` | `int64` | Account Number | ☐ | General ledger account the row revenue is booked to. | | `accrual_created_at` | `datetime` | | ☐ | Timestamp when the accrual was created. Read-only. | | `accrual_id` | `guid` | | ☐ | Server-generated unique identifier of the accrual. | | `accrual_modified_at` | `datetime` | | ☐ | Timestamp when the accrual was last modified. Read-only. | | `accrual_recurring_id` | `guid` | | ☐ | Identifier of the recurring this accrual belongs to. Read-only. | | `amount_per_invoicing` | `int64` | | ☐ | Number of recurring periods combined onto a single invoice. For example, with a monthly recurring an amount of 3 invoices a full quarter at once. Must be between 1 and 12. Defaults to 1. | | `article_id` | `varchar2` | | ☐ | Reference to an article in the article register. When set, article defaults (price, account, unit) may be applied. | | `cost_center_id_2` | `varchar2` | | ☐ | Identifier of the cost center this row is booked against. Overrides the recurring-level cost center. | | `cost_center_id` | `varchar2` | | ☐ | Identifier of the cost center the recurring and its invoices are booked against. | | `created_at_2` | `datetime` | | ☐ | Timestamp when the recurring was created. Read-only. | | `created_at` | `datetime` | | ☐ | Timestamp when the row was created. Read-only. | | `created_by` | `varchar2` | | ☐ | Id of the user who created the recurring. Read-only. | | `currency` | `varchar2` | Currency | ☐ | ISO 4217 currency code the recurring is invoiced in (e.g. SEK, EUR). | | `customer_address` | `varchar2` | | ☐ | Street address of the customer. | | `customer_city` | `varchar2` | Customer City | ☐ | City of the customer address. | | `customer_country_code` | `varchar2` | | ☐ | ISO 3166-1 alpha-2 country code of the customer address. | | `customer_name` | `varchar2` | Customer Name | ☐ | Customer name printed on the invoice. | | `customer_number` | `varchar2` | Customer Number | ☐ | Customer number identifying the customer in the customer register. Required. | | `customer_phone` | `varchar2` | | ☐ | Customer phone number. | | `customer_zip` | `varchar2` | | ☐ | Postal/ZIP code of the customer address. | | `dates_dates_invoice_date` | `datetime` | | ☐ | The date printed on the invoice. Server-computed — not a client input. Null until it has been computed, and null when the recurring is FINISHED or has no further invoice. | | `dates_dates_invoice_processing_date` | `datetime` | | ☐ | The date the next invoice is generated and processed. | | `dates_dates_period_start_date` | `datetime` | | ☐ | The start date of the next billing period. | | `dates_rules_end_date` | `datetime` | | ☐ | The last date this recurring produces invoices. Omit for an open-ended recurring. | | `dates_rules_frequency` | `varchar2` | | ☐ | | | `dates_rules_interval` | `int64` | | ☐ | How many `frequency` units between occurrences. Combined with `frequency` this reads as "every {interval} {frequency}" — e.g. interval 2 with frequency MONTH means every 2 months. Defaults to 1. | | `dates_rules_invoice_anchor` | `varchar2` | | ☐ | | | `dates_rules_period_anchor` | `varchar2` | | ☐ | | | `delivery_address` | `varchar2` | | ☐ | Delivery street address. | | `delivery_city` | `varchar2` | | ☐ | City of the delivery address. | | `delivery_country_code` | `varchar2` | | ☐ | ISO 3166-1 alpha-2 country code of the delivery address. | | `delivery_name` | `varchar2` | | ☐ | Delivery recipient name. | | `delivery_phone` | `varchar2` | | ☐ | Contact phone number for the delivery. | | `delivery_term_code` | `varchar2` | | ☐ | Delivery terms code (e.g. Incoterm) printed on the invoice. | | `delivery_type_code` | `varchar2` | | ☐ | Delivery method/type code printed on the invoice. | | `delivery_zip` | `varchar2` | | ☐ | Postal/ZIP code of the delivery address. | | `description` | `varchar2` | Description | ☐ | Text describing the row, printed on the invoice. | | `discount_type` | `varchar2` | | ☐ | | | `discount` | `double` | Discount | ☐ | Discount applied to the row, interpreted according to discount_type. | | `distribution_method` | `varchar2` | | ☐ | | | `email_to` | `varchar2` | | ☐ | Recipient email address used to deliver the invoice when the distribution method is EMAIL. | | `id_2` | `guid` | ID | ☐ | Server-generated unique identifier of the recurring. | | `id` | `guid` | ID | ☐ | Server-generated unique identifier of the row. | | `invoice_handling` | `varchar2` | | ☐ | | | `modified_at_2` | `datetime` | | ☐ | Timestamp when the recurring was last modified. Read-only. | | `modified_at` | `datetime` | | ☐ | Timestamp when the row was last modified. Read-only. | | `modified_by` | `varchar2` | | ☐ | Id of the user who last modified the recurring. Read-only. | | `order_number` | `varchar2` | | ☐ | Customer purchase order number printed on the generated invoices. | | `our_reference` | `varchar2` | | ☐ | The seller's own reference (e.g. the responsible employee) printed on the invoice. | | `payment_terms` | `varchar2` | | ☐ | Payment terms applied to the generated invoices (e.g. days until due). | | `price_list_id` | `varchar2` | | ☐ | Identifier of the price list used to resolve article prices for this recurring. | | `price` | `double` | Price | ☐ | Unit price before discount and VAT. | | `print_configuration_language` | `varchar2` | | ☐ | | | `print_configuration_template` | `varchar2` | | ☐ | if no value provided its fetched from settings | | `project_id_2` | `varchar2` | | ☐ | Identifier of the project this row is booked against. Overrides the recurring-level project. | | `project_id` | `varchar2` | Project ID | ☐ | Identifier of the project the recurring and its invoices are booked against. | | `quantity` | `double` | Quantity | ☐ | Number of units invoiced for this row. | | `recurring_id` | `guid` | | ☐ | Identifier of the recurring this row belongs to. Read-only. | | `remark` | `varchar2` | | ☐ | Free-text remark printed on the generated invoices. | | `row_index` | `int64` | | ☐ | Zero-based position of the row within the recurring's row list, determining print order. | | `serial_number` | `int64` | | ☐ | Server-assigned sequential number identifying the recurring within the tenant. | | `status` | `varchar2` | Status | ☐ | | | `totals_excl_vat_2` | `double` | | ☐ | Total amount excluding VAT. | | `totals_excl_vat` | `double` | | ☐ | Row amount excluding VAT. | | `totals_incl_vat_2` | `double` | | ☐ | Total amount including VAT. | | `totals_incl_vat` | `double` | | ☐ | Row amount including VAT. | | `totals_roundoff` | `double` | | ☐ | Rounding adjustment applied to the total. | | `totals_vat_2` | `double` | | ☐ | Total VAT amount. | | `totals_vat` | `double` | | ☐ | Row VAT amount. | | `type` | `varchar2` | Type | ☐ | | | `unit` | `varchar2` | Unit | ☐ | Unit of measure for the quantity (e.g. "hour", "pcs"). | | `vat_option` | `varchar2` | | ☐ | | | `vat_payment_type` | `varchar2` | | ☐ | | | `vat_percentage` | `double` | | ☐ | VAT rate applied to the row, as a percentage. Typically one of 0, 6, 12 or 25. | | `your_reference` | `varchar2` | | ☐ | The customer's reference (e.g. their contact person) printed on the invoice. |