@getopenpay/client
Version:
OpenPay API TypeScript SDK
352 lines (351 loc) • 9.85 kB
TypeScript
/**
* OpenPay API
* super charge your subscription management.
*
* The version of the OpenAPI document: 1.2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { TaxIdSetting } from './TaxIdSetting';
import type { InvoiceStatusEnum } from './InvoiceStatusEnum';
import type { CustomerExternal } from './CustomerExternal';
import type { SubscriptionExternal } from './SubscriptionExternal';
import type { InvoiceDiscountAmountsExternal } from './InvoiceDiscountAmountsExternal';
import type { ObjectName } from './ObjectName';
import type { InvoiceComment } from './InvoiceComment';
import type { CollectionMethodEnum } from './CollectionMethodEnum';
import type { InvoiceItemExternal } from './InvoiceItemExternal';
import type { BillingReasonEnum } from './BillingReasonEnum';
import type { DiscountExternal } from './DiscountExternal';
import type { MerchantTaxIdSetting } from './MerchantTaxIdSetting';
import type { CurrencyEnum } from './CurrencyEnum';
/**
*
* @export
* @interface InvoiceExternal
*/
export interface InvoiceExternal {
/**
* Unique identifier of the account.
* @type {string}
* @memberof InvoiceExternal
*/
accountId: string;
/**
* Amount applied from customer balance either from credit or debit. It is in atomic units (in USD this is cents).
* @type {number}
* @memberof InvoiceExternal
*/
appliedBalanceAmountAtom: number;
/**
* Indicates the reason why the invoice was created.
* @type {BillingReasonEnum}
* @memberof InvoiceExternal
*/
billingReason: BillingReasonEnum;
/**
* Indicates method of payment collection of the invoice.
* @type {CollectionMethodEnum}
* @memberof InvoiceExternal
*/
collectionMethod: CollectionMethodEnum;
/**
* The history of the status updates.
* @type {Array<InvoiceComment>}
* @memberof InvoiceExternal
*/
comments?: Array<InvoiceComment>;
/**
* DateTime at which the object was created, in 'ISO 8601' format.
* @type {Date}
* @memberof InvoiceExternal
*/
createdAt: Date;
/**
* List of unique identifiers of all the credit notes issued for this invoice.
* @type {Array<string | null>}
* @memberof InvoiceExternal
*/
creditNoteIds?: Array<string | null>;
/**
* Three-letter ISO currency code, in lowercase.
* @type {CurrencyEnum}
* @memberof InvoiceExternal
*/
currency: CurrencyEnum;
/**
*
* @type {object}
* @memberof InvoiceExternal
*/
customFields?: object | null;
/**
*
* @type {CustomerExternal}
* @memberof InvoiceExternal
*/
customer?: CustomerExternal | null;
/**
* Unique identifier of the customer.
* @type {string}
* @memberof InvoiceExternal
*/
customerId: string;
/**
* The tax ID settings of the customer.
* @type {Array<TaxIdSetting>}
* @memberof InvoiceExternal
*/
customerTaxIds?: Array<TaxIdSetting>;
/**
*
* @type {string}
* @memberof InvoiceExternal
*/
defaultPaymentMethodId?: string | null;
/**
*
* @type {string}
* @memberof InvoiceExternal
*/
description?: string | null;
/**
* The discounts applied to the invoice.
* @type {Array<DiscountExternal>}
* @memberof InvoiceExternal
*/
discounts?: Array<DiscountExternal>;
/**
* Final amount due at this time for this invoice. It isin atomic units (in USD this is cents).
* @type {number}
* @memberof InvoiceExternal
*/
dueAmountAtom: number;
/**
* Due date to pay the invoice.
* @type {Date}
* @memberof InvoiceExternal
*/
dueDate: Date;
/**
* Whether invoice should be sent to the customer upon finalizing the invoice
* @type {boolean}
* @memberof InvoiceExternal
*/
emailInvoiceOnFinalization?: boolean;
/**
*
* @type {string}
* @memberof InvoiceExternal
*/
hostedInvoiceUrl?: string | null;
/**
* Unique identifier of the invoice.
* @type {string}
* @memberof InvoiceExternal
*/
id: string;
/**
* Invoice number
* @type {number}
* @memberof InvoiceExternal
*/
invoiceNumber: number;
/**
* The URL for the Invoice PDF
* @type {string}
* @memberof InvoiceExternal
*/
invoicePdfUrl: string;
/**
* If true, indicates that this object has been deleted
* @type {boolean}
* @memberof InvoiceExternal
*/
isDeleted?: boolean;
/**
* Whether this is the first invoice for a trial subscription.
* @type {boolean}
* @memberof InvoiceExternal
*/
isInitialInvoiceForTrialSub: boolean;
/**
*
* @type {string}
* @memberof InvoiceExternal
*/
latestPaymentAttemptFailureMessage?: string | null;
/**
*
* @type {string}
* @memberof InvoiceExternal
*/
latestPaymentIntentId?: string | null;
/**
* List of individual line items that make up the invoice.
* @type {Array<InvoiceItemExternal>}
* @memberof InvoiceExternal
*/
lines: Array<InvoiceItemExternal>;
/**
* The tax ID settings of the merchant.
* @type {Array<MerchantTaxIdSetting>}
* @memberof InvoiceExternal
*/
merchantTaxIds?: Array<MerchantTaxIdSetting>;
/**
*
* @type {object}
* @memberof InvoiceExternal
*/
metadata?: object | null;
/**
* Number of days the customer has to pay the invoice, from 0 to 365, where -1 indicates due immediately.
* @type {number}
* @memberof InvoiceExternal
*/
netD?: number;
/**
*
* @type {ObjectName}
* @memberof InvoiceExternal
*/
object?: ObjectName;
/**
* The amount that was paid in atomic units (in USD this is cents).
* @type {number}
* @memberof InvoiceExternal
*/
paidAmountAtom: number;
/**
*
* @type {Date}
* @memberof InvoiceExternal
*/
paidAt?: Date | null;
/**
*
* @type {boolean}
* @memberof InvoiceExternal
*/
paidOutOfBand: boolean | null;
/**
* End of the usage period during which invoice_items were added to this invoice. It is in 'ISO 8601' format.
* @type {Date}
* @memberof InvoiceExternal
*/
periodEnd: Date;
/**
* Start of the usage period during which invoice_items were added to this invoice. It is in 'ISO 8601' format.
* @type {Date}
* @memberof InvoiceExternal
*/
periodStart: Date;
/**
*
* @type {number}
* @memberof InvoiceExternal
*/
postPaymentCreditNotesAmount?: number | null;
/**
*
* @type {number}
* @memberof InvoiceExternal
*/
prePaymentCreditNotesAmount?: number | null;
/**
* Total fee amount charged for the payment provider type in atomic units.
* @type {number}
* @memberof InvoiceExternal
*/
providerTypeFeeAmountAtom: number;
/**
* The URL for the Receipt PDF
* @type {string}
* @memberof InvoiceExternal
*/
receiptPdfUrl: string;
/**
* Ids of refund object for this invoice.
* @type {Array<string>}
* @memberof InvoiceExternal
*/
refundIds: Array<string>;
/**
*
* @type {number}
* @memberof InvoiceExternal
*/
refundedAmountAtom: number | null;
/**
* Remaining amount of the invoice to be paid. It is in atomic units (in USD this is cents).
* @type {number}
* @memberof InvoiceExternal
*/
remainingAmountAtom: number;
/**
* Status of the invoice.
* @type {InvoiceStatusEnum}
* @memberof InvoiceExternal
*/
status: InvoiceStatusEnum;
/**
*
* @type {SubscriptionExternal}
* @memberof InvoiceExternal
*/
subscription?: SubscriptionExternal | null;
/**
*
* @type {string}
* @memberof InvoiceExternal
*/
subscriptionId?: string | null;
/**
* Total tax amount in atomic units.
* @type {number}
* @memberof InvoiceExternal
*/
taxAmountAtom: number;
/**
*
* @type {Date}
* @memberof InvoiceExternal
*/
taxProcessorUpdatedAt?: Date | null;
/**
* Total amount of the invoice. Sum of invoice_items' total amount. It is in atomic units (in USD this is cents).
* @type {number}
* @memberof InvoiceExternal
*/
totalAmountAtom: number;
/**
* The aggregate amount_atoms calculated per discount across all line items.
* @type {Array<InvoiceDiscountAmountsExternal>}
* @memberof InvoiceExternal
*/
totalDiscountAmountAtoms?: Array<InvoiceDiscountAmountsExternal>;
/**
* Total amount excluding taxes. It is in atomic units (in USD this is cents).
* @type {number}
* @memberof InvoiceExternal
*/
totalExcludingTaxesAmountAtom: number;
/**
* DateTime at which the object was updated, in 'ISO 8601' format.
* @type {Date}
* @memberof InvoiceExternal
*/
updatedAt: Date;
}
/**
* Check if a given object implements the InvoiceExternal interface.
*/
export declare function instanceOfInvoiceExternal(value: object): value is InvoiceExternal;
export declare function InvoiceExternalFromJSON(json: any): InvoiceExternal;
export declare function InvoiceExternalFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvoiceExternal;
export declare function InvoiceExternalToJSON(json: any): InvoiceExternal;
export declare function InvoiceExternalToJSONTyped(value?: InvoiceExternal | null, ignoreDiscriminator?: boolean): any;