// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; export class DeletedTransactions extends APIResource { /** * Lists deleted transactions of the specified type(s) (e.g., invoice, bill, * estimate) in the last 90 days. Results are grouped by transaction type and * ordered by actual delete time (ascending). NOTE: For deleted non-transaction * list-objects (e.g., customer, vendor, employee), see the deleted-list-objects * endpoint. * * **NOTE:** QuickBooks Desktop does not support pagination for deleted * transactions; hence, there is no `cursor` parameter. Users typically have few * deleted transactions. * * @example * ```ts * const deletedTransactions = * await conductor.qbd.deletedTransactions.list({ * transactionTypes: ['invoice'], * conductorEndUserId: 'end_usr_1234567abcdefg', * }); * ``` */ list( params: DeletedTransactionListParams, options?: RequestOptions, ): APIPromise { const { conductorEndUserId, ...query } = params; return this._client.get('/quickbooks-desktop/deleted-transactions', { query, ...options, headers: buildHeaders([{ 'Conductor-End-User-Id': conductorEndUserId }, options?.headers]), }); } } export interface DeletedTransaction { /** * The unique identifier assigned by QuickBooks to this deleted transaction. This * ID is unique across all transaction types. */ id: string; /** * The date and time when this deleted transaction was created, in ISO 8601 format * (YYYY-MM-DDThh:mm:ss±hh:mm), which QuickBooks Desktop interprets in the local * timezone of the end-user's computer. */ createdAt: string; /** * The date and time when this deleted transaction was deleted, in ISO 8601 format * (YYYY-MM-DDThh:mm:ss±hh:mm), which QuickBooks Desktop interprets in the local * timezone of the end-user's computer. */ deletedAt: string; /** * The type of object. This value is always `"qbd_deleted_transaction"`. */ objectType: 'qbd_deleted_transaction'; /** * The case-sensitive user-defined reference number for this deleted transaction, * which can be used to identify the transaction in QuickBooks. This value is not * required to be unique and can be arbitrarily changed by the QuickBooks user. */ refNumber: string | null; /** * The type of deleted transaction. */ transactionType: | 'ar_refund_credit_card' | 'bill' | 'bill_payment_check' | 'bill_payment_credit_card' | 'build_assembly' | 'charge' | 'check' | 'credit_card_charge' | 'credit_card_credit' | 'credit_memo' | 'deposit' | 'estimate' | 'inventory_adjustment' | 'invoice' | 'item_receipt' | 'journal_entry' | 'purchase_order' | 'receive_payment' | 'sales_order' | 'sales_receipt' | 'sales_tax_payment_check' | 'time_tracking' | 'transfer_inventory' | 'vehicle_mileage' | 'vendor_credit'; } export interface DeletedTransactionListResponse { /** * The array of deleted transactions. */ data: Array; /** * The type of object. This value is always `"list"`. */ objectType: 'list'; /** * The endpoint URL where this list can be accessed. */ url: string; } export interface DeletedTransactionListParams { /** * Query param: Filter for deleted transactions by their transaction type(s). */ transactionTypes: Array< | 'ar_refund_credit_card' | 'bill' | 'bill_payment_check' | 'bill_payment_credit_card' | 'build_assembly' | 'charge' | 'check' | 'credit_card_charge' | 'credit_card_credit' | 'credit_memo' | 'deposit' | 'estimate' | 'inventory_adjustment' | 'invoice' | 'item_receipt' | 'journal_entry' | 'purchase_order' | 'receive_payment' | 'sales_order' | 'sales_receipt' | 'sales_tax_payment_check' | 'time_tracking' | 'transfer_inventory' | 'vehicle_mileage' | 'vendor_credit' >; /** * Header param: The ID of the End-User to receive this request. */ conductorEndUserId: string; /** * Query param: Filter for deleted transactions deleted on or after this date/time, * within the last 90 days (QuickBooks limit). Accepts the following ISO 8601 * formats: * * - **date-only** (YYYY-MM-DD) - QuickBooks Desktop interprets the date as the * **start of the specified day** in the local timezone of the end-user's * computer (e.g., `2025-01-01` → `2025-01-01T00:00:00`). * - **datetime without timezone** (YYYY-MM-DDTHH:mm:ss) - QuickBooks Desktop * interprets the timestamp in the local timezone of the end-user's computer. * - **datetime with timezone** (YYYY-MM-DDTHH:mm:ss±HH:mm) - QuickBooks Desktop * interprets the timestamp using the specified timezone. */ deletedAfter?: string; /** * Query param: Filter for deleted transactions deleted on or before this * date/time, within the last 90 days (QuickBooks limit). Accepts the following ISO * 8601 formats: * * - **date-only** (YYYY-MM-DD) - QuickBooks Desktop interprets the date as the * **end of the specified day** in the local timezone of the end-user's computer * (e.g., `2025-01-01` → `2025-01-01T23:59:59`). * - **datetime without timezone** (YYYY-MM-DDTHH:mm:ss) - QuickBooks Desktop * interprets the timestamp in the local timezone of the end-user's computer. * - **datetime with timezone** (YYYY-MM-DDTHH:mm:ss±HH:mm) - QuickBooks Desktop * interprets the timestamp using the specified timezone. */ deletedBefore?: string; } export declare namespace DeletedTransactions { export { type DeletedTransaction as DeletedTransaction, type DeletedTransactionListResponse as DeletedTransactionListResponse, type DeletedTransactionListParams as DeletedTransactionListParams, }; }