import * as z from "zod"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Address, Address$Outbound } from "./address.js"; import { BankAccount, BankAccount$Outbound } from "./bankaccount.js"; import { Currency } from "./currency.js"; import { CustomField, CustomField$Outbound } from "./customfield.js"; import { CustomMappings, CustomMappings$Outbound } from "./custommappings.js"; import { DeprecatedLinkedTrackingCategory, DeprecatedLinkedTrackingCategory$Outbound } from "./deprecatedlinkedtrackingcategory.js"; import { InvoiceLineItem, InvoiceLineItem$Outbound, InvoiceLineItemInput, InvoiceLineItemInput$Outbound } from "./invoicelineitem.js"; import { LinkedCustomer, LinkedCustomer$Outbound } from "./linkedcustomer.js"; import { LinkedCustomerInput, LinkedCustomerInput$Outbound } from "./linkedcustomerinput.js"; import { LinkedLedgerAccount, LinkedLedgerAccount$Outbound } from "./linkedledgeraccount.js"; import { LinkedLedgerAccountInput, LinkedLedgerAccountInput$Outbound } from "./linkedledgeraccountinput.js"; import { LinkedTrackingCategory, LinkedTrackingCategory$Outbound } from "./linkedtrackingcategory.js"; import { PassThroughBody, PassThroughBody$Outbound } from "./passthroughbody.js"; /** * Invoice type */ export declare const InvoiceType: { readonly Standard: "standard"; readonly Credit: "credit"; readonly Service: "service"; readonly Product: "product"; readonly Supplier: "supplier"; readonly Other: "other"; }; /** * Invoice type */ export type InvoiceType = ClosedEnum; /** * Invoice status */ export declare const InvoiceStatus: { readonly Draft: "draft"; readonly Submitted: "submitted"; readonly Authorised: "authorised"; readonly PartiallyPaid: "partially_paid"; readonly Paid: "paid"; readonly Void: "void"; readonly Credit: "credit"; readonly Deleted: "deleted"; }; /** * Invoice status */ export type InvoiceStatus = ClosedEnum; export type Invoice = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The third-party API ID of original entity */ downstreamId?: string | null | undefined; /** * Invoice type */ type?: InvoiceType | null | undefined; /** * Invoice number. */ number?: string | null | undefined; /** * The customer this entity is linked to. */ customer?: LinkedCustomer | null | undefined; /** * The company or subsidiary id the transaction belongs to */ companyId?: string | null | undefined; /** * Date invoice was issued - YYYY-MM-DD. */ invoiceDate?: RFCDate | null | undefined; /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ dueDate?: RFCDate | null | undefined; /** * Terms of payment. */ terms?: string | null | undefined; /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ poNumber?: string | null | undefined; /** * Optional invoice reference. */ reference?: string | null | undefined; /** * Invoice status */ status?: InvoiceStatus | null | undefined; /** * Invoice sent to contact/customer. */ invoiceSent?: boolean | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * Currency Exchange Rate at the time entity was recorded/generated. */ currencyRate?: number | null | undefined; /** * Amounts are including tax */ taxInclusive?: boolean | null | undefined; /** * Sub-total amount, normally before tax. */ subTotal?: number | null | undefined; /** * Total tax amount applied to this invoice. */ totalTax?: number | null | undefined; /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ taxCode?: string | null | undefined; /** * Discount percentage applied to this invoice. */ discountPercentage?: number | null | undefined; /** * Discount amount applied to this invoice. */ discountAmount?: number | null | undefined; /** * Total amount of invoice, including tax. */ total?: number | null | undefined; /** * Balance of invoice due. */ balance?: number | null | undefined; /** * Amount of deposit made to this invoice. */ deposit?: number | null | undefined; /** * Customer memo */ customerMemo?: string | null | undefined; /** * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ trackingCategory?: DeprecatedLinkedTrackingCategory | null | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | null | undefined; lineItems?: Array | undefined; billingAddress?: Address | undefined; shippingAddress?: Address | undefined; /** * Optional invoice template */ templateId?: string | null | undefined; /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ sourceDocumentUrl?: string | null | undefined; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ paymentMethod?: string | null | undefined; /** * The channel through which the transaction is processed. */ channel?: string | null | undefined; /** * language code according to ISO 639-1. For the United States - EN */ language?: string | null | undefined; /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ accountingByRow?: boolean | null | undefined; bankAccount?: BankAccount | undefined; ledgerAccount?: LinkedLedgerAccount | null | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: CustomMappings | null | undefined; customFields?: Array | undefined; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ rowVersion?: string | null | undefined; /** * The user who last updated the object. */ updatedBy?: string | null | undefined; /** * The user who created the object. */ createdBy?: string | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; export type InvoiceInput = { /** * Invoice type */ type?: InvoiceType | null | undefined; /** * Invoice number. */ number?: string | null | undefined; /** * The customer this entity is linked to. */ customer?: LinkedCustomerInput | null | undefined; /** * The company or subsidiary id the transaction belongs to */ companyId?: string | null | undefined; /** * Date invoice was issued - YYYY-MM-DD. */ invoiceDate?: RFCDate | null | undefined; /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ dueDate?: RFCDate | null | undefined; /** * Terms of payment. */ terms?: string | null | undefined; /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ poNumber?: string | null | undefined; /** * Optional invoice reference. */ reference?: string | null | undefined; /** * Invoice status */ status?: InvoiceStatus | null | undefined; /** * Invoice sent to contact/customer. */ invoiceSent?: boolean | undefined; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ currency?: Currency | null | undefined; /** * Currency Exchange Rate at the time entity was recorded/generated. */ currencyRate?: number | null | undefined; /** * Amounts are including tax */ taxInclusive?: boolean | null | undefined; /** * Sub-total amount, normally before tax. */ subTotal?: number | null | undefined; /** * Total tax amount applied to this invoice. */ totalTax?: number | null | undefined; /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ taxCode?: string | null | undefined; /** * Discount percentage applied to this invoice. */ discountPercentage?: number | null | undefined; /** * Discount amount applied to this invoice. */ discountAmount?: number | null | undefined; /** * Total amount of invoice, including tax. */ total?: number | null | undefined; /** * Balance of invoice due. */ balance?: number | null | undefined; /** * Amount of deposit made to this invoice. */ deposit?: number | null | undefined; /** * Customer memo */ customerMemo?: string | null | undefined; /** * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ trackingCategory?: DeprecatedLinkedTrackingCategory | null | undefined; /** * A list of linked tracking categories. */ trackingCategories?: Array | null | undefined; lineItems?: Array | undefined; billingAddress?: Address | undefined; shippingAddress?: Address | undefined; /** * Optional invoice template */ templateId?: string | null | undefined; /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ sourceDocumentUrl?: string | null | undefined; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ paymentMethod?: string | null | undefined; /** * The channel through which the transaction is processed. */ channel?: string | null | undefined; /** * language code according to ISO 639-1. For the United States - EN */ language?: string | null | undefined; /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ accountingByRow?: boolean | null | undefined; bankAccount?: BankAccount | undefined; ledgerAccount?: LinkedLedgerAccountInput | null | undefined; customFields?: Array | undefined; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ rowVersion?: string | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export declare const InvoiceType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const InvoiceType$outboundSchema: z.ZodNativeEnum; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace InvoiceType$ { /** @deprecated use `InvoiceType$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Standard: "standard"; readonly Credit: "credit"; readonly Service: "service"; readonly Product: "product"; readonly Supplier: "supplier"; readonly Other: "other"; }>; /** @deprecated use `InvoiceType$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Standard: "standard"; readonly Credit: "credit"; readonly Service: "service"; readonly Product: "product"; readonly Supplier: "supplier"; readonly Other: "other"; }>; } /** @internal */ export declare const InvoiceStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const InvoiceStatus$outboundSchema: z.ZodNativeEnum; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace InvoiceStatus$ { /** @deprecated use `InvoiceStatus$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Draft: "draft"; readonly Submitted: "submitted"; readonly Authorised: "authorised"; readonly PartiallyPaid: "partially_paid"; readonly Paid: "paid"; readonly Void: "void"; readonly Credit: "credit"; readonly Deleted: "deleted"; }>; /** @deprecated use `InvoiceStatus$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Draft: "draft"; readonly Submitted: "submitted"; readonly Authorised: "authorised"; readonly PartiallyPaid: "partially_paid"; readonly Paid: "paid"; readonly Void: "void"; readonly Credit: "credit"; readonly Deleted: "deleted"; }>; } /** @internal */ export declare const Invoice$inboundSchema: z.ZodType; /** @internal */ export type Invoice$Outbound = { id?: string | undefined; downstream_id?: string | null | undefined; type?: string | null | undefined; number?: string | null | undefined; customer?: LinkedCustomer$Outbound | null | undefined; company_id?: string | null | undefined; invoice_date?: string | null | undefined; due_date?: string | null | undefined; terms?: string | null | undefined; po_number?: string | null | undefined; reference?: string | null | undefined; status?: string | null | undefined; invoice_sent?: boolean | undefined; currency?: string | null | undefined; currency_rate?: number | null | undefined; tax_inclusive?: boolean | null | undefined; sub_total?: number | null | undefined; total_tax?: number | null | undefined; tax_code?: string | null | undefined; discount_percentage?: number | null | undefined; discount_amount?: number | null | undefined; total?: number | null | undefined; balance?: number | null | undefined; deposit?: number | null | undefined; customer_memo?: string | null | undefined; tracking_category?: DeprecatedLinkedTrackingCategory$Outbound | null | undefined; tracking_categories?: Array | null | undefined; line_items?: Array | undefined; billing_address?: Address$Outbound | undefined; shipping_address?: Address$Outbound | undefined; template_id?: string | null | undefined; source_document_url?: string | null | undefined; payment_method?: string | null | undefined; channel?: string | null | undefined; language?: string | null | undefined; accounting_by_row?: boolean | null | undefined; bank_account?: BankAccount$Outbound | undefined; ledger_account?: LinkedLedgerAccount$Outbound | null | undefined; custom_mappings?: CustomMappings$Outbound | null | undefined; custom_fields?: Array | undefined; row_version?: string | null | undefined; updated_by?: string | null | undefined; created_by?: string | null | undefined; updated_at?: string | null | undefined; created_at?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export declare const Invoice$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Invoice$ { /** @deprecated use `Invoice$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `Invoice$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `Invoice$Outbound` instead. */ type Outbound = Invoice$Outbound; } export declare function invoiceToJSON(invoice: Invoice): string; export declare function invoiceFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const InvoiceInput$inboundSchema: z.ZodType; /** @internal */ export type InvoiceInput$Outbound = { type?: string | null | undefined; number?: string | null | undefined; customer?: LinkedCustomerInput$Outbound | null | undefined; company_id?: string | null | undefined; invoice_date?: string | null | undefined; due_date?: string | null | undefined; terms?: string | null | undefined; po_number?: string | null | undefined; reference?: string | null | undefined; status?: string | null | undefined; invoice_sent?: boolean | undefined; currency?: string | null | undefined; currency_rate?: number | null | undefined; tax_inclusive?: boolean | null | undefined; sub_total?: number | null | undefined; total_tax?: number | null | undefined; tax_code?: string | null | undefined; discount_percentage?: number | null | undefined; discount_amount?: number | null | undefined; total?: number | null | undefined; balance?: number | null | undefined; deposit?: number | null | undefined; customer_memo?: string | null | undefined; tracking_category?: DeprecatedLinkedTrackingCategory$Outbound | null | undefined; tracking_categories?: Array | null | undefined; line_items?: Array | undefined; billing_address?: Address$Outbound | undefined; shipping_address?: Address$Outbound | undefined; template_id?: string | null | undefined; source_document_url?: string | null | undefined; payment_method?: string | null | undefined; channel?: string | null | undefined; language?: string | null | undefined; accounting_by_row?: boolean | null | undefined; bank_account?: BankAccount$Outbound | undefined; ledger_account?: LinkedLedgerAccountInput$Outbound | null | undefined; custom_fields?: Array | undefined; row_version?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export declare const InvoiceInput$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace InvoiceInput$ { /** @deprecated use `InvoiceInput$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `InvoiceInput$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `InvoiceInput$Outbound` instead. */ type Outbound = InvoiceInput$Outbound; } export declare function invoiceInputToJSON(invoiceInput: InvoiceInput): string; export declare function invoiceInputFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=invoice.d.ts.map