// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import * as WorkersAPI from './workers'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Vendor bills, including invoice and payment details */ export class Bills extends APIResource { /** * A list of bills. * * - Requires: `Spend Management Platform API` * - Filterable fields: `worker_id`, `entity_id`, `vendor_id`, `submitter_id`, * `invoice_date` * - Expandable fields: `worker`, `vendor`, `submitter` * - Sortable fields: `id`, `created_at`, `updated_at`, `invoice_date` * * @example HTTP * Representative request and response shapes. * ``` * GET /bills/?filter=filter&expand=expand&order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": {}, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "worker_id": "string", * "worker": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": {}, * "is_manager": "string", * "manager_id": "string", * "manager": {}, * "legal_entity_id": "string", * "legal_entity": {}, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": "string", * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": {}, * "employment_type_id": "string", * "employment_type": {}, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": {}, * "overtime_exemption": "EXEMPT" * }, * "company_amount": { * "currency_type": "string", * "value": "string" * }, * "merchant_amount": { * "currency_type": "string", * "value": "string" * }, * "accounting_date": "string", * "gl_sync_state": "NOT_FINALIZED", * "approval_status": "DRAFT", * "entity_id": "string", * "vendor": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "logo": "string", * "is_archived": "string" * }, * "gl_vendor": { * "id": "string", * "name": "string", * "gl_vendor_id": "string" * }, * "memo": "string", * "attachments": [ * {} * ], * "line_items": [ * {} * ], * "vendor_id": "string", * "transaction_type": "BILL_PAYMENT", * "submitter_id": "string", * "parent_bill_id": "string", * "submitter": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": {}, * "is_manager": "string", * "manager_id": "string", * "manager": {}, * "legal_entity_id": "string", * "legal_entity": {}, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": "string", * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": {}, * "employment_type_id": "string", * "employment_type": {}, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": {}, * "overtime_exemption": "EXEMPT", * "department_id": "string", * "department": {}, * "teams_id": [], * "teams": [], * "title": "string", * "title_effective_date": "string", * "level_id": "string", * "level": {}, * "job_function_id": "string", * "job_function": {}, * "termination_details": {}, * "pay_schedule_id": "string", * "work_schedule": {}, * "compensation_grade": {}, * "original_start_date": "string", * "custom_fields": [], * "country_fields": {}, * "business_partners_id": [], * "business_partners": [] * }, * "invoice_date": "string", * "invoice": { * "url": "string", * "file_name": "string" * }, * "payment_amount": { * "currency_type": "string", * "value": "string" * }, * "payment_method_fee": { * "currency_type": "string", * "value": "string" * }, * "invoice_number": "string", * "due_date": "string", * "vendor_paid_date": "string", * "scheduled_payment_date": "string", * "estimated_payment_arrival": "string", * "payment_velocity": "TWO_DAY", * "credit_method": "ACH", * "payment_schedule_setting": "SCHEDULE_NOW", * "vendor_memo": "string" * } * ], * "next_link": "string" * } * ``` */ list( query: BillListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/bills/', PageCursorURL, { query, ...options }); } /** * Retrieve a specific bill. Expandable fields: `worker`, `vendor`, `submitter`. * * @example HTTP * Representative request and response shapes. * ``` * GET /bills/{id}/?expand=expand HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * {} * ] * } * } * ``` */ retrieve( id: string, query: BillRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/bills/${id}/`, { query, ...options }); } /** * Updates a bill's line items. Send `line_items` as the full list of lines the * bill should have. A line with an `id` is updated and keeps that ID. A line * without an `id` is added, and the response includes its new ID. A line left out * is deleted, along with any purchase-order match or ERP link on it, as in the * bill editor. To keep a line as it is, send it back as GET returns it. Optional * fields that are omitted or null on a supplied line are cleared. `amount` and * `tax_amount` are decimal strings in the bill's merchant currency, such as * `"75.00"`; GET returns them as Currency objects. Line amounts must add up to the * bill's merchant amount. Lines sent without an `id` get new IDs on every * successful request, so after a timeout, GET the bill and send its current lines * instead of replaying the request. A line that GET returns with a null `id` * cannot be matched; sending it back replaces it with a new line and ID. Returns * 400 for a line `id` that is not on the bill, is repeated, or is not a valid ID, * and for amounts that do not add up. Returns 403 without write access to the * bill, or for a caller who is not a bill manager when the bill is outside * `DRAFT`, `PENDING`, or `CANCELLED`. * * @example HTTP * Representative request and response shapes. * ``` * PATCH /bills/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "worker_id": "string", * "worker": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "company_amount": {}, * "merchant_amount": {}, * "accounting_date": "string", * "gl_sync_state": "NOT_FINALIZED", * "approval_status": "DRAFT", * "entity_id": "string", * "vendor": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "gl_vendor": {}, * "memo": "string", * "attachments": [ * { * "url": "string" * } * ], * "line_items": [ * {} * ], * "vendor_id": "string", * "transaction_type": "BILL_PAYMENT", * "submitter_id": "string", * "parent_bill_id": "string", * "submitter": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "is_manager": false, * "manager_id": "string", * "manager": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "legal_entity_id": "string", * "legal_entity": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": 0, * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": { * "type": "REMOTE", * "work_location_id": "string" * }, * "employment_type_id": "string", * "employment_type": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "label": "string" * }, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "overtime_exemption": "EXEMPT", * "department_id": "string", * "department": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string" * }, * "teams_id": [ * "string" * ], * "teams": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string" * } * ], * "title": "string", * "title_effective_date": "string", * "level_id": "string", * "level": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string" * }, * "job_function_id": "string", * "job_function": { * "id": "string", * "created_at": "string", * "updated_at": "string" * }, * "termination_details": {}, * "pay_schedule_id": "string", * "work_schedule": {}, * "compensation_grade": { * "id": "string", * "label": "string" * }, * "original_start_date": "string", * "custom_fields": [ * null * ], * "country_fields": { * "us": { * "ssn": "string" * }, * "ca": { * "sin": "string" * }, * "nz": { * "ird_number": "string" * } * }, * "business_partners_id": [ * "string" * ], * "business_partners": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "business_partner_group_id": "string", * "business_partner_group": {}, * "worker_id": "string", * "worker": {}, * "client_group_id": "string", * "client_group": {}, * "client_group_member_count": "string" * } * ] * }, * "invoice_date": "string", * "invoice": { * "url": "string", * "file_name": "string" * }, * "payment_amount": { * "currency_type": "string", * "value": 0 * }, * "payment_method_fee": { * "currency_type": "string", * "value": 0 * }, * "invoice_number": "string", * "due_date": "string", * "vendor_paid_date": "string", * "scheduled_payment_date": "string", * "estimated_payment_arrival": "string", * "payment_velocity": "TWO_DAY", * "credit_method": "ACH", * "payment_schedule_setting": "SCHEDULE_NOW", * "vendor_memo": "string" * } * ``` */ update( id: string, body: BillUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/bills/${id}/`, { body, ...options }); } } export type BillListResponsesPageCursorURL = PageCursorURL; /** * A bill visible to the caller, including its invoice and payment details. */ export interface BillListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Date the transaction is booked in the accounting system, as an ISO 8601 date * (YYYY-MM-DD). */ accounting_date?: string; /** * Approval state of the bill. `DRAFT`: not submitted. `PENDING`: awaiting required * information before submission. `REQUESTED`: awaiting approval. `APPROVED`: * approved. `REJECTED`: rejected. `FINALIZED`: finalized for payment. `ACTIONED`: * paid. `CANCELLED`: cancelled. `FAILED`: payment failed. */ approval_status?: | 'DRAFT' | 'PENDING' | 'REQUESTED' | 'APPROVED' | 'REJECTED' | 'FINALIZED' | 'ACTIONED' | 'CANCELLED' | 'FAILED'; /** * Other attached files, including filenames and recorded upload metadata. */ attachments?: Array; /** * Amount in the company's headquarters currency. The `value` is a decimal string. */ company_amount?: BillListResponse.CompanyAmount; /** * How the vendor is paid: ACH, WIRE, CHECK, GLOBAL_ORDER, EXISTING_CORPORATE_CARD, * MANUALLY_PAID, or PAID_IN_FULL_VIA_VENDOR_CREDIT. GLOBAL_ORDER is an * international transfer. PAID_IN_FULL_VIA_VENDOR_CREDIT means vendor credits * cover the full bill, with no cash payment. */ credit_method?: | 'ACH' | 'WIRE' | 'CHECK' | 'GLOBAL_ORDER' | 'EXISTING_CORPORATE_CARD' | 'MANUALLY_PAID' | 'PAID_IN_FULL_VIA_VENDOR_CREDIT'; /** * Invoice due date, as an ISO 8601 date. A draft can omit it. */ due_date?: string; /** * ID of the legal entity the transaction belongs to. Use it with * `/company-legal-entities/{id}/`. */ entity_id?: string; /** * Date the vendor is expected to receive the payment, as an ISO 8601 date. Null * when not set. */ estimated_payment_arrival?: string; /** * State of the sync to the accounting system. `NOT_FINALIZED`: not ready for * accounting review. `FOR_REVIEW`: ready for accounting review. `PENDING_SYNC`: * sync is in progress. `SYNCED`: synced to the accounting system. `ERROR`: sync * failed. `DO_NOT_SYNC`: marked to be excluded from sync. `EXPORTED`: exported for * accounting. `NOT_SYNCABLE`: this record cannot be synced. `AUTO_SYNC`: ready to * be synced automatically. Null when no sync state is set. */ gl_sync_state?: | 'NOT_FINALIZED' | 'FOR_REVIEW' | 'PENDING_SYNC' | 'SYNCED' | 'ERROR' | 'DO_NOT_SYNC' | 'EXPORTED' | 'NOT_SYNCABLE' | 'AUTO_SYNC'; /** * Vendor in the connected accounting system. */ gl_vendor?: BillListResponse.GlVendor; /** * Invoice file and its filename. */ invoice?: BillListResponse.Invoice; /** * Invoice date, as an ISO 8601 date (YYYY-MM-DD). Null when not set. Filters * compare UTC calendar days: `eq` includes the whole day, `gt` starts the * following day, and `lt` excludes the specified day. `ge` and `le` include the * specified day; `in` matches any listed day. */ invoice_date?: string; /** * Invoice number. Null when the bill has no invoice number. */ invoice_number?: string; /** * Category splits of the bill amount. */ line_items?: Array; /** * Memo entered on the transaction. */ memo?: string; /** * Amount charged by the merchant, in the merchant currency. The `value` is a * decimal string. */ merchant_amount?: BillListResponse.MerchantAmount; /** * ID of the bill this payment was split from. Use it with `/bills/{id}/`. Null * when it is not a split bill. */ parent_bill_id?: string; /** * Amount paid to the vendor, in the payment currency. The `value` is a decimal * string. */ payment_amount?: BillListResponse.PaymentAmount; /** * Payment method fee, in the company's headquarters currency. The `value` is a * decimal string. Zero when there is no fee. */ payment_method_fee?: BillListResponse.PaymentMethodFee; /** * Payment scheduling choice: `SCHEDULE_NOW` to schedule payment, or `SKIP_FOR_NOW` * to defer scheduling. */ payment_schedule_setting?: 'SCHEDULE_NOW' | 'SKIP_FOR_NOW'; /** * Payment speed option: `TWO_DAY` (accelerated) or `FOUR_DAY` (standard). Use * `estimated_payment_arrival` for the expected arrival date. */ payment_velocity?: 'TWO_DAY' | 'FOUR_DAY'; /** * Date used to estimate vendor payment, as an ISO 8601 date. Null when not set. */ scheduled_payment_date?: string; /** * Submitting bill manager. Expand with `bills.read` and `workers.read`. * * Expandable field */ submitter?: WorkersAPI.Worker; /** * ID of the bill manager who submitted the bill. Use it with `/workers/{id}/`. Can * differ from `worker_id`. Null before submission. */ submitter_id?: string; /** * Type of transaction: `BILL_PAYMENT`. */ transaction_type?: 'BILL_PAYMENT'; /** * Vendor details. Expand with `bills.read` and `finance-vendors.read`. * * Expandable field */ vendor?: BillListResponse.Vendor; /** * ID of the Finance vendor. Use it with `/finance-vendors/{id}/`. */ vendor_id?: string; /** * Memo included on the payment to the vendor. Supported for ACH; null when not * set. */ vendor_memo?: string; /** * Date the vendor is paid, as an ISO 8601 date. Null until paid. */ vendor_paid_date?: string; /** * Worker details. Expand with `bills.read` and `workers.read`. * * Expandable field */ worker?: WorkersAPI.Worker; /** * ID of the worker who made the transaction. Use it with `/workers/{id}/`. */ worker_id?: string; } export namespace BillListResponse { /** * A Finance transaction attachment with recorded upload details. */ export interface Attachment { /** * URL for accessing the file. */ url: string; /** * Original file name, when recorded. */ file_name?: string; /** * When the attachment was uploaded, as an ISO 8601 date-time in UTC, when * recorded. */ uploaded_at?: string; /** * ID of the worker who uploaded the attachment. Use it with `/workers/{id}/`. */ uploaded_by_id?: string; } /** * Amount in the company's headquarters currency. The `value` is a decimal string. */ export interface CompanyAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Vendor in the connected accounting system. */ export interface GlVendor { /** * ID of the accounting vendor in Rippling. */ id?: string; /** * ID of the vendor in the accounting system. */ gl_vendor_id?: string; /** * Name of the vendor in the accounting system. */ name?: string; } /** * Invoice file and its filename. */ export interface Invoice { /** * URL for accessing the file. */ url: string; /** * Original file name, when recorded. */ file_name?: string; } export interface LineItem { /** * Unique identifier of this line item. Null for older line items that have not * been assigned one yet. */ id?: string; /** * Whether this line is amortized. */ amortized?: boolean; /** * Amount of this split, in the merchant currency. The `value` is a decimal string. */ amount?: LineItem.Amount; /** * ID of the Finance category assigned to this split. Use it with * `/finance-categories/{id}/`. The category name is in `category_name`. */ category_id?: string; /** * Name of the finance category. */ category_name?: string; /** * Selected dimension values, keyed by dimension ID. `DEPARTMENT` and * `WORK_LOCATION` are the built-in keys. Get custom dimension IDs from * `/job-dimensions/` and `/job-dimensions/{id}/`. Each choice `value` is a job * code ID from `/job-codes/` and `/job-codes/{id}/`. */ dimension_choices?: { [key: string]: LineItem.DimensionChoices }; /** * End of the amortization period (YYYY-MM-DD). */ end_date?: string; /** * ERP amortization schedule associated with this line. */ gl_amortization_schedule?: LineItem.GlAmortizationSchedule; /** * ERP amortization template for this line. */ gl_amortization_template?: LineItem.GlAmortizationTemplate; /** * Whether this split is billed to `gl_customer` in the accounting system. * `BILLABLE` means it is billed, `NOT_BILLABLE` means it is not. Null when not * set. */ gl_billable?: 'BILLABLE' | 'NOT_BILLABLE'; /** * ID of the customer record in the connected accounting integration. No public * Rippling API is currently available to retrieve this accounting customer. */ gl_customer?: string; /** * Rippling ID of the accounting tax code. No public Rippling API is currently * available to retrieve this accounting tax code. */ gl_tax_code?: string; /** * Memo entered on this split. */ memo?: string; /** * Prepaid asset account for Rippling-managed amortization. */ prepaid_account?: LineItem.PrepaidAccount; /** * Start of the amortization period (YYYY-MM-DD). */ start_date?: string; /** * Total tax amount for this line in the merchant currency. */ tax_amount?: LineItem.TaxAmount; } export namespace LineItem { /** * Amount of this split, in the merchant currency. The `value` is a decimal string. */ export interface Amount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } export interface DimensionChoices { /** * Name of the dimension, such as Department. */ dimension_name?: string; /** * Display name of the selected dimension value. */ label?: string; /** * ID of the selected value. For `DEPARTMENT` use `/departments/{id}/`, for * `WORK_LOCATION` use `/work-locations/{id}/`, and for a custom job dimension use * `/job-codes/{id}/`. */ value?: string; } /** * ERP amortization schedule associated with this line. */ export interface GlAmortizationSchedule { /** * Rippling ID of the accounting integration that owns this object. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Number of amortization periods. */ amortization_period?: number; /** * End of the ERP amortization schedule as an ISO 8601 timestamp (for example, * 2026-12-31T00:00:00). May omit a timezone offset; an omitted offset does not * indicate UTC. Null when not set. */ end_date?: string; /** * Object ID in the connected accounting system. */ gl_object_id?: string; /** * Type of object in the connected accounting system: GL_AMORTIZATION_TEMPLATE * defines amortization rules; GL_AMORTIZATION_SCHEDULE tracks amortization; * GL_AMORTIZATION_SCHEDULE_RECURRENCE is a schedule entry; GL_ACCOUNT is a general * ledger account; GL_JOURNAL_ENTRY is a journal entry; GL_POSTING_PERIOD is an * accounting period; GL_VENDOR, GL_CUSTOMER, and GL_EMPLOYEE identify a vendor, * customer, and employee respectively; GL_SUBSIDIARY identifies a subsidiary. Null * when not set. */ gl_object_type?: | 'GL_AMORTIZATION_TEMPLATE' | 'GL_AMORTIZATION_SCHEDULE' | 'GL_AMORTIZATION_SCHEDULE_RECURRENCE' | 'GL_ACCOUNT' | 'GL_JOURNAL_ENTRY' | 'GL_POSTING_PERIOD' | 'GL_VENDOR' | 'GL_CUSTOMER' | 'GL_EMPLOYEE' | 'GL_SUBSIDIARY'; /** * Accounting object name. */ name?: string; /** * Start of the ERP amortization schedule as an ISO 8601 timestamp (for example, * 2026-01-01T00:00:00). May omit a timezone offset; an omitted offset does not * indicate UTC. Null when not set. */ start_date?: string; /** * ERP amortization schedule status: NOT_STARTED means amortization has not begun; * IN_PROGRESS means amortization is underway; COMPLETED means amortization is * complete; ON_HOLD means amortization is paused. Null when not set. */ status?: 'NOT_STARTED' | 'IN_PROGRESS' | 'COMPLETED' | 'ON_HOLD'; /** * Amount already amortized as reported by the ERP, in the same currency as * total_amount. No currency conversion is applied; the schedule currency code is * not available in this response. */ total_amortized_amount?: number; /** * Total schedule amount as reported by the ERP, without currency conversion. The * schedule currency code is not available in this response. */ total_amount?: number; } /** * ERP amortization template for this line. */ export interface GlAmortizationTemplate { /** * Rippling ID of the accounting integration that owns this object. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Object ID in the connected accounting system. */ gl_object_id?: string; /** * Type of object in the connected accounting system: GL_AMORTIZATION_TEMPLATE * defines amortization rules; GL_AMORTIZATION_SCHEDULE tracks amortization; * GL_AMORTIZATION_SCHEDULE_RECURRENCE is a schedule entry; GL_ACCOUNT is a general * ledger account; GL_JOURNAL_ENTRY is a journal entry; GL_POSTING_PERIOD is an * accounting period; GL_VENDOR, GL_CUSTOMER, and GL_EMPLOYEE identify a vendor, * customer, and employee respectively; GL_SUBSIDIARY identifies a subsidiary. Null * when not set. */ gl_object_type?: | 'GL_AMORTIZATION_TEMPLATE' | 'GL_AMORTIZATION_SCHEDULE' | 'GL_AMORTIZATION_SCHEDULE_RECURRENCE' | 'GL_ACCOUNT' | 'GL_JOURNAL_ENTRY' | 'GL_POSTING_PERIOD' | 'GL_VENDOR' | 'GL_CUSTOMER' | 'GL_EMPLOYEE' | 'GL_SUBSIDIARY'; /** * Accounting object name. */ name?: string; } /** * Prepaid asset account for Rippling-managed amortization. */ export interface PrepaidAccount { /** * Account ID in the connected accounting system. */ account_id?: string; /** * Account code. */ code?: string; /** * Account name. */ name?: string; /** * IDs of custom dimensions required by this account. */ required_custom_dimensions?: Array; /** * Whether this account requires a department. */ requires_department?: boolean; /** * Whether this account requires a work location. */ requires_work_location?: boolean; /** * Accounting account type: RECEIVABLE for accounts receivable, PAYABLE for * accounts payable, EXPENSE for expense accounts, or BANK for bank accounts. Null * when not set. */ type?: 'RECEIVABLE' | 'PAYABLE' | 'EXPENSE' | 'BANK'; } /** * Total tax amount for this line in the merchant currency. */ export interface TaxAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } } /** * Amount charged by the merchant, in the merchant currency. The `value` is a * decimal string. */ export interface MerchantAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Amount paid to the vendor, in the payment currency. The `value` is a decimal * string. */ export interface PaymentAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Payment method fee, in the company's headquarters currency. The `value` is a * decimal string. Zero when there is no fee. */ export interface PaymentMethodFee { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Vendor details. Expand with `bills.read` and `finance-vendors.read`. * * Expandable field */ export interface Vendor { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether the vendor is archived. Archived vendors remain available for historical * references. */ is_archived?: boolean; /** * URL of the vendor's logo. Null when no logo is available. */ logo?: string; /** * Canonical name of the Finance vendor. Name eq, ne, and in filters also match * alternate names. */ name?: string; } } /** * Meta information for the response. */ export interface BillRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Date the transaction is booked in the accounting system, as an ISO 8601 date * (YYYY-MM-DD). */ accounting_date?: string; /** * Approval state of the bill. `DRAFT`: not submitted. `PENDING`: awaiting required * information before submission. `REQUESTED`: awaiting approval. `APPROVED`: * approved. `REJECTED`: rejected. `FINALIZED`: finalized for payment. `ACTIONED`: * paid. `CANCELLED`: cancelled. `FAILED`: payment failed. */ approval_status?: | 'DRAFT' | 'PENDING' | 'REQUESTED' | 'APPROVED' | 'REJECTED' | 'FINALIZED' | 'ACTIONED' | 'CANCELLED' | 'FAILED'; /** * Other attached files, including filenames and recorded upload metadata. */ attachments?: Array; /** * Amount in the company's headquarters currency. The `value` is a decimal string. */ company_amount?: BillRetrieveResponse.CompanyAmount; /** * How the vendor is paid: ACH, WIRE, CHECK, GLOBAL_ORDER, EXISTING_CORPORATE_CARD, * MANUALLY_PAID, or PAID_IN_FULL_VIA_VENDOR_CREDIT. GLOBAL_ORDER is an * international transfer. PAID_IN_FULL_VIA_VENDOR_CREDIT means vendor credits * cover the full bill, with no cash payment. */ credit_method?: | 'ACH' | 'WIRE' | 'CHECK' | 'GLOBAL_ORDER' | 'EXISTING_CORPORATE_CARD' | 'MANUALLY_PAID' | 'PAID_IN_FULL_VIA_VENDOR_CREDIT'; /** * Invoice due date, as an ISO 8601 date. A draft can omit it. */ due_date?: string; /** * ID of the legal entity the transaction belongs to. Use it with * `/company-legal-entities/{id}/`. */ entity_id?: string; /** * Date the vendor is expected to receive the payment, as an ISO 8601 date. Null * when not set. */ estimated_payment_arrival?: string; /** * State of the sync to the accounting system. `NOT_FINALIZED`: not ready for * accounting review. `FOR_REVIEW`: ready for accounting review. `PENDING_SYNC`: * sync is in progress. `SYNCED`: synced to the accounting system. `ERROR`: sync * failed. `DO_NOT_SYNC`: marked to be excluded from sync. `EXPORTED`: exported for * accounting. `NOT_SYNCABLE`: this record cannot be synced. `AUTO_SYNC`: ready to * be synced automatically. Null when no sync state is set. */ gl_sync_state?: | 'NOT_FINALIZED' | 'FOR_REVIEW' | 'PENDING_SYNC' | 'SYNCED' | 'ERROR' | 'DO_NOT_SYNC' | 'EXPORTED' | 'NOT_SYNCABLE' | 'AUTO_SYNC'; /** * Vendor in the connected accounting system. */ gl_vendor?: BillRetrieveResponse.GlVendor; /** * Invoice file and its filename. */ invoice?: BillRetrieveResponse.Invoice; /** * Invoice date, as an ISO 8601 date (YYYY-MM-DD). Null when not set. Filters * compare UTC calendar days: `eq` includes the whole day, `gt` starts the * following day, and `lt` excludes the specified day. `ge` and `le` include the * specified day; `in` matches any listed day. */ invoice_date?: string; /** * Invoice number. Null when the bill has no invoice number. */ invoice_number?: string; /** * Category splits of the bill amount. */ line_items?: Array; /** * Memo entered on the transaction. */ memo?: string; /** * Amount charged by the merchant, in the merchant currency. The `value` is a * decimal string. */ merchant_amount?: BillRetrieveResponse.MerchantAmount; /** * ID of the bill this payment was split from. Use it with `/bills/{id}/`. Null * when it is not a split bill. */ parent_bill_id?: string; /** * Amount paid to the vendor, in the payment currency. The `value` is a decimal * string. */ payment_amount?: BillRetrieveResponse.PaymentAmount; /** * Payment method fee, in the company's headquarters currency. The `value` is a * decimal string. Zero when there is no fee. */ payment_method_fee?: BillRetrieveResponse.PaymentMethodFee; /** * Payment scheduling choice: `SCHEDULE_NOW` to schedule payment, or `SKIP_FOR_NOW` * to defer scheduling. */ payment_schedule_setting?: 'SCHEDULE_NOW' | 'SKIP_FOR_NOW'; /** * Payment speed option: `TWO_DAY` (accelerated) or `FOUR_DAY` (standard). Use * `estimated_payment_arrival` for the expected arrival date. */ payment_velocity?: 'TWO_DAY' | 'FOUR_DAY'; /** * Date used to estimate vendor payment, as an ISO 8601 date. Null when not set. */ scheduled_payment_date?: string; /** * Submitting bill manager. Expand with `bills.read` and `workers.read`. * * Expandable field */ submitter?: WorkersAPI.Worker; /** * ID of the bill manager who submitted the bill. Use it with `/workers/{id}/`. Can * differ from `worker_id`. Null before submission. */ submitter_id?: string; /** * Type of transaction: `BILL_PAYMENT`. */ transaction_type?: 'BILL_PAYMENT'; /** * Vendor details. Expand with `bills.read` and `finance-vendors.read`. * * Expandable field */ vendor?: BillRetrieveResponse.Vendor; /** * ID of the Finance vendor. Use it with `/finance-vendors/{id}/`. */ vendor_id?: string; /** * Memo included on the payment to the vendor. Supported for ACH; null when not * set. */ vendor_memo?: string; /** * Date the vendor is paid, as an ISO 8601 date. Null until paid. */ vendor_paid_date?: string; /** * Worker details. Expand with `bills.read` and `workers.read`. * * Expandable field */ worker?: WorkersAPI.Worker; /** * ID of the worker who made the transaction. Use it with `/workers/{id}/`. */ worker_id?: string; } export namespace BillRetrieveResponse { /** * A Finance transaction attachment with recorded upload details. */ export interface Attachment { /** * URL for accessing the file. */ url: string; /** * Original file name, when recorded. */ file_name?: string; /** * When the attachment was uploaded, as an ISO 8601 date-time in UTC, when * recorded. */ uploaded_at?: string; /** * ID of the worker who uploaded the attachment. Use it with `/workers/{id}/`. */ uploaded_by_id?: string; } /** * Amount in the company's headquarters currency. The `value` is a decimal string. */ export interface CompanyAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Vendor in the connected accounting system. */ export interface GlVendor { /** * ID of the accounting vendor in Rippling. */ id?: string; /** * ID of the vendor in the accounting system. */ gl_vendor_id?: string; /** * Name of the vendor in the accounting system. */ name?: string; } /** * Invoice file and its filename. */ export interface Invoice { /** * URL for accessing the file. */ url: string; /** * Original file name, when recorded. */ file_name?: string; } export interface LineItem { /** * Unique identifier of this line item. Null for older line items that have not * been assigned one yet. */ id?: string; /** * Whether this line is amortized. */ amortized?: boolean; /** * Amount of this split, in the merchant currency. The `value` is a decimal string. */ amount?: LineItem.Amount; /** * ID of the Finance category assigned to this split. Use it with * `/finance-categories/{id}/`. The category name is in `category_name`. */ category_id?: string; /** * Name of the finance category. */ category_name?: string; /** * Selected dimension values, keyed by dimension ID. `DEPARTMENT` and * `WORK_LOCATION` are the built-in keys. Get custom dimension IDs from * `/job-dimensions/` and `/job-dimensions/{id}/`. Each choice `value` is a job * code ID from `/job-codes/` and `/job-codes/{id}/`. */ dimension_choices?: { [key: string]: LineItem.DimensionChoices }; /** * End of the amortization period (YYYY-MM-DD). */ end_date?: string; /** * ERP amortization schedule associated with this line. */ gl_amortization_schedule?: LineItem.GlAmortizationSchedule; /** * ERP amortization template for this line. */ gl_amortization_template?: LineItem.GlAmortizationTemplate; /** * Whether this split is billed to `gl_customer` in the accounting system. * `BILLABLE` means it is billed, `NOT_BILLABLE` means it is not. Null when not * set. */ gl_billable?: 'BILLABLE' | 'NOT_BILLABLE'; /** * ID of the customer record in the connected accounting integration. No public * Rippling API is currently available to retrieve this accounting customer. */ gl_customer?: string; /** * Rippling ID of the accounting tax code. No public Rippling API is currently * available to retrieve this accounting tax code. */ gl_tax_code?: string; /** * Memo entered on this split. */ memo?: string; /** * Prepaid asset account for Rippling-managed amortization. */ prepaid_account?: LineItem.PrepaidAccount; /** * Start of the amortization period (YYYY-MM-DD). */ start_date?: string; /** * Total tax amount for this line in the merchant currency. */ tax_amount?: LineItem.TaxAmount; } export namespace LineItem { /** * Amount of this split, in the merchant currency. The `value` is a decimal string. */ export interface Amount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } export interface DimensionChoices { /** * Name of the dimension, such as Department. */ dimension_name?: string; /** * Display name of the selected dimension value. */ label?: string; /** * ID of the selected value. For `DEPARTMENT` use `/departments/{id}/`, for * `WORK_LOCATION` use `/work-locations/{id}/`, and for a custom job dimension use * `/job-codes/{id}/`. */ value?: string; } /** * ERP amortization schedule associated with this line. */ export interface GlAmortizationSchedule { /** * Rippling ID of the accounting integration that owns this object. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Number of amortization periods. */ amortization_period?: number; /** * End of the ERP amortization schedule as an ISO 8601 timestamp (for example, * 2026-12-31T00:00:00). May omit a timezone offset; an omitted offset does not * indicate UTC. Null when not set. */ end_date?: string; /** * Object ID in the connected accounting system. */ gl_object_id?: string; /** * Type of object in the connected accounting system: GL_AMORTIZATION_TEMPLATE * defines amortization rules; GL_AMORTIZATION_SCHEDULE tracks amortization; * GL_AMORTIZATION_SCHEDULE_RECURRENCE is a schedule entry; GL_ACCOUNT is a general * ledger account; GL_JOURNAL_ENTRY is a journal entry; GL_POSTING_PERIOD is an * accounting period; GL_VENDOR, GL_CUSTOMER, and GL_EMPLOYEE identify a vendor, * customer, and employee respectively; GL_SUBSIDIARY identifies a subsidiary. Null * when not set. */ gl_object_type?: | 'GL_AMORTIZATION_TEMPLATE' | 'GL_AMORTIZATION_SCHEDULE' | 'GL_AMORTIZATION_SCHEDULE_RECURRENCE' | 'GL_ACCOUNT' | 'GL_JOURNAL_ENTRY' | 'GL_POSTING_PERIOD' | 'GL_VENDOR' | 'GL_CUSTOMER' | 'GL_EMPLOYEE' | 'GL_SUBSIDIARY'; /** * Accounting object name. */ name?: string; /** * Start of the ERP amortization schedule as an ISO 8601 timestamp (for example, * 2026-01-01T00:00:00). May omit a timezone offset; an omitted offset does not * indicate UTC. Null when not set. */ start_date?: string; /** * ERP amortization schedule status: NOT_STARTED means amortization has not begun; * IN_PROGRESS means amortization is underway; COMPLETED means amortization is * complete; ON_HOLD means amortization is paused. Null when not set. */ status?: 'NOT_STARTED' | 'IN_PROGRESS' | 'COMPLETED' | 'ON_HOLD'; /** * Amount already amortized as reported by the ERP, in the same currency as * total_amount. No currency conversion is applied; the schedule currency code is * not available in this response. */ total_amortized_amount?: number; /** * Total schedule amount as reported by the ERP, without currency conversion. The * schedule currency code is not available in this response. */ total_amount?: number; } /** * ERP amortization template for this line. */ export interface GlAmortizationTemplate { /** * Rippling ID of the accounting integration that owns this object. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Object ID in the connected accounting system. */ gl_object_id?: string; /** * Type of object in the connected accounting system: GL_AMORTIZATION_TEMPLATE * defines amortization rules; GL_AMORTIZATION_SCHEDULE tracks amortization; * GL_AMORTIZATION_SCHEDULE_RECURRENCE is a schedule entry; GL_ACCOUNT is a general * ledger account; GL_JOURNAL_ENTRY is a journal entry; GL_POSTING_PERIOD is an * accounting period; GL_VENDOR, GL_CUSTOMER, and GL_EMPLOYEE identify a vendor, * customer, and employee respectively; GL_SUBSIDIARY identifies a subsidiary. Null * when not set. */ gl_object_type?: | 'GL_AMORTIZATION_TEMPLATE' | 'GL_AMORTIZATION_SCHEDULE' | 'GL_AMORTIZATION_SCHEDULE_RECURRENCE' | 'GL_ACCOUNT' | 'GL_JOURNAL_ENTRY' | 'GL_POSTING_PERIOD' | 'GL_VENDOR' | 'GL_CUSTOMER' | 'GL_EMPLOYEE' | 'GL_SUBSIDIARY'; /** * Accounting object name. */ name?: string; } /** * Prepaid asset account for Rippling-managed amortization. */ export interface PrepaidAccount { /** * Account ID in the connected accounting system. */ account_id?: string; /** * Account code. */ code?: string; /** * Account name. */ name?: string; /** * IDs of custom dimensions required by this account. */ required_custom_dimensions?: Array; /** * Whether this account requires a department. */ requires_department?: boolean; /** * Whether this account requires a work location. */ requires_work_location?: boolean; /** * Accounting account type: RECEIVABLE for accounts receivable, PAYABLE for * accounts payable, EXPENSE for expense accounts, or BANK for bank accounts. Null * when not set. */ type?: 'RECEIVABLE' | 'PAYABLE' | 'EXPENSE' | 'BANK'; } /** * Total tax amount for this line in the merchant currency. */ export interface TaxAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } } /** * Amount charged by the merchant, in the merchant currency. The `value` is a * decimal string. */ export interface MerchantAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Amount paid to the vendor, in the payment currency. The `value` is a decimal * string. */ export interface PaymentAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Payment method fee, in the company's headquarters currency. The `value` is a * decimal string. Zero when there is no fee. */ export interface PaymentMethodFee { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Vendor details. Expand with `bills.read` and `finance-vendors.read`. * * Expandable field */ export interface Vendor { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether the vendor is archived. Archived vendors remain available for historical * references. */ is_archived?: boolean; /** * URL of the vendor's logo. Null when no logo is available. */ logo?: string; /** * Canonical name of the Finance vendor. Name eq, ne, and in filters also match * alternate names. */ name?: string; } } /** * A bill visible to the caller, including its invoice and payment details. */ export interface BillUpdateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Date the transaction is booked in the accounting system, as an ISO 8601 date * (YYYY-MM-DD). */ accounting_date?: string; /** * Approval state of the bill. `DRAFT`: not submitted. `PENDING`: awaiting required * information before submission. `REQUESTED`: awaiting approval. `APPROVED`: * approved. `REJECTED`: rejected. `FINALIZED`: finalized for payment. `ACTIONED`: * paid. `CANCELLED`: cancelled. `FAILED`: payment failed. */ approval_status?: | 'DRAFT' | 'PENDING' | 'REQUESTED' | 'APPROVED' | 'REJECTED' | 'FINALIZED' | 'ACTIONED' | 'CANCELLED' | 'FAILED'; /** * Other attached files, including filenames and recorded upload metadata. */ attachments?: Array; /** * Amount in the company's headquarters currency. The `value` is a decimal string. */ company_amount?: BillUpdateResponse.CompanyAmount; /** * How the vendor is paid: ACH, WIRE, CHECK, GLOBAL_ORDER, EXISTING_CORPORATE_CARD, * MANUALLY_PAID, or PAID_IN_FULL_VIA_VENDOR_CREDIT. GLOBAL_ORDER is an * international transfer. PAID_IN_FULL_VIA_VENDOR_CREDIT means vendor credits * cover the full bill, with no cash payment. */ credit_method?: | 'ACH' | 'WIRE' | 'CHECK' | 'GLOBAL_ORDER' | 'EXISTING_CORPORATE_CARD' | 'MANUALLY_PAID' | 'PAID_IN_FULL_VIA_VENDOR_CREDIT'; /** * Invoice due date, as an ISO 8601 date. A draft can omit it. */ due_date?: string; /** * ID of the legal entity the transaction belongs to. Use it with * `/company-legal-entities/{id}/`. */ entity_id?: string; /** * Date the vendor is expected to receive the payment, as an ISO 8601 date. Null * when not set. */ estimated_payment_arrival?: string; /** * State of the sync to the accounting system. `NOT_FINALIZED`: not ready for * accounting review. `FOR_REVIEW`: ready for accounting review. `PENDING_SYNC`: * sync is in progress. `SYNCED`: synced to the accounting system. `ERROR`: sync * failed. `DO_NOT_SYNC`: marked to be excluded from sync. `EXPORTED`: exported for * accounting. `NOT_SYNCABLE`: this record cannot be synced. `AUTO_SYNC`: ready to * be synced automatically. Null when no sync state is set. */ gl_sync_state?: | 'NOT_FINALIZED' | 'FOR_REVIEW' | 'PENDING_SYNC' | 'SYNCED' | 'ERROR' | 'DO_NOT_SYNC' | 'EXPORTED' | 'NOT_SYNCABLE' | 'AUTO_SYNC'; /** * Vendor in the connected accounting system. */ gl_vendor?: BillUpdateResponse.GlVendor; /** * Invoice file and its filename. */ invoice?: BillUpdateResponse.Invoice; /** * Invoice date, as an ISO 8601 date (YYYY-MM-DD). Null when not set. Filters * compare UTC calendar days: `eq` includes the whole day, `gt` starts the * following day, and `lt` excludes the specified day. `ge` and `le` include the * specified day; `in` matches any listed day. */ invoice_date?: string; /** * Invoice number. Null when the bill has no invoice number. */ invoice_number?: string; /** * Category splits of the bill amount. */ line_items?: Array; /** * Memo entered on the transaction. */ memo?: string; /** * Amount charged by the merchant, in the merchant currency. The `value` is a * decimal string. */ merchant_amount?: BillUpdateResponse.MerchantAmount; /** * ID of the bill this payment was split from. Use it with `/bills/{id}/`. Null * when it is not a split bill. */ parent_bill_id?: string; /** * Amount paid to the vendor, in the payment currency. The `value` is a decimal * string. */ payment_amount?: BillUpdateResponse.PaymentAmount; /** * Payment method fee, in the company's headquarters currency. The `value` is a * decimal string. Zero when there is no fee. */ payment_method_fee?: BillUpdateResponse.PaymentMethodFee; /** * Payment scheduling choice: `SCHEDULE_NOW` to schedule payment, or `SKIP_FOR_NOW` * to defer scheduling. */ payment_schedule_setting?: 'SCHEDULE_NOW' | 'SKIP_FOR_NOW'; /** * Payment speed option: `TWO_DAY` (accelerated) or `FOUR_DAY` (standard). Use * `estimated_payment_arrival` for the expected arrival date. */ payment_velocity?: 'TWO_DAY' | 'FOUR_DAY'; /** * Date used to estimate vendor payment, as an ISO 8601 date. Null when not set. */ scheduled_payment_date?: string; /** * Submitting bill manager. Expand with `bills.read` and `workers.read`. * * Expandable field */ submitter?: WorkersAPI.Worker; /** * ID of the bill manager who submitted the bill. Use it with `/workers/{id}/`. Can * differ from `worker_id`. Null before submission. */ submitter_id?: string; /** * Type of transaction: `BILL_PAYMENT`. */ transaction_type?: 'BILL_PAYMENT'; /** * Vendor details. Expand with `bills.read` and `finance-vendors.read`. * * Expandable field */ vendor?: BillUpdateResponse.Vendor; /** * ID of the Finance vendor. Use it with `/finance-vendors/{id}/`. */ vendor_id?: string; /** * Memo included on the payment to the vendor. Supported for ACH; null when not * set. */ vendor_memo?: string; /** * Date the vendor is paid, as an ISO 8601 date. Null until paid. */ vendor_paid_date?: string; /** * Worker details. Expand with `bills.read` and `workers.read`. * * Expandable field */ worker?: WorkersAPI.Worker; /** * ID of the worker who made the transaction. Use it with `/workers/{id}/`. */ worker_id?: string; } export namespace BillUpdateResponse { /** * A Finance transaction attachment with recorded upload details. */ export interface Attachment { /** * URL for accessing the file. */ url: string; /** * Original file name, when recorded. */ file_name?: string; /** * When the attachment was uploaded, as an ISO 8601 date-time in UTC, when * recorded. */ uploaded_at?: string; /** * ID of the worker who uploaded the attachment. Use it with `/workers/{id}/`. */ uploaded_by_id?: string; } /** * Amount in the company's headquarters currency. The `value` is a decimal string. */ export interface CompanyAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Vendor in the connected accounting system. */ export interface GlVendor { /** * ID of the accounting vendor in Rippling. */ id?: string; /** * ID of the vendor in the accounting system. */ gl_vendor_id?: string; /** * Name of the vendor in the accounting system. */ name?: string; } /** * Invoice file and its filename. */ export interface Invoice { /** * URL for accessing the file. */ url: string; /** * Original file name, when recorded. */ file_name?: string; } export interface LineItem { /** * Unique identifier of this line item. Null for older line items that have not * been assigned one yet. */ id?: string; /** * Whether this line is amortized. */ amortized?: boolean; /** * Amount of this split, in the merchant currency. The `value` is a decimal string. */ amount?: LineItem.Amount; /** * ID of the Finance category assigned to this split. Use it with * `/finance-categories/{id}/`. The category name is in `category_name`. */ category_id?: string; /** * Name of the finance category. */ category_name?: string; /** * Selected dimension values, keyed by dimension ID. `DEPARTMENT` and * `WORK_LOCATION` are the built-in keys. Get custom dimension IDs from * `/job-dimensions/` and `/job-dimensions/{id}/`. Each choice `value` is a job * code ID from `/job-codes/` and `/job-codes/{id}/`. */ dimension_choices?: { [key: string]: LineItem.DimensionChoices }; /** * End of the amortization period (YYYY-MM-DD). */ end_date?: string; /** * ERP amortization schedule associated with this line. */ gl_amortization_schedule?: LineItem.GlAmortizationSchedule; /** * ERP amortization template for this line. */ gl_amortization_template?: LineItem.GlAmortizationTemplate; /** * Whether this split is billed to `gl_customer` in the accounting system. * `BILLABLE` means it is billed, `NOT_BILLABLE` means it is not. Null when not * set. */ gl_billable?: 'BILLABLE' | 'NOT_BILLABLE'; /** * ID of the customer record in the connected accounting integration. No public * Rippling API is currently available to retrieve this accounting customer. */ gl_customer?: string; /** * Rippling ID of the accounting tax code. No public Rippling API is currently * available to retrieve this accounting tax code. */ gl_tax_code?: string; /** * Memo entered on this split. */ memo?: string; /** * Prepaid asset account for Rippling-managed amortization. */ prepaid_account?: LineItem.PrepaidAccount; /** * Start of the amortization period (YYYY-MM-DD). */ start_date?: string; /** * Total tax amount for this line in the merchant currency. */ tax_amount?: LineItem.TaxAmount; } export namespace LineItem { /** * Amount of this split, in the merchant currency. The `value` is a decimal string. */ export interface Amount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } export interface DimensionChoices { /** * Name of the dimension, such as Department. */ dimension_name?: string; /** * Display name of the selected dimension value. */ label?: string; /** * ID of the selected value. For `DEPARTMENT` use `/departments/{id}/`, for * `WORK_LOCATION` use `/work-locations/{id}/`, and for a custom job dimension use * `/job-codes/{id}/`. */ value?: string; } /** * ERP amortization schedule associated with this line. */ export interface GlAmortizationSchedule { /** * Rippling ID of the accounting integration that owns this object. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Number of amortization periods. */ amortization_period?: number; /** * End of the ERP amortization schedule as an ISO 8601 timestamp (for example, * 2026-12-31T00:00:00). May omit a timezone offset; an omitted offset does not * indicate UTC. Null when not set. */ end_date?: string; /** * Object ID in the connected accounting system. */ gl_object_id?: string; /** * Type of object in the connected accounting system: GL_AMORTIZATION_TEMPLATE * defines amortization rules; GL_AMORTIZATION_SCHEDULE tracks amortization; * GL_AMORTIZATION_SCHEDULE_RECURRENCE is a schedule entry; GL_ACCOUNT is a general * ledger account; GL_JOURNAL_ENTRY is a journal entry; GL_POSTING_PERIOD is an * accounting period; GL_VENDOR, GL_CUSTOMER, and GL_EMPLOYEE identify a vendor, * customer, and employee respectively; GL_SUBSIDIARY identifies a subsidiary. Null * when not set. */ gl_object_type?: | 'GL_AMORTIZATION_TEMPLATE' | 'GL_AMORTIZATION_SCHEDULE' | 'GL_AMORTIZATION_SCHEDULE_RECURRENCE' | 'GL_ACCOUNT' | 'GL_JOURNAL_ENTRY' | 'GL_POSTING_PERIOD' | 'GL_VENDOR' | 'GL_CUSTOMER' | 'GL_EMPLOYEE' | 'GL_SUBSIDIARY'; /** * Accounting object name. */ name?: string; /** * Start of the ERP amortization schedule as an ISO 8601 timestamp (for example, * 2026-01-01T00:00:00). May omit a timezone offset; an omitted offset does not * indicate UTC. Null when not set. */ start_date?: string; /** * ERP amortization schedule status: NOT_STARTED means amortization has not begun; * IN_PROGRESS means amortization is underway; COMPLETED means amortization is * complete; ON_HOLD means amortization is paused. Null when not set. */ status?: 'NOT_STARTED' | 'IN_PROGRESS' | 'COMPLETED' | 'ON_HOLD'; /** * Amount already amortized as reported by the ERP, in the same currency as * total_amount. No currency conversion is applied; the schedule currency code is * not available in this response. */ total_amortized_amount?: number; /** * Total schedule amount as reported by the ERP, without currency conversion. The * schedule currency code is not available in this response. */ total_amount?: number; } /** * ERP amortization template for this line. */ export interface GlAmortizationTemplate { /** * Rippling ID of the accounting integration that owns this object. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Object ID in the connected accounting system. */ gl_object_id?: string; /** * Type of object in the connected accounting system: GL_AMORTIZATION_TEMPLATE * defines amortization rules; GL_AMORTIZATION_SCHEDULE tracks amortization; * GL_AMORTIZATION_SCHEDULE_RECURRENCE is a schedule entry; GL_ACCOUNT is a general * ledger account; GL_JOURNAL_ENTRY is a journal entry; GL_POSTING_PERIOD is an * accounting period; GL_VENDOR, GL_CUSTOMER, and GL_EMPLOYEE identify a vendor, * customer, and employee respectively; GL_SUBSIDIARY identifies a subsidiary. Null * when not set. */ gl_object_type?: | 'GL_AMORTIZATION_TEMPLATE' | 'GL_AMORTIZATION_SCHEDULE' | 'GL_AMORTIZATION_SCHEDULE_RECURRENCE' | 'GL_ACCOUNT' | 'GL_JOURNAL_ENTRY' | 'GL_POSTING_PERIOD' | 'GL_VENDOR' | 'GL_CUSTOMER' | 'GL_EMPLOYEE' | 'GL_SUBSIDIARY'; /** * Accounting object name. */ name?: string; } /** * Prepaid asset account for Rippling-managed amortization. */ export interface PrepaidAccount { /** * Account ID in the connected accounting system. */ account_id?: string; /** * Account code. */ code?: string; /** * Account name. */ name?: string; /** * IDs of custom dimensions required by this account. */ required_custom_dimensions?: Array; /** * Whether this account requires a department. */ requires_department?: boolean; /** * Whether this account requires a work location. */ requires_work_location?: boolean; /** * Accounting account type: RECEIVABLE for accounts receivable, PAYABLE for * accounts payable, EXPENSE for expense accounts, or BANK for bank accounts. Null * when not set. */ type?: 'RECEIVABLE' | 'PAYABLE' | 'EXPENSE' | 'BANK'; } /** * Total tax amount for this line in the merchant currency. */ export interface TaxAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } } /** * Amount charged by the merchant, in the merchant currency. The `value` is a * decimal string. */ export interface MerchantAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Amount paid to the vendor, in the payment currency. The `value` is a decimal * string. */ export interface PaymentAmount { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Payment method fee, in the company's headquarters currency. The `value` is a * decimal string. Zero when there is no fee. */ export interface PaymentMethodFee { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * Vendor details. Expand with `bills.read` and `finance-vendors.read`. * * Expandable field */ export interface Vendor { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether the vendor is archived. Archived vendors remain available for historical * references. */ is_archived?: boolean; /** * URL of the vendor's logo. Null when no logo is available. */ logo?: string; /** * Canonical name of the Finance vendor. Name eq, ne, and in filters also match * alternate names. */ name?: string; } } export interface BillListParams { cursor?: string; expand?: string; filter?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export interface BillRetrieveParams { expand?: string; } export interface BillUpdateParams { /** * Full list of lines the bill should have. Lines with an `id` are updated, lines * without one are added, and lines left out are deleted. Line amounts must add up * to the bill's merchant amount. */ line_items?: Array; } export namespace BillUpdateParams { /** * PATCH body for a bill line item. `amount` and `tax_amount` are decimal strings, * not Currency objects. */ export interface LineItem { /** * Amount of this split, in the merchant currency, as a decimal string. */ amount: string; /** * ID of the Finance category assigned to this split. Use it with * `/finance-categories/{id}/`. */ category_id: string; /** * ID of a line already on the bill. Send it to update that line and keep its ID. * Omit it to create a new line; the response includes the new line's ID. */ id?: string; /** * Whether this line is amortized. */ amortized?: boolean; /** * Selected dimension values, keyed by dimension ID. `DEPARTMENT` and * `WORK_LOCATION` are the built-in keys. Get custom dimension IDs from * `/job-dimensions/` and `/job-dimensions/{id}/`. Each value is an ID: * `/departments/{id}/` for `DEPARTMENT`, `/work-locations/{id}/` for * `WORK_LOCATION`, and `/job-codes/{id}/` for a custom job dimension. */ dimension_choices?: { [key: string]: string }; /** * End of the amortization period (YYYY-MM-DD). */ end_date?: string; /** * ERP amortization template for this line. */ gl_amortization_template?: LineItem.GlAmortizationTemplate; /** * Whether this split is billed to `gl_customer` in the accounting system. * `BILLABLE` means it is billed, `NOT_BILLABLE` means it is not. Null when not * set. */ gl_billable?: 'BILLABLE' | 'NOT_BILLABLE'; /** * ID of the customer record in the connected accounting integration. No public * Rippling API is currently available to retrieve this accounting customer. */ gl_customer?: string; /** * Rippling ID of the accounting tax code. No public Rippling API is currently * available to retrieve this accounting tax code. */ gl_tax_code?: string; /** * Memo entered on this split. */ memo?: string; /** * Prepaid asset account for Rippling-managed amortization. */ prepaid_account?: LineItem.PrepaidAccount; /** * Start of the amortization period (YYYY-MM-DD). */ start_date?: string; /** * Total tax amount for this line in the merchant currency, as a decimal string. */ tax_amount?: string; } export namespace LineItem { /** * ERP amortization template for this line. */ export interface GlAmortizationTemplate { /** * Rippling ID of the accounting integration that owns this template. No public * Rippling API is currently available to retrieve this accounting integration. */ accounting_integration_id?: string; /** * Object ID of the amortization template in the connected accounting system. */ gl_object_id?: string; /** * Amortization template name. */ name?: string; } /** * Prepaid asset account for Rippling-managed amortization. */ export interface PrepaidAccount { /** * Account ID in the connected accounting system. */ account_id?: string; /** * Account name. */ name?: string; /** * Accounting account type: RECEIVABLE for accounts receivable, PAYABLE for * accounts payable, EXPENSE for expense accounts, or BANK for bank accounts. Null * when not set. */ type?: 'RECEIVABLE' | 'PAYABLE' | 'EXPENSE' | 'BANK'; } } } export declare namespace Bills { export { type BillListResponse as BillListResponse, type BillRetrieveResponse as BillRetrieveResponse, type BillUpdateResponse as BillUpdateResponse, type BillListResponsesPageCursorURL as BillListResponsesPageCursorURL, type BillListParams as BillListParams, type BillRetrieveParams as BillRetrieveParams, type BillUpdateParams as BillUpdateParams, }; }