@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
188 lines • 6.25 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
/**
* Subscription period for this billing cycle.
*/
export type SubmitInvoicePeriod = {
start: Date;
end: Date;
};
export type SubmitInvoiceItems = {
/**
* Partner's resource ID.
*/
resourceId?: string | undefined;
/**
* Partner's billing plan ID.
*/
billingPlanId: string;
/**
* Start and end are only needed if different from the period's start/end.
*/
start?: Date | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
end?: Date | undefined;
name: string;
details?: string | undefined;
/**
* Currency amount as a decimal string.
*/
price: string;
quantity: number;
units: string;
/**
* Currency amount as a decimal string.
*/
total: string;
};
export type SubmitInvoiceDiscounts = {
/**
* Partner's resource ID.
*/
resourceId?: string | undefined;
/**
* Partner's billing plan ID.
*/
billingPlanId: string;
/**
* Start and end are only needed if different from the period's start/end.
*/
start?: Date | undefined;
/**
* Start and end are only needed if different from the period's start/end.
*/
end?: Date | undefined;
name: string;
details?: string | undefined;
/**
* Currency amount as a decimal string.
*/
amount: string;
};
export declare const Result: {
readonly Paid: "paid";
readonly Notpaid: "notpaid";
readonly Overdue: "overdue";
};
export type Result = ClosedEnum<typeof Result>;
/**
* Test mode
*/
export type Test = {
validate?: boolean | undefined;
result?: Result | undefined;
};
export type SubmitInvoiceRequestBody = {
/**
* Partner-provided invoice identifier. If provided, it must be unique for this installation.
*/
externalId?: string | undefined;
/**
* Invoice date. Must be within the period's start and end.
*/
invoiceDate: Date;
/**
* Additional memo for the invoice.
*/
memo?: string | undefined;
/**
* Subscription period for this billing cycle.
*/
period: SubmitInvoicePeriod;
items: Array<SubmitInvoiceItems>;
discounts?: Array<SubmitInvoiceDiscounts> | undefined;
/**
* Set this to `true` if this is the final invoice for the installation. Can only be set when the installation is pending deletion.
*/
final?: boolean | undefined;
/**
* Test mode
*/
test?: Test | undefined;
};
export type SubmitInvoiceRequest = {
integrationConfigurationId: string;
requestBody: SubmitInvoiceRequestBody;
};
export type SubmitInvoiceResponseBody = {
invoiceId?: string | undefined;
test?: boolean | undefined;
validationErrors?: Array<string> | undefined;
};
/** @internal */
export type SubmitInvoicePeriod$Outbound = {
start: string;
end: string;
};
/** @internal */
export declare const SubmitInvoicePeriod$outboundSchema: z.ZodType<SubmitInvoicePeriod$Outbound, z.ZodTypeDef, SubmitInvoicePeriod>;
export declare function submitInvoicePeriodToJSON(submitInvoicePeriod: SubmitInvoicePeriod): string;
/** @internal */
export type SubmitInvoiceItems$Outbound = {
resourceId?: string | undefined;
billingPlanId: string;
start?: string | undefined;
end?: string | undefined;
name: string;
details?: string | undefined;
price: string;
quantity: number;
units: string;
total: string;
};
/** @internal */
export declare const SubmitInvoiceItems$outboundSchema: z.ZodType<SubmitInvoiceItems$Outbound, z.ZodTypeDef, SubmitInvoiceItems>;
export declare function submitInvoiceItemsToJSON(submitInvoiceItems: SubmitInvoiceItems): string;
/** @internal */
export type SubmitInvoiceDiscounts$Outbound = {
resourceId?: string | undefined;
billingPlanId: string;
start?: string | undefined;
end?: string | undefined;
name: string;
details?: string | undefined;
amount: string;
};
/** @internal */
export declare const SubmitInvoiceDiscounts$outboundSchema: z.ZodType<SubmitInvoiceDiscounts$Outbound, z.ZodTypeDef, SubmitInvoiceDiscounts>;
export declare function submitInvoiceDiscountsToJSON(submitInvoiceDiscounts: SubmitInvoiceDiscounts): string;
/** @internal */
export declare const Result$outboundSchema: z.ZodNativeEnum<typeof Result>;
/** @internal */
export type Test$Outbound = {
validate?: boolean | undefined;
result?: string | undefined;
};
/** @internal */
export declare const Test$outboundSchema: z.ZodType<Test$Outbound, z.ZodTypeDef, Test>;
export declare function testToJSON(test: Test): string;
/** @internal */
export type SubmitInvoiceRequestBody$Outbound = {
externalId?: string | undefined;
invoiceDate: string;
memo?: string | undefined;
period: SubmitInvoicePeriod$Outbound;
items: Array<SubmitInvoiceItems$Outbound>;
discounts?: Array<SubmitInvoiceDiscounts$Outbound> | undefined;
final?: boolean | undefined;
test?: Test$Outbound | undefined;
};
/** @internal */
export declare const SubmitInvoiceRequestBody$outboundSchema: z.ZodType<SubmitInvoiceRequestBody$Outbound, z.ZodTypeDef, SubmitInvoiceRequestBody>;
export declare function submitInvoiceRequestBodyToJSON(submitInvoiceRequestBody: SubmitInvoiceRequestBody): string;
/** @internal */
export type SubmitInvoiceRequest$Outbound = {
integrationConfigurationId: string;
RequestBody: SubmitInvoiceRequestBody$Outbound;
};
/** @internal */
export declare const SubmitInvoiceRequest$outboundSchema: z.ZodType<SubmitInvoiceRequest$Outbound, z.ZodTypeDef, SubmitInvoiceRequest>;
export declare function submitInvoiceRequestToJSON(submitInvoiceRequest: SubmitInvoiceRequest): string;
/** @internal */
export declare const SubmitInvoiceResponseBody$inboundSchema: z.ZodType<SubmitInvoiceResponseBody, z.ZodTypeDef, unknown>;
export declare function submitInvoiceResponseBodyFromJSON(jsonString: string): SafeParseResult<SubmitInvoiceResponseBody, SDKValidationError>;
//# sourceMappingURL=submitinvoiceop.d.ts.map