mollie-api-typescript 1.2.1 → 1.2.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/FUNCTIONS.md +1 -1
- package/README.md +14 -7
- package/bin/mcp-server.js +749 -260
- package/bin/mcp-server.js.map +26 -15
- package/dist/commonjs/funcs/sessionsCreate.d.ts +23 -0
- package/dist/commonjs/funcs/sessionsCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/sessionsCreate.js +139 -0
- package/dist/commonjs/funcs/sessionsCreate.js.map +1 -0
- package/dist/commonjs/funcs/sessionsGet.d.ts +22 -0
- package/dist/commonjs/funcs/sessionsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/sessionsGet.js +136 -0
- package/dist/commonjs/funcs/sessionsGet.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/sessionsCreate.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/sessionsCreate.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/sessionsCreate.js +68 -0
- package/dist/commonjs/mcp-server/tools/sessionsCreate.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/sessionsGet.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/sessionsGet.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/sessionsGet.js +68 -0
- package/dist/commonjs/mcp-server/tools/sessionsGet.js.map +1 -0
- package/dist/commonjs/models/entitybalancetransaction.d.ts +8 -8
- package/dist/commonjs/models/entitybalancetransaction.d.ts.map +1 -1
- package/dist/commonjs/models/entitybalancetransaction.js +11 -11
- package/dist/commonjs/models/entitybalancetransaction.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +6 -1
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +6 -1
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/listsalesinvoiceresponse.d.ts +12 -0
- package/dist/commonjs/models/listsalesinvoiceresponse.d.ts.map +1 -1
- package/dist/commonjs/models/listsalesinvoiceresponse.js +2 -0
- package/dist/commonjs/models/listsalesinvoiceresponse.js.map +1 -1
- package/dist/commonjs/models/operations/createsession.d.ts +23 -0
- package/dist/commonjs/models/operations/createsession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createsession.js +72 -0
- package/dist/commonjs/models/operations/createsession.js.map +1 -0
- package/dist/commonjs/models/operations/getmethod.d.ts +1 -1
- package/dist/commonjs/models/operations/getmethod.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmethod.js +2 -2
- package/dist/commonjs/models/operations/getmethod.js.map +1 -1
- package/dist/commonjs/models/operations/getsession.d.ts +25 -0
- package/dist/commonjs/models/operations/getsession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getsession.js +69 -0
- package/dist/commonjs/models/operations/getsession.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/updatesalesinvoice.d.ts +10 -0
- package/dist/commonjs/models/operations/updatesalesinvoice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatesalesinvoice.js +2 -0
- package/dist/commonjs/models/operations/updatesalesinvoice.js.map +1 -1
- package/dist/commonjs/models/salesinvoicerequest.d.ts +12 -0
- package/dist/commonjs/models/salesinvoicerequest.d.ts.map +1 -1
- package/dist/commonjs/models/salesinvoicerequest.js +2 -0
- package/dist/commonjs/models/salesinvoicerequest.js.map +1 -1
- package/dist/commonjs/models/salesinvoiceresponse.d.ts +12 -0
- package/dist/commonjs/models/salesinvoiceresponse.d.ts.map +1 -1
- package/dist/commonjs/models/salesinvoiceresponse.js +2 -0
- package/dist/commonjs/models/salesinvoiceresponse.js.map +1 -1
- package/dist/commonjs/models/sessionlineitem.d.ts +84 -0
- package/dist/commonjs/models/sessionlineitem.d.ts.map +1 -0
- package/dist/commonjs/models/sessionlineitem.js +82 -0
- package/dist/commonjs/models/sessionlineitem.js.map +1 -0
- package/dist/commonjs/models/sessionlineitemresponse.d.ts +84 -0
- package/dist/commonjs/models/sessionlineitemresponse.d.ts.map +1 -0
- package/dist/commonjs/models/sessionlineitemresponse.js +82 -0
- package/dist/commonjs/models/sessionlineitemresponse.js.map +1 -0
- package/dist/commonjs/models/sessionrequest.d.ts +119 -0
- package/dist/commonjs/models/sessionrequest.d.ts.map +1 -0
- package/dist/commonjs/models/sessionrequest.js +100 -0
- package/dist/commonjs/models/sessionrequest.js.map +1 -0
- package/dist/commonjs/models/sessionresponse.d.ts +181 -0
- package/dist/commonjs/models/sessionresponse.d.ts.map +1 -0
- package/dist/commonjs/models/sessionresponse.js +152 -0
- package/dist/commonjs/models/sessionresponse.js.map +1 -0
- package/dist/commonjs/models/sessionsequencetype.d.ts +12 -0
- package/dist/commonjs/models/sessionsequencetype.d.ts.map +1 -0
- package/dist/commonjs/models/sessionsequencetype.js +49 -0
- package/dist/commonjs/models/sessionsequencetype.js.map +1 -0
- package/dist/commonjs/models/sessionsequencetyperesponse.d.ts +12 -0
- package/dist/commonjs/models/sessionsequencetyperesponse.d.ts.map +1 -0
- package/dist/commonjs/models/sessionsequencetyperesponse.js +49 -0
- package/dist/commonjs/models/sessionsequencetyperesponse.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/sessions.d.ts +28 -0
- package/dist/commonjs/sdk/sessions.d.ts.map +1 -0
- package/dist/commonjs/sdk/sessions.js +40 -0
- package/dist/commonjs/sdk/sessions.js.map +1 -0
- package/dist/esm/funcs/sessionsCreate.d.ts +23 -0
- package/dist/esm/funcs/sessionsCreate.d.ts.map +1 -0
- package/dist/esm/funcs/sessionsCreate.js +103 -0
- package/dist/esm/funcs/sessionsCreate.js.map +1 -0
- package/dist/esm/funcs/sessionsGet.d.ts +22 -0
- package/dist/esm/funcs/sessionsGet.d.ts.map +1 -0
- package/dist/esm/funcs/sessionsGet.js +100 -0
- package/dist/esm/funcs/sessionsGet.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/sessionsCreate.d.ts +8 -0
- package/dist/esm/mcp-server/tools/sessionsCreate.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/sessionsCreate.js +32 -0
- package/dist/esm/mcp-server/tools/sessionsCreate.js.map +1 -0
- package/dist/esm/mcp-server/tools/sessionsGet.d.ts +8 -0
- package/dist/esm/mcp-server/tools/sessionsGet.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/sessionsGet.js +32 -0
- package/dist/esm/mcp-server/tools/sessionsGet.js.map +1 -0
- package/dist/esm/models/entitybalancetransaction.d.ts +8 -8
- package/dist/esm/models/entitybalancetransaction.d.ts.map +1 -1
- package/dist/esm/models/entitybalancetransaction.js +8 -8
- package/dist/esm/models/entitybalancetransaction.js.map +1 -1
- package/dist/esm/models/index.d.ts +6 -1
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +6 -1
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/listsalesinvoiceresponse.d.ts +12 -0
- package/dist/esm/models/listsalesinvoiceresponse.d.ts.map +1 -1
- package/dist/esm/models/listsalesinvoiceresponse.js +2 -0
- package/dist/esm/models/listsalesinvoiceresponse.js.map +1 -1
- package/dist/esm/models/operations/createsession.d.ts +23 -0
- package/dist/esm/models/operations/createsession.d.ts.map +1 -0
- package/dist/esm/models/operations/createsession.js +34 -0
- package/dist/esm/models/operations/createsession.js.map +1 -0
- package/dist/esm/models/operations/getmethod.d.ts +1 -1
- package/dist/esm/models/operations/getmethod.d.ts.map +1 -1
- package/dist/esm/models/operations/getmethod.js +2 -2
- package/dist/esm/models/operations/getmethod.js.map +1 -1
- package/dist/esm/models/operations/getsession.d.ts +25 -0
- package/dist/esm/models/operations/getsession.d.ts.map +1 -0
- package/dist/esm/models/operations/getsession.js +31 -0
- package/dist/esm/models/operations/getsession.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/updatesalesinvoice.d.ts +10 -0
- package/dist/esm/models/operations/updatesalesinvoice.d.ts.map +1 -1
- package/dist/esm/models/operations/updatesalesinvoice.js +2 -0
- package/dist/esm/models/operations/updatesalesinvoice.js.map +1 -1
- package/dist/esm/models/salesinvoicerequest.d.ts +12 -0
- package/dist/esm/models/salesinvoicerequest.d.ts.map +1 -1
- package/dist/esm/models/salesinvoicerequest.js +2 -0
- package/dist/esm/models/salesinvoicerequest.js.map +1 -1
- package/dist/esm/models/salesinvoiceresponse.d.ts +12 -0
- package/dist/esm/models/salesinvoiceresponse.d.ts.map +1 -1
- package/dist/esm/models/salesinvoiceresponse.js +2 -0
- package/dist/esm/models/salesinvoiceresponse.js.map +1 -1
- package/dist/esm/models/sessionlineitem.d.ts +84 -0
- package/dist/esm/models/sessionlineitem.d.ts.map +1 -0
- package/dist/esm/models/sessionlineitem.js +44 -0
- package/dist/esm/models/sessionlineitem.js.map +1 -0
- package/dist/esm/models/sessionlineitemresponse.d.ts +84 -0
- package/dist/esm/models/sessionlineitemresponse.d.ts.map +1 -0
- package/dist/esm/models/sessionlineitemresponse.js +44 -0
- package/dist/esm/models/sessionlineitemresponse.js.map +1 -0
- package/dist/esm/models/sessionrequest.d.ts +119 -0
- package/dist/esm/models/sessionrequest.d.ts.map +1 -0
- package/dist/esm/models/sessionrequest.js +60 -0
- package/dist/esm/models/sessionrequest.js.map +1 -0
- package/dist/esm/models/sessionresponse.d.ts +181 -0
- package/dist/esm/models/sessionresponse.d.ts.map +1 -0
- package/dist/esm/models/sessionresponse.js +110 -0
- package/dist/esm/models/sessionresponse.js.map +1 -0
- package/dist/esm/models/sessionsequencetype.d.ts +12 -0
- package/dist/esm/models/sessionsequencetype.d.ts.map +1 -0
- package/dist/esm/models/sessionsequencetype.js +13 -0
- package/dist/esm/models/sessionsequencetype.js.map +1 -0
- package/dist/esm/models/sessionsequencetyperesponse.d.ts +12 -0
- package/dist/esm/models/sessionsequencetyperesponse.d.ts.map +1 -0
- package/dist/esm/models/sessionsequencetyperesponse.js +13 -0
- package/dist/esm/models/sessionsequencetyperesponse.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/sessions.d.ts +28 -0
- package/dist/esm/sdk/sessions.d.ts.map +1 -0
- package/dist/esm/sdk/sessions.js +36 -0
- package/dist/esm/sdk/sessions.js.map +1 -0
- package/examples/balancesList.example.ts +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/sessionsCreate.ts +195 -0
- package/src/funcs/sessionsGet.ts +187 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/sessionsCreate.ts +41 -0
- package/src/mcp-server/tools/sessionsGet.ts +41 -0
- package/src/models/entitybalancetransaction.ts +33 -20
- package/src/models/index.ts +6 -1
- package/src/models/listsalesinvoiceresponse.ts +14 -0
- package/src/models/operations/createsession.ts +70 -0
- package/src/models/operations/getmethod.ts +3 -3
- package/src/models/operations/getsession.ts +70 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/updatesalesinvoice.ts +12 -0
- package/src/models/salesinvoicerequest.ts +14 -0
- package/src/models/salesinvoiceresponse.ts +14 -0
- package/src/models/sessionlineitem.ts +147 -0
- package/src/models/sessionlineitemresponse.ts +149 -0
- package/src/models/sessionrequest.ts +216 -0
- package/src/models/sessionresponse.ts +347 -0
- package/src/models/sessionsequencetype.ts +21 -0
- package/src/models/sessionsequencetyperesponse.ts +28 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/sessions.ts +54 -0
- package/dist/commonjs/models/methodid.d.ts +0 -65
- package/dist/commonjs/models/methodid.d.ts.map +0 -1
- package/dist/commonjs/models/methodid.js +0 -91
- package/dist/commonjs/models/methodid.js.map +0 -1
- package/dist/esm/models/methodid.d.ts +0 -65
- package/dist/esm/models/methodid.d.ts.map +0 -1
- package/dist/esm/models/methodid.js +0 -55
- package/dist/esm/models/methodid.js.map +0 -1
- package/src/models/methodid.ts +0 -79
|
@@ -67,6 +67,15 @@ export type UpdateSalesInvoiceRequestBody = {
|
|
|
67
67
|
*/
|
|
68
68
|
lines?: Array<models.SalesInvoiceLineItem> | null | undefined;
|
|
69
69
|
discount?: models.SalesInvoiceDiscount | null | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* This indicates whether the invoice is an e-invoice. The default value is `false` and can't be changed
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* after the invoice has been issued.
|
|
75
|
+
*
|
|
76
|
+
* When `emailDetails` is provided, an additional email is sent to the recipient.
|
|
77
|
+
*/
|
|
78
|
+
isEInvoice?: boolean | undefined;
|
|
70
79
|
};
|
|
71
80
|
|
|
72
81
|
export type UpdateSalesInvoiceRequest = {
|
|
@@ -100,6 +109,7 @@ export const UpdateSalesInvoiceRequestBody$inboundSchema: z.ZodType<
|
|
|
100
109
|
lines: z.nullable(z.array(models.SalesInvoiceLineItem$inboundSchema))
|
|
101
110
|
.optional(),
|
|
102
111
|
discount: z.nullable(models.SalesInvoiceDiscount$inboundSchema).optional(),
|
|
112
|
+
isEInvoice: z.boolean().optional(),
|
|
103
113
|
});
|
|
104
114
|
/** @internal */
|
|
105
115
|
export type UpdateSalesInvoiceRequestBody$Outbound = {
|
|
@@ -113,6 +123,7 @@ export type UpdateSalesInvoiceRequestBody$Outbound = {
|
|
|
113
123
|
recipient?: models.SalesInvoiceRecipient$Outbound | null | undefined;
|
|
114
124
|
lines?: Array<models.SalesInvoiceLineItem$Outbound> | null | undefined;
|
|
115
125
|
discount?: models.SalesInvoiceDiscount$Outbound | null | undefined;
|
|
126
|
+
isEInvoice?: boolean | undefined;
|
|
116
127
|
};
|
|
117
128
|
|
|
118
129
|
/** @internal */
|
|
@@ -134,6 +145,7 @@ export const UpdateSalesInvoiceRequestBody$outboundSchema: z.ZodType<
|
|
|
134
145
|
lines: z.nullable(z.array(models.SalesInvoiceLineItem$outboundSchema))
|
|
135
146
|
.optional(),
|
|
136
147
|
discount: z.nullable(models.SalesInvoiceDiscount$outboundSchema).optional(),
|
|
148
|
+
isEInvoice: z.boolean().optional(),
|
|
137
149
|
});
|
|
138
150
|
|
|
139
151
|
export function updateSalesInvoiceRequestBodyToJSON(
|
|
@@ -165,6 +165,17 @@ export type SalesInvoiceRequest = {
|
|
|
165
165
|
*/
|
|
166
166
|
lines: Array<SalesInvoiceLineItem> | null;
|
|
167
167
|
discount?: SalesInvoiceDiscount | null | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* This indicates whether the invoice is an e-invoice. The default value is `false` and can't be changed
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* after the invoice has been issued. When `emailDetails` is provided, an additional email is sent to the
|
|
173
|
+
* recipient.
|
|
174
|
+
*
|
|
175
|
+
* E-invoicing is only available for merchants based in Belgium, Germany, and the Netherlands, and only when
|
|
176
|
+
* the recipient is also located in one of these countries.
|
|
177
|
+
*/
|
|
178
|
+
isEInvoice?: boolean | undefined;
|
|
168
179
|
};
|
|
169
180
|
|
|
170
181
|
/** @internal */
|
|
@@ -225,6 +236,7 @@ export const SalesInvoiceRequest$inboundSchema: z.ZodType<
|
|
|
225
236
|
recipient: z.nullable(SalesInvoiceRecipient$inboundSchema),
|
|
226
237
|
lines: z.nullable(z.array(SalesInvoiceLineItem$inboundSchema)),
|
|
227
238
|
discount: z.nullable(SalesInvoiceDiscount$inboundSchema).optional(),
|
|
239
|
+
isEInvoice: z.boolean().optional(),
|
|
228
240
|
});
|
|
229
241
|
/** @internal */
|
|
230
242
|
export type SalesInvoiceRequest$Outbound = {
|
|
@@ -244,6 +256,7 @@ export type SalesInvoiceRequest$Outbound = {
|
|
|
244
256
|
recipient: SalesInvoiceRecipient$Outbound | null;
|
|
245
257
|
lines: Array<SalesInvoiceLineItem$Outbound> | null;
|
|
246
258
|
discount?: SalesInvoiceDiscount$Outbound | null | undefined;
|
|
259
|
+
isEInvoice?: boolean | undefined;
|
|
247
260
|
};
|
|
248
261
|
|
|
249
262
|
/** @internal */
|
|
@@ -269,6 +282,7 @@ export const SalesInvoiceRequest$outboundSchema: z.ZodType<
|
|
|
269
282
|
recipient: z.nullable(SalesInvoiceRecipient$outboundSchema),
|
|
270
283
|
lines: z.nullable(z.array(SalesInvoiceLineItem$outboundSchema)),
|
|
271
284
|
discount: z.nullable(SalesInvoiceDiscount$outboundSchema).optional(),
|
|
285
|
+
isEInvoice: z.boolean().optional(),
|
|
272
286
|
});
|
|
273
287
|
|
|
274
288
|
export function salesInvoiceRequestToJSON(
|
|
@@ -282,6 +282,17 @@ export type SalesInvoiceResponse = {
|
|
|
282
282
|
*/
|
|
283
283
|
lines?: Array<SalesInvoiceLineItemResponse> | null | undefined;
|
|
284
284
|
discount?: SalesInvoiceDiscountResponse | null | undefined;
|
|
285
|
+
/**
|
|
286
|
+
* This indicates whether the invoice is an e-invoice. The default value is `false` and can't be changed
|
|
287
|
+
*
|
|
288
|
+
* @remarks
|
|
289
|
+
* after the invoice has been issued. When `emailDetails` is provided, an additional email is sent to the
|
|
290
|
+
* recipient.
|
|
291
|
+
*
|
|
292
|
+
* E-invoicing is only available for merchants based in Belgium, Germany, and the Netherlands, and only when
|
|
293
|
+
* the recipient is also located in one of these countries.
|
|
294
|
+
*/
|
|
295
|
+
isEInvoice?: boolean | undefined;
|
|
285
296
|
/**
|
|
286
297
|
* The amount that is left to be paid.
|
|
287
298
|
*/
|
|
@@ -683,6 +694,7 @@ export const SalesInvoiceResponse$inboundSchema: z.ZodType<
|
|
|
683
694
|
lines: z.nullable(z.array(SalesInvoiceLineItemResponse$inboundSchema))
|
|
684
695
|
.optional(),
|
|
685
696
|
discount: z.nullable(SalesInvoiceDiscountResponse$inboundSchema).optional(),
|
|
697
|
+
isEInvoice: z.boolean().optional(),
|
|
686
698
|
amountDue: z.lazy(() => SalesInvoiceResponseAmountDue$inboundSchema)
|
|
687
699
|
.optional(),
|
|
688
700
|
subtotalAmount: z.lazy(() => SalesInvoiceResponseSubtotalAmount$inboundSchema)
|
|
@@ -725,6 +737,7 @@ export type SalesInvoiceResponse$Outbound = {
|
|
|
725
737
|
recipient?: SalesInvoiceRecipientResponse$Outbound | null | undefined;
|
|
726
738
|
lines?: Array<SalesInvoiceLineItemResponse$Outbound> | null | undefined;
|
|
727
739
|
discount?: SalesInvoiceDiscountResponse$Outbound | null | undefined;
|
|
740
|
+
isEInvoice?: boolean | undefined;
|
|
728
741
|
amountDue?: SalesInvoiceResponseAmountDue$Outbound | undefined;
|
|
729
742
|
subtotalAmount?: SalesInvoiceResponseSubtotalAmount$Outbound | undefined;
|
|
730
743
|
totalAmount?: SalesInvoiceResponseTotalAmount$Outbound | undefined;
|
|
@@ -769,6 +782,7 @@ export const SalesInvoiceResponse$outboundSchema: z.ZodType<
|
|
|
769
782
|
lines: z.nullable(z.array(SalesInvoiceLineItemResponse$outboundSchema))
|
|
770
783
|
.optional(),
|
|
771
784
|
discount: z.nullable(SalesInvoiceDiscountResponse$outboundSchema).optional(),
|
|
785
|
+
isEInvoice: z.boolean().optional(),
|
|
772
786
|
amountDue: z.lazy(() => SalesInvoiceResponseAmountDue$outboundSchema)
|
|
773
787
|
.optional(),
|
|
774
788
|
subtotalAmount: z.lazy(() =>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import {
|
|
9
|
+
Amount,
|
|
10
|
+
Amount$inboundSchema,
|
|
11
|
+
Amount$Outbound,
|
|
12
|
+
Amount$outboundSchema,
|
|
13
|
+
} from "./amount.js";
|
|
14
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
15
|
+
import {
|
|
16
|
+
PaymentLineTypeResponse,
|
|
17
|
+
PaymentLineTypeResponse$inboundSchema,
|
|
18
|
+
PaymentLineTypeResponse$outboundSchema,
|
|
19
|
+
} from "./paymentlinetyperesponse.js";
|
|
20
|
+
|
|
21
|
+
export type SessionLineItem = {
|
|
22
|
+
/**
|
|
23
|
+
* The type of product purchased. For example, a physical or a digital product.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
*
|
|
27
|
+
* The `tip` payment line type is not available when creating a payment.
|
|
28
|
+
*/
|
|
29
|
+
type?: PaymentLineTypeResponse | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* A description of the line item. For example *LEGO 4440 Forest Police Station*.
|
|
32
|
+
*/
|
|
33
|
+
description: string;
|
|
34
|
+
/**
|
|
35
|
+
* The number of items.
|
|
36
|
+
*/
|
|
37
|
+
quantity: number;
|
|
38
|
+
/**
|
|
39
|
+
* The unit for the quantity. For example *pcs*, *kg*, or *cm*.
|
|
40
|
+
*/
|
|
41
|
+
quantityUnit?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
44
|
+
*/
|
|
45
|
+
unitPrice: Amount;
|
|
46
|
+
/**
|
|
47
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
48
|
+
*/
|
|
49
|
+
discountAmount?: Amount | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
52
|
+
*/
|
|
53
|
+
totalAmount: Amount;
|
|
54
|
+
/**
|
|
55
|
+
* The VAT rate applied to the line, for example `21.00` for 21%. The vatRate should be passed as a string and
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* not as a float, to ensure the correct number of decimals are passed.
|
|
59
|
+
*/
|
|
60
|
+
vatRate?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
63
|
+
*/
|
|
64
|
+
vatAmount?: Amount | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The SKU, EAN, ISBN or UPC of the product sold.
|
|
67
|
+
*/
|
|
68
|
+
sku?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* A link pointing to an image of the product sold.
|
|
71
|
+
*/
|
|
72
|
+
imageUrl?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* A link pointing to the product page in your web shop of the product sold.
|
|
75
|
+
*/
|
|
76
|
+
productUrl?: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const SessionLineItem$inboundSchema: z.ZodType<
|
|
81
|
+
SessionLineItem,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
unknown
|
|
84
|
+
> = z.object({
|
|
85
|
+
type: PaymentLineTypeResponse$inboundSchema.optional(),
|
|
86
|
+
description: z.string(),
|
|
87
|
+
quantity: z.number().int(),
|
|
88
|
+
quantityUnit: z.string().optional(),
|
|
89
|
+
unitPrice: Amount$inboundSchema,
|
|
90
|
+
discountAmount: Amount$inboundSchema.optional(),
|
|
91
|
+
totalAmount: Amount$inboundSchema,
|
|
92
|
+
vatRate: z.string().optional(),
|
|
93
|
+
vatAmount: Amount$inboundSchema.optional(),
|
|
94
|
+
sku: z.string().optional(),
|
|
95
|
+
imageUrl: z.string().optional(),
|
|
96
|
+
productUrl: z.string().optional(),
|
|
97
|
+
});
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type SessionLineItem$Outbound = {
|
|
100
|
+
type?: string | undefined;
|
|
101
|
+
description: string;
|
|
102
|
+
quantity: number;
|
|
103
|
+
quantityUnit?: string | undefined;
|
|
104
|
+
unitPrice: Amount$Outbound;
|
|
105
|
+
discountAmount?: Amount$Outbound | undefined;
|
|
106
|
+
totalAmount: Amount$Outbound;
|
|
107
|
+
vatRate?: string | undefined;
|
|
108
|
+
vatAmount?: Amount$Outbound | undefined;
|
|
109
|
+
sku?: string | undefined;
|
|
110
|
+
imageUrl?: string | undefined;
|
|
111
|
+
productUrl?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const SessionLineItem$outboundSchema: z.ZodType<
|
|
116
|
+
SessionLineItem$Outbound,
|
|
117
|
+
z.ZodTypeDef,
|
|
118
|
+
SessionLineItem
|
|
119
|
+
> = z.object({
|
|
120
|
+
type: PaymentLineTypeResponse$outboundSchema.optional(),
|
|
121
|
+
description: z.string(),
|
|
122
|
+
quantity: z.number().int(),
|
|
123
|
+
quantityUnit: z.string().optional(),
|
|
124
|
+
unitPrice: Amount$outboundSchema,
|
|
125
|
+
discountAmount: Amount$outboundSchema.optional(),
|
|
126
|
+
totalAmount: Amount$outboundSchema,
|
|
127
|
+
vatRate: z.string().optional(),
|
|
128
|
+
vatAmount: Amount$outboundSchema.optional(),
|
|
129
|
+
sku: z.string().optional(),
|
|
130
|
+
imageUrl: z.string().optional(),
|
|
131
|
+
productUrl: z.string().optional(),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export function sessionLineItemToJSON(
|
|
135
|
+
sessionLineItem: SessionLineItem,
|
|
136
|
+
): string {
|
|
137
|
+
return JSON.stringify(SessionLineItem$outboundSchema.parse(sessionLineItem));
|
|
138
|
+
}
|
|
139
|
+
export function sessionLineItemFromJSON(
|
|
140
|
+
jsonString: string,
|
|
141
|
+
): SafeParseResult<SessionLineItem, SDKValidationError> {
|
|
142
|
+
return safeParse(
|
|
143
|
+
jsonString,
|
|
144
|
+
(x) => SessionLineItem$inboundSchema.parse(JSON.parse(x)),
|
|
145
|
+
`Failed to parse 'SessionLineItem' from JSON`,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import {
|
|
9
|
+
Amount,
|
|
10
|
+
Amount$inboundSchema,
|
|
11
|
+
Amount$Outbound,
|
|
12
|
+
Amount$outboundSchema,
|
|
13
|
+
} from "./amount.js";
|
|
14
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
15
|
+
import {
|
|
16
|
+
PaymentLineTypeResponse,
|
|
17
|
+
PaymentLineTypeResponse$inboundSchema,
|
|
18
|
+
PaymentLineTypeResponse$outboundSchema,
|
|
19
|
+
} from "./paymentlinetyperesponse.js";
|
|
20
|
+
|
|
21
|
+
export type SessionLineItemResponse = {
|
|
22
|
+
/**
|
|
23
|
+
* The type of product purchased. For example, a physical or a digital product.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
*
|
|
27
|
+
* The `tip` payment line type is not available when creating a payment.
|
|
28
|
+
*/
|
|
29
|
+
type?: PaymentLineTypeResponse | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* A description of the line item. For example *LEGO 4440 Forest Police Station*.
|
|
32
|
+
*/
|
|
33
|
+
description: string;
|
|
34
|
+
/**
|
|
35
|
+
* The number of items.
|
|
36
|
+
*/
|
|
37
|
+
quantity: number;
|
|
38
|
+
/**
|
|
39
|
+
* The unit for the quantity. For example *pcs*, *kg*, or *cm*.
|
|
40
|
+
*/
|
|
41
|
+
quantityUnit?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
44
|
+
*/
|
|
45
|
+
unitPrice: Amount;
|
|
46
|
+
/**
|
|
47
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
48
|
+
*/
|
|
49
|
+
discountAmount?: Amount | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
52
|
+
*/
|
|
53
|
+
totalAmount: Amount;
|
|
54
|
+
/**
|
|
55
|
+
* The VAT rate applied to the line, for example `21.00` for 21%. The vatRate should be passed as a string and
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* not as a float, to ensure the correct number of decimals are passed.
|
|
59
|
+
*/
|
|
60
|
+
vatRate?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
63
|
+
*/
|
|
64
|
+
vatAmount?: Amount | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The SKU, EAN, ISBN or UPC of the product sold.
|
|
67
|
+
*/
|
|
68
|
+
sku?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* A link pointing to an image of the product sold.
|
|
71
|
+
*/
|
|
72
|
+
imageUrl?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* A link pointing to the product page in your web shop of the product sold.
|
|
75
|
+
*/
|
|
76
|
+
productUrl?: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const SessionLineItemResponse$inboundSchema: z.ZodType<
|
|
81
|
+
SessionLineItemResponse,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
unknown
|
|
84
|
+
> = z.object({
|
|
85
|
+
type: PaymentLineTypeResponse$inboundSchema.optional(),
|
|
86
|
+
description: z.string(),
|
|
87
|
+
quantity: z.number().int(),
|
|
88
|
+
quantityUnit: z.string().optional(),
|
|
89
|
+
unitPrice: Amount$inboundSchema,
|
|
90
|
+
discountAmount: Amount$inboundSchema.optional(),
|
|
91
|
+
totalAmount: Amount$inboundSchema,
|
|
92
|
+
vatRate: z.string().optional(),
|
|
93
|
+
vatAmount: Amount$inboundSchema.optional(),
|
|
94
|
+
sku: z.string().optional(),
|
|
95
|
+
imageUrl: z.string().optional(),
|
|
96
|
+
productUrl: z.string().optional(),
|
|
97
|
+
});
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type SessionLineItemResponse$Outbound = {
|
|
100
|
+
type?: string | undefined;
|
|
101
|
+
description: string;
|
|
102
|
+
quantity: number;
|
|
103
|
+
quantityUnit?: string | undefined;
|
|
104
|
+
unitPrice: Amount$Outbound;
|
|
105
|
+
discountAmount?: Amount$Outbound | undefined;
|
|
106
|
+
totalAmount: Amount$Outbound;
|
|
107
|
+
vatRate?: string | undefined;
|
|
108
|
+
vatAmount?: Amount$Outbound | undefined;
|
|
109
|
+
sku?: string | undefined;
|
|
110
|
+
imageUrl?: string | undefined;
|
|
111
|
+
productUrl?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const SessionLineItemResponse$outboundSchema: z.ZodType<
|
|
116
|
+
SessionLineItemResponse$Outbound,
|
|
117
|
+
z.ZodTypeDef,
|
|
118
|
+
SessionLineItemResponse
|
|
119
|
+
> = z.object({
|
|
120
|
+
type: PaymentLineTypeResponse$outboundSchema.optional(),
|
|
121
|
+
description: z.string(),
|
|
122
|
+
quantity: z.number().int(),
|
|
123
|
+
quantityUnit: z.string().optional(),
|
|
124
|
+
unitPrice: Amount$outboundSchema,
|
|
125
|
+
discountAmount: Amount$outboundSchema.optional(),
|
|
126
|
+
totalAmount: Amount$outboundSchema,
|
|
127
|
+
vatRate: z.string().optional(),
|
|
128
|
+
vatAmount: Amount$outboundSchema.optional(),
|
|
129
|
+
sku: z.string().optional(),
|
|
130
|
+
imageUrl: z.string().optional(),
|
|
131
|
+
productUrl: z.string().optional(),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export function sessionLineItemResponseToJSON(
|
|
135
|
+
sessionLineItemResponse: SessionLineItemResponse,
|
|
136
|
+
): string {
|
|
137
|
+
return JSON.stringify(
|
|
138
|
+
SessionLineItemResponse$outboundSchema.parse(sessionLineItemResponse),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
export function sessionLineItemResponseFromJSON(
|
|
142
|
+
jsonString: string,
|
|
143
|
+
): SafeParseResult<SessionLineItemResponse, SDKValidationError> {
|
|
144
|
+
return safeParse(
|
|
145
|
+
jsonString,
|
|
146
|
+
(x) => SessionLineItemResponse$inboundSchema.parse(JSON.parse(x)),
|
|
147
|
+
`Failed to parse 'SessionLineItemResponse' from JSON`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import {
|
|
9
|
+
Amount,
|
|
10
|
+
Amount$inboundSchema,
|
|
11
|
+
Amount$Outbound,
|
|
12
|
+
Amount$outboundSchema,
|
|
13
|
+
} from "./amount.js";
|
|
14
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
15
|
+
import {
|
|
16
|
+
PaymentAddress,
|
|
17
|
+
PaymentAddress$inboundSchema,
|
|
18
|
+
PaymentAddress$Outbound,
|
|
19
|
+
PaymentAddress$outboundSchema,
|
|
20
|
+
} from "./paymentaddress.js";
|
|
21
|
+
import {
|
|
22
|
+
SessionLineItem,
|
|
23
|
+
SessionLineItem$inboundSchema,
|
|
24
|
+
SessionLineItem$Outbound,
|
|
25
|
+
SessionLineItem$outboundSchema,
|
|
26
|
+
} from "./sessionlineitem.js";
|
|
27
|
+
import {
|
|
28
|
+
SessionSequenceType,
|
|
29
|
+
SessionSequenceType$inboundSchema,
|
|
30
|
+
SessionSequenceType$outboundSchema,
|
|
31
|
+
} from "./sessionsequencetype.js";
|
|
32
|
+
|
|
33
|
+
export type SessionRequestPayment = {
|
|
34
|
+
/**
|
|
35
|
+
* The webhook URL where we will send payment status updates to.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
*
|
|
39
|
+
* This URL will be automatically set as the webhook URL for all payments created for this session.
|
|
40
|
+
*/
|
|
41
|
+
webhookUrl?: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type SessionRequest = {
|
|
45
|
+
/**
|
|
46
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
47
|
+
*/
|
|
48
|
+
amount: Amount;
|
|
49
|
+
/**
|
|
50
|
+
* A user-friendly description of the session that may be shown to the customer during the checkout process.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
*
|
|
54
|
+
* Any payment created for the session will use the same description.
|
|
55
|
+
*/
|
|
56
|
+
description: string;
|
|
57
|
+
/**
|
|
58
|
+
* The URL your customer will be redirected to after the payment process.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
*
|
|
62
|
+
* It could make sense for the redirectUrl to contain a unique identifier – like your order ID – so you can show the
|
|
63
|
+
* right page referencing the order when your customer returns.
|
|
64
|
+
*/
|
|
65
|
+
redirectUrl: string;
|
|
66
|
+
billingAddress?: PaymentAddress | undefined;
|
|
67
|
+
shippingAddress?: PaymentAddress | undefined;
|
|
68
|
+
customerId?: string | undefined;
|
|
69
|
+
sequenceType?: SessionSequenceType | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Provide any data you like in a JSON object. We will save the data alongside the entity. Whenever
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* you fetch the entity with our API, we will also include the metadata. You can use up to approximately 1kB.
|
|
75
|
+
*
|
|
76
|
+
* Any payment created for the session will use the same metadata.
|
|
77
|
+
*/
|
|
78
|
+
metadata?: { [k: string]: any } | undefined;
|
|
79
|
+
payment?: SessionRequestPayment | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* List of items the customer will pay for in this session. The sum of all line items must equal the
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* session's amount.
|
|
85
|
+
*
|
|
86
|
+
* All lines must have the same currency as the session.
|
|
87
|
+
*/
|
|
88
|
+
lines: Array<SessionLineItem>;
|
|
89
|
+
/**
|
|
90
|
+
* The identifier referring to the [profile](get-profile) this entity belongs to.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
*
|
|
94
|
+
* Most API credentials are linked to a single profile. In these cases the `profileId` can be omitted in the creation
|
|
95
|
+
* request. For organization-level credentials such as OAuth access tokens however, the `profileId` parameter is
|
|
96
|
+
* required.
|
|
97
|
+
*/
|
|
98
|
+
profileId?: string | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Whether to create the entity in test mode or live mode.
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
*
|
|
104
|
+
* Most API credentials are specifically created for either live mode or test mode, in which case this parameter must
|
|
105
|
+
* not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting
|
|
106
|
+
* `testmode` to `true`.
|
|
107
|
+
*/
|
|
108
|
+
testmode?: boolean | null | undefined;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const SessionRequestPayment$inboundSchema: z.ZodType<
|
|
113
|
+
SessionRequestPayment,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
unknown
|
|
116
|
+
> = z.object({
|
|
117
|
+
webhookUrl: z.string().optional(),
|
|
118
|
+
});
|
|
119
|
+
/** @internal */
|
|
120
|
+
export type SessionRequestPayment$Outbound = {
|
|
121
|
+
webhookUrl?: string | undefined;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const SessionRequestPayment$outboundSchema: z.ZodType<
|
|
126
|
+
SessionRequestPayment$Outbound,
|
|
127
|
+
z.ZodTypeDef,
|
|
128
|
+
SessionRequestPayment
|
|
129
|
+
> = z.object({
|
|
130
|
+
webhookUrl: z.string().optional(),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export function sessionRequestPaymentToJSON(
|
|
134
|
+
sessionRequestPayment: SessionRequestPayment,
|
|
135
|
+
): string {
|
|
136
|
+
return JSON.stringify(
|
|
137
|
+
SessionRequestPayment$outboundSchema.parse(sessionRequestPayment),
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
export function sessionRequestPaymentFromJSON(
|
|
141
|
+
jsonString: string,
|
|
142
|
+
): SafeParseResult<SessionRequestPayment, SDKValidationError> {
|
|
143
|
+
return safeParse(
|
|
144
|
+
jsonString,
|
|
145
|
+
(x) => SessionRequestPayment$inboundSchema.parse(JSON.parse(x)),
|
|
146
|
+
`Failed to parse 'SessionRequestPayment' from JSON`,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** @internal */
|
|
151
|
+
export const SessionRequest$inboundSchema: z.ZodType<
|
|
152
|
+
SessionRequest,
|
|
153
|
+
z.ZodTypeDef,
|
|
154
|
+
unknown
|
|
155
|
+
> = z.object({
|
|
156
|
+
amount: Amount$inboundSchema,
|
|
157
|
+
description: z.string(),
|
|
158
|
+
redirectUrl: z.string(),
|
|
159
|
+
billingAddress: PaymentAddress$inboundSchema.optional(),
|
|
160
|
+
shippingAddress: PaymentAddress$inboundSchema.optional(),
|
|
161
|
+
customerId: z.string().optional(),
|
|
162
|
+
sequenceType: SessionSequenceType$inboundSchema.optional(),
|
|
163
|
+
metadata: z.record(z.any()).optional(),
|
|
164
|
+
payment: z.lazy(() => SessionRequestPayment$inboundSchema).optional(),
|
|
165
|
+
lines: z.array(SessionLineItem$inboundSchema),
|
|
166
|
+
profileId: z.string().optional(),
|
|
167
|
+
testmode: z.nullable(z.boolean()).optional(),
|
|
168
|
+
});
|
|
169
|
+
/** @internal */
|
|
170
|
+
export type SessionRequest$Outbound = {
|
|
171
|
+
amount: Amount$Outbound;
|
|
172
|
+
description: string;
|
|
173
|
+
redirectUrl: string;
|
|
174
|
+
billingAddress?: PaymentAddress$Outbound | undefined;
|
|
175
|
+
shippingAddress?: PaymentAddress$Outbound | undefined;
|
|
176
|
+
customerId?: string | undefined;
|
|
177
|
+
sequenceType?: string | undefined;
|
|
178
|
+
metadata?: { [k: string]: any } | undefined;
|
|
179
|
+
payment?: SessionRequestPayment$Outbound | undefined;
|
|
180
|
+
lines: Array<SessionLineItem$Outbound>;
|
|
181
|
+
profileId?: string | undefined;
|
|
182
|
+
testmode?: boolean | null | undefined;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/** @internal */
|
|
186
|
+
export const SessionRequest$outboundSchema: z.ZodType<
|
|
187
|
+
SessionRequest$Outbound,
|
|
188
|
+
z.ZodTypeDef,
|
|
189
|
+
SessionRequest
|
|
190
|
+
> = z.object({
|
|
191
|
+
amount: Amount$outboundSchema,
|
|
192
|
+
description: z.string(),
|
|
193
|
+
redirectUrl: z.string(),
|
|
194
|
+
billingAddress: PaymentAddress$outboundSchema.optional(),
|
|
195
|
+
shippingAddress: PaymentAddress$outboundSchema.optional(),
|
|
196
|
+
customerId: z.string().optional(),
|
|
197
|
+
sequenceType: SessionSequenceType$outboundSchema.optional(),
|
|
198
|
+
metadata: z.record(z.any()).optional(),
|
|
199
|
+
payment: z.lazy(() => SessionRequestPayment$outboundSchema).optional(),
|
|
200
|
+
lines: z.array(SessionLineItem$outboundSchema),
|
|
201
|
+
profileId: z.string().optional(),
|
|
202
|
+
testmode: z.nullable(z.boolean()).optional(),
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export function sessionRequestToJSON(sessionRequest: SessionRequest): string {
|
|
206
|
+
return JSON.stringify(SessionRequest$outboundSchema.parse(sessionRequest));
|
|
207
|
+
}
|
|
208
|
+
export function sessionRequestFromJSON(
|
|
209
|
+
jsonString: string,
|
|
210
|
+
): SafeParseResult<SessionRequest, SDKValidationError> {
|
|
211
|
+
return safeParse(
|
|
212
|
+
jsonString,
|
|
213
|
+
(x) => SessionRequest$inboundSchema.parse(JSON.parse(x)),
|
|
214
|
+
`Failed to parse 'SessionRequest' from JSON`,
|
|
215
|
+
);
|
|
216
|
+
}
|