@flexprice/sdk 2.1.49-dev.1 → 2.1.49-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/sdk/models/billing-address.md +20 -0
- package/docs/sdk/models/billing-details.md +18 -0
- package/docs/sdk/models/billing-entity-mode-response.md +15 -0
- package/docs/sdk/models/billing-entity-mode.md +17 -0
- package/docs/sdk/models/billing-entity-response.md +27 -0
- package/docs/sdk/models/create-billing-entity-request.md +21 -0
- package/docs/sdk/models/create-customer-request.md +1 -0
- package/docs/sdk/models/customer-filter.md +1 -0
- package/docs/sdk/models/customer-response.md +1 -0
- package/docs/sdk/models/customer.md +1 -0
- package/docs/sdk/models/get-billing-entity-request.md +17 -0
- package/docs/sdk/models/invoice-billing-entity.md +17 -0
- package/docs/sdk/models/invoice-filter.md +1 -0
- package/docs/sdk/models/invoice-response.md +2 -0
- package/docs/sdk/models/list-billing-entities-order.md +15 -0
- package/docs/sdk/models/list-billing-entities-request.md +22 -0
- package/docs/sdk/models/list-billing-entities-response.md +16 -0
- package/docs/sdk/models/list-billing-entities-status.md +15 -0
- package/docs/sdk/models/tax-rate-entity-type.md +2 -2
- package/docs/sdk/models/update-billing-entity-request-request.md +19 -0
- package/docs/sdk/models/update-billing-entity-request.md +18 -0
- package/docs/sdk/models/update-customer-request.md +1 -0
- package/docs/sdk/models/webhook-dto-customer.md +1 -0
- package/docs/sdk/models/webhook-dto-invoice.md +1 -0
- package/docs/sdks/billingentities/README.md +442 -0
- package/docs/sdks/subscriptions/README.md +1 -1
- package/esm/funcs/billing-entities-create-billing-entity.d.ts +17 -0
- package/esm/funcs/billing-entities-create-billing-entity.d.ts.map +1 -0
- package/esm/funcs/billing-entities-create-billing-entity.js +83 -0
- package/esm/funcs/billing-entities-create-billing-entity.js.map +1 -0
- package/esm/funcs/billing-entities-enable-billing-entities.d.ts +17 -0
- package/esm/funcs/billing-entities-enable-billing-entities.d.ts.map +1 -0
- package/esm/funcs/billing-entities-enable-billing-entities.js +72 -0
- package/esm/funcs/billing-entities-enable-billing-entities.js.map +1 -0
- package/esm/funcs/billing-entities-get-billing-entities-status.d.ts +17 -0
- package/esm/funcs/billing-entities-get-billing-entities-status.d.ts.map +1 -0
- package/esm/funcs/billing-entities-get-billing-entities-status.js +72 -0
- package/esm/funcs/billing-entities-get-billing-entities-status.js.map +1 -0
- package/esm/funcs/billing-entities-get-billing-entity.d.ts +17 -0
- package/esm/funcs/billing-entities-get-billing-entity.d.ts.map +1 -0
- package/esm/funcs/billing-entities-get-billing-entity.js +91 -0
- package/esm/funcs/billing-entities-get-billing-entity.js.map +1 -0
- package/esm/funcs/billing-entities-list-billing-entities.d.ts +17 -0
- package/esm/funcs/billing-entities-list-billing-entities.d.ts.map +1 -0
- package/esm/funcs/billing-entities-list-billing-entities.js +94 -0
- package/esm/funcs/billing-entities-list-billing-entities.js.map +1 -0
- package/esm/funcs/billing-entities-update-billing-entity.d.ts +17 -0
- package/esm/funcs/billing-entities-update-billing-entity.d.ts.map +1 -0
- package/esm/funcs/billing-entities-update-billing-entity.js +93 -0
- package/esm/funcs/billing-entities-update-billing-entity.js.map +1 -0
- package/esm/funcs/subscriptions-cancel-subscription.js +1 -1
- package/esm/funcs/subscriptions-cancel-subscription.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/sdk/billing-entities.d.ts +47 -0
- package/esm/sdk/billing-entities.d.ts.map +1 -0
- package/esm/sdk/billing-entities.js +68 -0
- package/esm/sdk/billing-entities.js.map +1 -0
- package/esm/sdk/models/billing-address.d.ts +27 -0
- package/esm/sdk/models/billing-address.d.ts.map +1 -0
- package/esm/sdk/models/billing-address.js +50 -0
- package/esm/sdk/models/billing-address.js.map +1 -0
- package/esm/sdk/models/billing-details.d.ts +24 -0
- package/esm/sdk/models/billing-details.d.ts.map +1 -0
- package/esm/sdk/models/billing-details.js +37 -0
- package/esm/sdk/models/billing-details.js.map +1 -0
- package/esm/sdk/models/billing-entity-mode-response.d.ts +11 -0
- package/esm/sdk/models/billing-entity-mode-response.d.ts.map +1 -0
- package/esm/sdk/models/billing-entity-mode-response.js +15 -0
- package/esm/sdk/models/billing-entity-mode-response.js.map +1 -0
- package/esm/sdk/models/billing-entity-mode.d.ts +11 -0
- package/esm/sdk/models/billing-entity-mode.d.ts.map +1 -0
- package/esm/sdk/models/billing-entity-mode.js +12 -0
- package/esm/sdk/models/billing-entity-mode.js.map +1 -0
- package/esm/sdk/models/billing-entity-response.d.ts +26 -0
- package/esm/sdk/models/billing-entity-response.d.ts.map +1 -0
- package/esm/sdk/models/billing-entity-response.js +41 -0
- package/esm/sdk/models/billing-entity-response.js.map +1 -0
- package/esm/sdk/models/create-billing-entity-request.d.ts +23 -0
- package/esm/sdk/models/create-billing-entity-request.d.ts.map +1 -0
- package/esm/sdk/models/create-billing-entity-request.js +22 -0
- package/esm/sdk/models/create-billing-entity-request.js.map +1 -0
- package/esm/sdk/models/create-customer-request.d.ts +8 -0
- package/esm/sdk/models/create-customer-request.d.ts.map +1 -1
- package/esm/sdk/models/create-customer-request.js +2 -0
- package/esm/sdk/models/create-customer-request.js.map +1 -1
- package/esm/sdk/models/customer-filter.d.ts +5 -0
- package/esm/sdk/models/customer-filter.d.ts.map +1 -1
- package/esm/sdk/models/customer-filter.js +2 -0
- package/esm/sdk/models/customer-filter.js.map +1 -1
- package/esm/sdk/models/customer-response.d.ts +4 -0
- package/esm/sdk/models/customer-response.d.ts.map +1 -1
- package/esm/sdk/models/customer-response.js +2 -0
- package/esm/sdk/models/customer-response.js.map +1 -1
- package/esm/sdk/models/customer.d.ts +4 -0
- package/esm/sdk/models/customer.d.ts.map +1 -1
- package/esm/sdk/models/customer.js +2 -0
- package/esm/sdk/models/customer.js.map +1 -1
- package/esm/sdk/models/get-billing-entity-op.d.ts +15 -0
- package/esm/sdk/models/get-billing-entity-op.d.ts.map +1 -0
- package/esm/sdk/models/get-billing-entity-op.js +12 -0
- package/esm/sdk/models/get-billing-entity-op.js.map +1 -0
- package/esm/sdk/models/index.d.ts +12 -0
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +12 -0
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-billing-entity.d.ts +13 -0
- package/esm/sdk/models/invoice-billing-entity.d.ts.map +1 -0
- package/esm/sdk/models/invoice-billing-entity.js +23 -0
- package/esm/sdk/models/invoice-billing-entity.js.map +1 -0
- package/esm/sdk/models/invoice-filter.d.ts +5 -0
- package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
- package/esm/sdk/models/invoice-filter.js +2 -0
- package/esm/sdk/models/invoice-filter.js.map +1 -1
- package/esm/sdk/models/invoice-response.d.ts +6 -0
- package/esm/sdk/models/invoice-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-response.js +5 -0
- package/esm/sdk/models/invoice-response.js.map +1 -1
- package/esm/sdk/models/list-billing-entities-op.d.ts +42 -0
- package/esm/sdk/models/list-billing-entities-op.d.ts.map +1 -0
- package/esm/sdk/models/list-billing-entities-op.js +38 -0
- package/esm/sdk/models/list-billing-entities-op.js.map +1 -0
- package/esm/sdk/models/list-billing-entities-response.d.ts +13 -0
- package/esm/sdk/models/list-billing-entities-response.d.ts.map +1 -0
- package/esm/sdk/models/list-billing-entities-response.js +17 -0
- package/esm/sdk/models/list-billing-entities-response.js.map +1 -0
- package/esm/sdk/models/tax-rate-entity-type.d.ts +1 -0
- package/esm/sdk/models/tax-rate-entity-type.d.ts.map +1 -1
- package/esm/sdk/models/tax-rate-entity-type.js +1 -0
- package/esm/sdk/models/tax-rate-entity-type.js.map +1 -1
- package/esm/sdk/models/update-billing-entity-op.d.ts +21 -0
- package/esm/sdk/models/update-billing-entity-op.d.ts.map +1 -0
- package/esm/sdk/models/update-billing-entity-op.js +14 -0
- package/esm/sdk/models/update-billing-entity-op.js.map +1 -0
- package/esm/sdk/models/update-billing-entity-request.d.ts +23 -0
- package/esm/sdk/models/update-billing-entity-request.d.ts.map +1 -0
- package/esm/sdk/models/update-billing-entity-request.js +22 -0
- package/esm/sdk/models/update-billing-entity-request.js.map +1 -0
- package/esm/sdk/models/update-customer-request.d.ts +5 -0
- package/esm/sdk/models/update-customer-request.d.ts.map +1 -1
- package/esm/sdk/models/update-customer-request.js +2 -0
- package/esm/sdk/models/update-customer-request.js.map +1 -1
- package/esm/sdk/models/webhook-dto-customer.d.ts +1 -0
- package/esm/sdk/models/webhook-dto-customer.d.ts.map +1 -1
- package/esm/sdk/models/webhook-dto-customer.js +2 -0
- package/esm/sdk/models/webhook-dto-customer.js.map +1 -1
- package/esm/sdk/models/webhook-dto-invoice.d.ts +1 -0
- package/esm/sdk/models/webhook-dto-invoice.d.ts.map +1 -1
- package/esm/sdk/models/webhook-dto-invoice.js +2 -0
- package/esm/sdk/models/webhook-dto-invoice.js.map +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/billing-entities-create-billing-entity.ts +172 -0
- package/src/funcs/billing-entities-enable-billing-entities.ts +153 -0
- package/src/funcs/billing-entities-get-billing-entities-status.ts +152 -0
- package/src/funcs/billing-entities-get-billing-entity.ts +181 -0
- package/src/funcs/billing-entities-list-billing-entities.ts +191 -0
- package/src/funcs/billing-entities-update-billing-entity.ts +187 -0
- package/src/funcs/subscriptions-cancel-subscription.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/sdk/billing-entities.ts +115 -0
- package/src/sdk/models/billing-address.ts +91 -0
- package/src/sdk/models/billing-details.ts +79 -0
- package/src/sdk/models/billing-entity-mode-response.ts +35 -0
- package/src/sdk/models/billing-entity-mode.ts +20 -0
- package/src/sdk/models/billing-entity-response.ts +76 -0
- package/src/sdk/models/create-billing-entity-request.ts +53 -0
- package/src/sdk/models/create-customer-request.ts +10 -0
- package/src/sdk/models/customer-filter.ts +7 -0
- package/src/sdk/models/customer-response.ts +6 -0
- package/src/sdk/models/customer.ts +6 -0
- package/src/sdk/models/get-billing-entity-op.ts +33 -0
- package/src/sdk/models/index.ts +12 -0
- package/src/sdk/models/invoice-billing-entity.ts +48 -0
- package/src/sdk/models/invoice-filter.ts +7 -0
- package/src/sdk/models/invoice-response.ts +13 -0
- package/src/sdk/models/list-billing-entities-op.ts +88 -0
- package/src/sdk/models/list-billing-entities-response.ts +41 -0
- package/src/sdk/models/tax-rate-entity-type.ts +1 -0
- package/src/sdk/models/update-billing-entity-op.ts +46 -0
- package/src/sdk/models/update-billing-entity-request.ts +53 -0
- package/src/sdk/models/update-customer-request.ts +7 -0
- package/src/sdk/models/webhook-dto-customer.ts +3 -0
- package/src/sdk/models/webhook-dto-invoice.ts +3 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -24,6 +24,10 @@ import {
|
|
|
24
24
|
CustomerResponse$inboundSchema,
|
|
25
25
|
} from "./customer-response.js";
|
|
26
26
|
import { FxConversion, FxConversion$inboundSchema } from "./fx-conversion.js";
|
|
27
|
+
import {
|
|
28
|
+
InvoiceBillingEntity,
|
|
29
|
+
InvoiceBillingEntity$inboundSchema,
|
|
30
|
+
} from "./invoice-billing-entity.js";
|
|
27
31
|
import {
|
|
28
32
|
InvoiceLineItemResponse,
|
|
29
33
|
InvoiceLineItemResponse$inboundSchema,
|
|
@@ -77,6 +81,11 @@ export type InvoiceResponse = {
|
|
|
77
81
|
* amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid)
|
|
78
82
|
*/
|
|
79
83
|
amountRemaining?: string | undefined;
|
|
84
|
+
billingEntity?: InvoiceBillingEntity | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* BillingEntityID is the entity that bills the invoice; nil while the environment has no billing entities. Never changes once set.
|
|
87
|
+
*/
|
|
88
|
+
billingEntityId?: string | undefined;
|
|
80
89
|
/**
|
|
81
90
|
* billing_period describes the billing period this invoice covers (e.g., "January 2024", "Q1 2024")
|
|
82
91
|
*/
|
|
@@ -262,6 +271,8 @@ export const InvoiceResponse$inboundSchema: z.ZodMiniType<
|
|
|
262
271
|
amount_due: types.optional(types.string()),
|
|
263
272
|
amount_paid: types.optional(types.string()),
|
|
264
273
|
amount_remaining: types.optional(types.string()),
|
|
274
|
+
billing_entity: types.optional(InvoiceBillingEntity$inboundSchema),
|
|
275
|
+
billing_entity_id: types.optional(types.string()),
|
|
265
276
|
billing_period: types.optional(types.string()),
|
|
266
277
|
billing_reason: types.optional(types.string()),
|
|
267
278
|
billing_sequence: types.optional(types.number()),
|
|
@@ -328,6 +339,8 @@ export const InvoiceResponse$inboundSchema: z.ZodMiniType<
|
|
|
328
339
|
"amount_due": "amountDue",
|
|
329
340
|
"amount_paid": "amountPaid",
|
|
330
341
|
"amount_remaining": "amountRemaining",
|
|
342
|
+
"billing_entity": "billingEntity",
|
|
343
|
+
"billing_entity_id": "billingEntityId",
|
|
331
344
|
"billing_period": "billingPeriod",
|
|
332
345
|
"billing_reason": "billingReason",
|
|
333
346
|
"billing_sequence": "billingSequence",
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ListBillingEntitiesOrder = {
|
|
10
|
+
Asc: "asc",
|
|
11
|
+
Desc: "desc",
|
|
12
|
+
} as const;
|
|
13
|
+
export type ListBillingEntitiesOrder = ClosedEnum<
|
|
14
|
+
typeof ListBillingEntitiesOrder
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export const ListBillingEntitiesStatus = {
|
|
18
|
+
Published: "published",
|
|
19
|
+
Deleted: "deleted",
|
|
20
|
+
Archived: "archived",
|
|
21
|
+
} as const;
|
|
22
|
+
export type ListBillingEntitiesStatus = ClosedEnum<
|
|
23
|
+
typeof ListBillingEntitiesStatus
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type ListBillingEntitiesRequest = {
|
|
27
|
+
billingEntityIds?: Array<string> | undefined;
|
|
28
|
+
expand?: string | undefined;
|
|
29
|
+
isDefault?: boolean | undefined;
|
|
30
|
+
limit?: number | undefined;
|
|
31
|
+
offset?: number | undefined;
|
|
32
|
+
order?: ListBillingEntitiesOrder | undefined;
|
|
33
|
+
sort?: string | undefined;
|
|
34
|
+
status?: ListBillingEntitiesStatus | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ListBillingEntitiesOrder$outboundSchema: z.ZodMiniEnum<
|
|
39
|
+
typeof ListBillingEntitiesOrder
|
|
40
|
+
> = z.enum(ListBillingEntitiesOrder);
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const ListBillingEntitiesStatus$outboundSchema: z.ZodMiniEnum<
|
|
44
|
+
typeof ListBillingEntitiesStatus
|
|
45
|
+
> = z.enum(ListBillingEntitiesStatus);
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export type ListBillingEntitiesRequest$Outbound = {
|
|
49
|
+
billing_entity_ids?: Array<string> | undefined;
|
|
50
|
+
expand?: string | undefined;
|
|
51
|
+
is_default?: boolean | undefined;
|
|
52
|
+
limit?: number | undefined;
|
|
53
|
+
offset?: number | undefined;
|
|
54
|
+
order?: string | undefined;
|
|
55
|
+
sort?: string | undefined;
|
|
56
|
+
status?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const ListBillingEntitiesRequest$outboundSchema: z.ZodMiniType<
|
|
61
|
+
ListBillingEntitiesRequest$Outbound,
|
|
62
|
+
ListBillingEntitiesRequest
|
|
63
|
+
> = z.pipe(
|
|
64
|
+
z.object({
|
|
65
|
+
billingEntityIds: z.optional(z.array(z.string())),
|
|
66
|
+
expand: z.optional(z.string()),
|
|
67
|
+
isDefault: z.optional(z.boolean()),
|
|
68
|
+
limit: z.optional(z.int()),
|
|
69
|
+
offset: z.optional(z.int()),
|
|
70
|
+
order: z.optional(ListBillingEntitiesOrder$outboundSchema),
|
|
71
|
+
sort: z.optional(z.string()),
|
|
72
|
+
status: z.optional(ListBillingEntitiesStatus$outboundSchema),
|
|
73
|
+
}),
|
|
74
|
+
z.transform((v) => {
|
|
75
|
+
return remap$(v, {
|
|
76
|
+
billingEntityIds: "billing_entity_ids",
|
|
77
|
+
isDefault: "is_default",
|
|
78
|
+
});
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
export function listBillingEntitiesRequestToJSON(
|
|
83
|
+
listBillingEntitiesRequest: ListBillingEntitiesRequest,
|
|
84
|
+
): string {
|
|
85
|
+
return JSON.stringify(
|
|
86
|
+
ListBillingEntitiesRequest$outboundSchema.parse(listBillingEntitiesRequest),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import {
|
|
10
|
+
BillingEntityResponse,
|
|
11
|
+
BillingEntityResponse$inboundSchema,
|
|
12
|
+
} from "./billing-entity-response.js";
|
|
13
|
+
import {
|
|
14
|
+
PaginationResponse,
|
|
15
|
+
PaginationResponse$inboundSchema,
|
|
16
|
+
} from "./pagination-response.js";
|
|
17
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
18
|
+
|
|
19
|
+
export type ListBillingEntitiesResponse = {
|
|
20
|
+
items?: Array<BillingEntityResponse> | undefined;
|
|
21
|
+
pagination?: PaginationResponse | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ListBillingEntitiesResponse$inboundSchema: z.ZodMiniType<
|
|
26
|
+
ListBillingEntitiesResponse,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
items: types.optional(z.array(BillingEntityResponse$inboundSchema)),
|
|
30
|
+
pagination: types.optional(PaginationResponse$inboundSchema),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export function listBillingEntitiesResponseFromJSON(
|
|
34
|
+
jsonString: string,
|
|
35
|
+
): SafeParseResult<ListBillingEntitiesResponse, SDKValidationError> {
|
|
36
|
+
return safeParse(
|
|
37
|
+
jsonString,
|
|
38
|
+
(x) => ListBillingEntitiesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
39
|
+
`Failed to parse 'ListBillingEntitiesResponse' from JSON`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
UpdateBillingEntityRequest,
|
|
8
|
+
UpdateBillingEntityRequest$Outbound,
|
|
9
|
+
UpdateBillingEntityRequest$outboundSchema,
|
|
10
|
+
} from "./update-billing-entity-request.js";
|
|
11
|
+
|
|
12
|
+
export type UpdateBillingEntityRequestRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Billing entity ID
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Fields to change
|
|
19
|
+
*/
|
|
20
|
+
body: UpdateBillingEntityRequest;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type UpdateBillingEntityRequestRequest$Outbound = {
|
|
25
|
+
id: string;
|
|
26
|
+
body: UpdateBillingEntityRequest$Outbound;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const UpdateBillingEntityRequestRequest$outboundSchema: z.ZodMiniType<
|
|
31
|
+
UpdateBillingEntityRequestRequest$Outbound,
|
|
32
|
+
UpdateBillingEntityRequestRequest
|
|
33
|
+
> = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
body: UpdateBillingEntityRequest$outboundSchema,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function updateBillingEntityRequestRequestToJSON(
|
|
39
|
+
updateBillingEntityRequestRequest: UpdateBillingEntityRequestRequest,
|
|
40
|
+
): string {
|
|
41
|
+
return JSON.stringify(
|
|
42
|
+
UpdateBillingEntityRequestRequest$outboundSchema.parse(
|
|
43
|
+
updateBillingEntityRequestRequest,
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
BillingDetails,
|
|
9
|
+
BillingDetails$Outbound,
|
|
10
|
+
BillingDetails$outboundSchema,
|
|
11
|
+
} from "./billing-details.js";
|
|
12
|
+
|
|
13
|
+
export type UpdateBillingEntityRequest = {
|
|
14
|
+
billingDetails?: BillingDetails | undefined;
|
|
15
|
+
invoiceNumberPrefix?: string | undefined;
|
|
16
|
+
metadata?: { [k: string]: string } | undefined;
|
|
17
|
+
name?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type UpdateBillingEntityRequest$Outbound = {
|
|
22
|
+
billing_details?: BillingDetails$Outbound | undefined;
|
|
23
|
+
invoice_number_prefix?: string | undefined;
|
|
24
|
+
metadata?: { [k: string]: string } | undefined;
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const UpdateBillingEntityRequest$outboundSchema: z.ZodMiniType<
|
|
30
|
+
UpdateBillingEntityRequest$Outbound,
|
|
31
|
+
UpdateBillingEntityRequest
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
billingDetails: z.optional(BillingDetails$outboundSchema),
|
|
35
|
+
invoiceNumberPrefix: z.optional(z.string()),
|
|
36
|
+
metadata: z.optional(z.record(z.string(), z.string())),
|
|
37
|
+
name: z.optional(z.string()),
|
|
38
|
+
}),
|
|
39
|
+
z.transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
billingDetails: "billing_details",
|
|
42
|
+
invoiceNumberPrefix: "invoice_number_prefix",
|
|
43
|
+
});
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export function updateBillingEntityRequestToJSON(
|
|
48
|
+
updateBillingEntityRequest: UpdateBillingEntityRequest,
|
|
49
|
+
): string {
|
|
50
|
+
return JSON.stringify(
|
|
51
|
+
UpdateBillingEntityRequest$outboundSchema.parse(updateBillingEntityRequest),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -48,6 +48,10 @@ export type UpdateCustomerRequest = {
|
|
|
48
48
|
* billing_currency updates the invoicing currency; send "" to clear it back to the charge currency
|
|
49
49
|
*/
|
|
50
50
|
billingCurrency?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* billing_entity_id cannot be changed; sending it is rejected
|
|
53
|
+
*/
|
|
54
|
+
billingEntityId?: string | undefined;
|
|
51
55
|
/**
|
|
52
56
|
* contact is the updated contact number for the customer (e.g. phone)
|
|
53
57
|
*/
|
|
@@ -94,6 +98,7 @@ export type UpdateCustomerRequest$Outbound = {
|
|
|
94
98
|
address_postal_code?: string | undefined;
|
|
95
99
|
address_state?: string | undefined;
|
|
96
100
|
billing_currency?: string | undefined;
|
|
101
|
+
billing_entity_id?: string | undefined;
|
|
97
102
|
contact?: string | undefined;
|
|
98
103
|
contact_persons?: Array<CustomerContactPerson$Outbound> | undefined;
|
|
99
104
|
email?: string | undefined;
|
|
@@ -120,6 +125,7 @@ export const UpdateCustomerRequest$outboundSchema: z.ZodMiniType<
|
|
|
120
125
|
addressPostalCode: z.optional(z.string()),
|
|
121
126
|
addressState: z.optional(z.string()),
|
|
122
127
|
billingCurrency: z.optional(z.string()),
|
|
128
|
+
billingEntityId: z.optional(z.string()),
|
|
123
129
|
contact: z.optional(z.string()),
|
|
124
130
|
contactPersons: z.optional(z.array(CustomerContactPerson$outboundSchema)),
|
|
125
131
|
email: z.optional(z.string()),
|
|
@@ -141,6 +147,7 @@ export const UpdateCustomerRequest$outboundSchema: z.ZodMiniType<
|
|
|
141
147
|
addressPostalCode: "address_postal_code",
|
|
142
148
|
addressState: "address_state",
|
|
143
149
|
billingCurrency: "billing_currency",
|
|
150
|
+
billingEntityId: "billing_entity_id",
|
|
144
151
|
contactPersons: "contact_persons",
|
|
145
152
|
externalId: "external_id",
|
|
146
153
|
integrationEntityMapping: "integration_entity_mapping",
|
|
@@ -16,6 +16,7 @@ export type WebhookDtoCustomer = {
|
|
|
16
16
|
addressLine2?: string | undefined;
|
|
17
17
|
addressPostalCode?: string | undefined;
|
|
18
18
|
addressState?: string | undefined;
|
|
19
|
+
billingEntityId?: string | undefined;
|
|
19
20
|
email?: string | undefined;
|
|
20
21
|
environmentId?: string | undefined;
|
|
21
22
|
externalId?: string | undefined;
|
|
@@ -37,6 +38,7 @@ export const WebhookDtoCustomer$inboundSchema: z.ZodMiniType<
|
|
|
37
38
|
address_line2: types.optional(types.string()),
|
|
38
39
|
address_postal_code: types.optional(types.string()),
|
|
39
40
|
address_state: types.optional(types.string()),
|
|
41
|
+
billing_entity_id: types.optional(types.string()),
|
|
40
42
|
email: types.optional(types.string()),
|
|
41
43
|
environment_id: types.optional(types.string()),
|
|
42
44
|
external_id: types.optional(types.string()),
|
|
@@ -53,6 +55,7 @@ export const WebhookDtoCustomer$inboundSchema: z.ZodMiniType<
|
|
|
53
55
|
"address_line2": "addressLine2",
|
|
54
56
|
"address_postal_code": "addressPostalCode",
|
|
55
57
|
"address_state": "addressState",
|
|
58
|
+
"billing_entity_id": "billingEntityId",
|
|
56
59
|
"environment_id": "environmentId",
|
|
57
60
|
"external_id": "externalId",
|
|
58
61
|
});
|
|
@@ -44,6 +44,7 @@ export type WebhookDtoInvoice = {
|
|
|
44
44
|
amountDue?: string | undefined;
|
|
45
45
|
amountPaid?: string | undefined;
|
|
46
46
|
amountRemaining?: string | undefined;
|
|
47
|
+
billingEntityId?: string | undefined;
|
|
47
48
|
billingPeriod?: string | undefined;
|
|
48
49
|
billingReason?: string | undefined;
|
|
49
50
|
billingSequence?: number | undefined;
|
|
@@ -91,6 +92,7 @@ export const WebhookDtoInvoice$inboundSchema: z.ZodMiniType<
|
|
|
91
92
|
amount_due: types.optional(types.string()),
|
|
92
93
|
amount_paid: types.optional(types.string()),
|
|
93
94
|
amount_remaining: types.optional(types.string()),
|
|
95
|
+
billing_entity_id: types.optional(types.string()),
|
|
94
96
|
billing_period: types.optional(types.string()),
|
|
95
97
|
billing_reason: types.optional(types.string()),
|
|
96
98
|
billing_sequence: types.optional(types.number()),
|
|
@@ -137,6 +139,7 @@ export const WebhookDtoInvoice$inboundSchema: z.ZodMiniType<
|
|
|
137
139
|
"amount_due": "amountDue",
|
|
138
140
|
"amount_paid": "amountPaid",
|
|
139
141
|
"amount_remaining": "amountRemaining",
|
|
142
|
+
"billing_entity_id": "billingEntityId",
|
|
140
143
|
"billing_period": "billingPeriod",
|
|
141
144
|
"billing_reason": "billingReason",
|
|
142
145
|
"billing_sequence": "billingSequence",
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Addons } from "./addons.js";
|
|
|
9
9
|
import { AlertSettings } from "./alert-settings.js";
|
|
10
10
|
import { Alerts } from "./alerts.js";
|
|
11
11
|
import { Analytics } from "./analytics.js";
|
|
12
|
+
import { BillingEntities } from "./billing-entities.js";
|
|
12
13
|
import { Checkout } from "./checkout.js";
|
|
13
14
|
import { Commitments } from "./commitments.js";
|
|
14
15
|
import { Contracts } from "./contracts.js";
|
|
@@ -92,6 +93,11 @@ export class Flexprice extends ClientSDK {
|
|
|
92
93
|
return (this._analytics ??= new Analytics(this._options));
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
private _billingEntities?: BillingEntities;
|
|
97
|
+
get billingEntities(): BillingEntities {
|
|
98
|
+
return (this._billingEntities ??= new BillingEntities(this._options));
|
|
99
|
+
}
|
|
100
|
+
|
|
95
101
|
private _checkout?: Checkout;
|
|
96
102
|
get checkout(): Checkout {
|
|
97
103
|
return (this._checkout ??= new Checkout(this._options));
|