import * as z from "zod/v4-mini"; import { Result as SafeParseResult } from "../../types/fp.js"; import { CouponApplicationResponse } from "./coupon-application-response.js"; import { CustomerResponse } from "./customer-response.js"; import { InvoiceLineItemResponse } from "./invoice-line-item-response.js"; import { InvoiceStatus } from "./invoice-status.js"; import { InvoiceType } from "./invoice-type.js"; import { PaymentStatus } from "./payment-status.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status } from "./status.js"; import { SubscriptionResponse } from "./subscription-response.js"; import { TaxAppliedResponse } from "./tax-applied-response.js"; export type InvoiceResponse = { /** * adjustment_amount is the total sum of credit notes of type "adjustment". * * @remarks * These are non-cash reductions applied to the invoice (e.g. goodwill credit, billing correction). */ adjustmentAmount?: string | undefined; /** * amount_due is the total amount that needs to be paid for this invoice */ amountDue?: string | undefined; /** * amount_paid is the amount that has already been paid towards this invoice */ amountPaid?: string | undefined; /** * amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid) */ amountRemaining?: string | undefined; /** * billing_period describes the billing period this invoice covers (e.g., "January 2024", "Q1 2024") */ billingPeriod?: string | undefined; /** * billing_reason indicates why this invoice was generated (e.g., "subscription_billing", "manual_charge") */ billingReason?: string | undefined; /** * billing_sequence is the sequential number indicating the billing cycle for subscription invoices */ billingSequence?: number | undefined; /** * coupon_applications contains the coupon applications associated with this invoice (overrides embedded field) */ couponApplications?: Array | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; /** * currency is the three-letter ISO currency code (e.g., USD, EUR, GBP) that applies to all monetary amounts on this invoice */ currency?: string | undefined; /** * Customer response object containing all customer information */ customer?: CustomerResponse | undefined; /** * customer_id is the ID of the customer who will receive this invoice */ customerId?: string | undefined; /** * description is an optional description or notes about this invoice */ description?: string | undefined; /** * due_date is the date when payment for this invoice is due */ dueDate?: Date | undefined; /** * environment_id is the ID of the environment this invoice belongs to (for multi-environment setups) */ environmentId?: string | undefined; /** * finalized_at is the timestamp when this invoice was finalized and made ready for payment */ finalizedAt?: Date | undefined; /** * id is the unique identifier for this invoice */ id?: string | undefined; /** * idempotency_key is a unique key used to prevent duplicate invoice creation when retrying API calls */ idempotencyKey?: string | undefined; /** * invoice_number is the human-readable invoice number displayed to customers (e.g., INV-2024-001) */ invoiceNumber?: string | undefined; /** * invoice_pdf_url is the URL where customers can download the PDF version of this invoice */ invoicePdfUrl?: string | undefined; invoiceStatus?: InvoiceStatus | undefined; invoiceType?: InvoiceType | undefined; /** * is_manually_edited is true once a user has manually added, edited, or removed a line item on this draft invoice. * * @remarks * Once set, automated recomputation of this invoice's line items must no-op rather than overwrite the manual edit. */ isManuallyEdited?: boolean | undefined; /** * issue_date is the user-facing date of the invoice. Defaults to created_at if not set. */ issueDate?: Date | undefined; /** * last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice */ lastComputedAt?: Date | undefined; /** * line_items contains the individual items that make up this invoice (overrides embedded field) */ lineItems?: Array | undefined; metadata?: { [k: string]: string; } | undefined; /** * overpaid_amount is the amount overpaid if payment_status is OVERPAID (amount_paid - total) */ overpaidAmount?: string | undefined; /** * paid_at is the timestamp when this invoice was fully paid */ paidAt?: Date | undefined; paymentStatus?: PaymentStatus | undefined; /** * period_end is the end date of the billing period covered by this invoice */ periodEnd?: Date | undefined; /** * period_start is the start date of the billing period covered by this invoice */ periodStart?: Date | undefined; /** * recalculated_invoice_id is the ID of the replacement invoice created when this invoice was voided and recalculated. * * @remarks * When set, it forms a parent→child link from this (voided) invoice to the new replacement invoice. */ recalculatedInvoiceId?: string | undefined; /** * refunded_amount is the total sum of credit notes of type "refund". * * @remarks * These are actual refunds issued to the customer. */ refundedAmount?: string | undefined; status?: Status | undefined; subscription?: SubscriptionResponse | undefined; /** * subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID). * * @remarks * It may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB. */ subscriptionCustomerId?: string | undefined; /** * subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices) */ subscriptionId?: string | undefined; /** * subtotal is the sum of all line items before any taxes, discounts, or additional fees */ subtotal?: string | undefined; /** * tax_applied_records contains the tax applied records associated with this invoice */ taxes?: Array | undefined; tenantId?: string | undefined; /** * total is the final amount including taxes, fees, and discounts */ total?: string | undefined; /** * total_discount is the sum of all coupon discounts applied to the invoice */ totalDiscount?: string | undefined; /** * total_prepaid_credits_applied is the total amount of prepaid credits applied to this invoice. */ totalPrepaidCreditsApplied?: string | undefined; /** * total_tax is the sum of all taxes combined at the invoice level. */ totalTax?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; /** * version is the version number for tracking changes to this invoice */ version?: number | undefined; /** * voided_at is the timestamp when this invoice was voided or cancelled */ voidedAt?: Date | undefined; }; /** @internal */ export declare const InvoiceResponse$inboundSchema: z.ZodMiniType; export declare function invoiceResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=invoice-response.d.ts.map