@peable.to/contracts 0.4.0 → 1.0.0
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/dist/cjs/common/address.js +81 -0
- package/dist/cjs/common/envelopes.js +101 -0
- package/dist/cjs/common/objects.js +85 -0
- package/dist/cjs/common/params.js +211 -0
- package/dist/cjs/common/primitives.js +39 -0
- package/dist/cjs/contributions.js +22 -0
- package/dist/cjs/index.js +40 -137
- package/dist/cjs/openapi/document.js +297 -0
- package/dist/cjs/openapi/index.js +7 -0
- package/dist/cjs/openapi/webhooks.js +17 -0
- package/dist/cjs/resources/billingEngine/billingPortal.js +237 -0
- package/dist/cjs/resources/billingEngine/creditNotes.js +189 -0
- package/dist/cjs/resources/billingEngine/customerBalanceTransactions.js +90 -0
- package/dist/cjs/resources/billingEngine/index.js +43 -0
- package/dist/cjs/resources/billingEngine/invoiceItems.js +155 -0
- package/dist/cjs/resources/billingEngine/invoices.js +509 -0
- package/dist/cjs/resources/billingEngine/params.js +43 -0
- package/dist/cjs/resources/billingEngine/public.js +326 -0
- package/dist/cjs/resources/billingEngine/subscriptions.js +476 -0
- package/dist/cjs/resources/catalog/billing.js +755 -0
- package/dist/cjs/resources/catalog/billingSettings.js +131 -0
- package/dist/cjs/resources/catalog/coupons.js +222 -0
- package/dist/cjs/resources/catalog/entitlements.js +257 -0
- package/dist/cjs/resources/catalog/index.js +58 -0
- package/dist/cjs/resources/catalog/meters.js +279 -0
- package/dist/cjs/resources/catalog/prices.js +423 -0
- package/dist/cjs/resources/catalog/products.js +228 -0
- package/dist/cjs/resources/catalog/promotionCodes.js +174 -0
- package/dist/cjs/resources/catalog/shared.js +75 -0
- package/dist/cjs/resources/catalog/testClocks.js +127 -0
- package/dist/cjs/resources/checkout/checkoutSessions.js +582 -0
- package/dist/cjs/resources/checkout/contributions.js +172 -0
- package/dist/cjs/resources/checkout/files.js +133 -0
- package/dist/cjs/resources/checkout/index.js +57 -0
- package/dist/cjs/resources/checkout/merchants.js +290 -0
- package/dist/cjs/resources/checkout/paymentLinks.js +330 -0
- package/dist/cjs/resources/checkout/paymentMethodConfigurations.js +262 -0
- package/dist/cjs/resources/checkout/shared.js +368 -0
- package/dist/cjs/resources/connect/account.js +332 -0
- package/dist/cjs/resources/connect/applicationFees.js +113 -0
- package/dist/cjs/resources/connect/balance.js +212 -0
- package/dist/cjs/resources/connect/connectedAccounts.js +260 -0
- package/dist/cjs/resources/connect/index.js +51 -0
- package/dist/cjs/resources/connect/onboarding.js +82 -0
- package/dist/cjs/resources/connect/payouts.js +196 -0
- package/dist/cjs/resources/connect/reporting.js +235 -0
- package/dist/cjs/resources/connect/requestLogs.js +110 -0
- package/dist/cjs/resources/connect/transfers.js +227 -0
- package/dist/cjs/resources/core/customers.js +194 -0
- package/dist/cjs/resources/core/index.js +23 -0
- package/dist/cjs/resources/core/paymentMethods.js +134 -0
- package/dist/cjs/resources/events/events.js +357 -0
- package/dist/cjs/resources/events/index.js +29 -0
- package/dist/cjs/resources/events/webhookDeliveries.js +93 -0
- package/dist/cjs/resources/events/webhookEndpoints.js +215 -0
- package/dist/cjs/resources/payments/charges.js +157 -0
- package/dist/cjs/resources/payments/disputes.js +204 -0
- package/dist/cjs/resources/payments/index.js +41 -0
- package/dist/cjs/resources/payments/paymentIntents.js +529 -0
- package/dist/cjs/resources/payments/refunds.js +245 -0
- package/dist/cjs/resources/payments/setupIntents.js +158 -0
- package/dist/cjs/resources/payments/social.js +182 -0
- package/dist/cjs/resources/payments/testHelpers.js +39 -0
- package/dist/cjs/resources/tax/assessments.js +217 -0
- package/dist/cjs/resources/tax/businessProfile.js +99 -0
- package/dist/cjs/resources/tax/calculations.js +176 -0
- package/dist/cjs/resources/tax/capabilities.js +42 -0
- package/dist/cjs/resources/tax/codes.js +37 -0
- package/dist/cjs/resources/tax/complianceActions.js +56 -0
- package/dist/cjs/resources/tax/deadlines.js +59 -0
- package/dist/cjs/resources/tax/documents.js +128 -0
- package/dist/cjs/resources/tax/index.js +80 -0
- package/dist/cjs/resources/tax/locationEvidence.js +131 -0
- package/dist/cjs/resources/tax/operatingLocations.js +98 -0
- package/dist/cjs/resources/tax/products.js +67 -0
- package/dist/cjs/resources/tax/registrationDeclarations.js +124 -0
- package/dist/cjs/resources/tax/registrations.js +82 -0
- package/dist/cjs/resources/tax/reports.js +92 -0
- package/dist/cjs/resources/tax/reviewItems.js +116 -0
- package/dist/cjs/resources/tax/ruleSet.js +68 -0
- package/dist/cjs/resources/tax/salesDestinations.js +94 -0
- package/dist/cjs/resources/tax/settings.js +104 -0
- package/dist/cjs/resources/tax/shared.js +62 -0
- package/dist/cjs/resources/tax/transactions.js +102 -0
- package/dist/cjs/route.js +22 -0
- package/dist/cjs/routes.js +31 -0
- package/dist/cjs/vocabulary/billingPortal.js +15 -0
- package/dist/cjs/vocabulary/catalog.js +110 -0
- package/dist/cjs/vocabulary/checkout.js +53 -0
- package/dist/cjs/vocabulary/connect.js +95 -0
- package/dist/cjs/vocabulary/errors.js +174 -0
- package/dist/cjs/vocabulary/events.js +176 -0
- package/dist/cjs/vocabulary/files.js +44 -0
- package/dist/cjs/vocabulary/index.js +37 -0
- package/dist/cjs/vocabulary/invoices.js +52 -0
- package/dist/cjs/vocabulary/lists.js +22 -0
- package/dist/cjs/vocabulary/merchants.js +23 -0
- package/dist/cjs/vocabulary/money.js +104 -0
- package/dist/cjs/vocabulary/paymentMethodConfigurations.js +36 -0
- package/dist/cjs/vocabulary/payments.js +195 -0
- package/dist/cjs/vocabulary/reporting.js +27 -0
- package/dist/cjs/vocabulary/subscriptions.js +60 -0
- package/dist/cjs/vocabulary/tax.js +237 -0
- package/dist/cjs/vocabulary/version.js +12 -0
- package/dist/esm/common/address.js +76 -0
- package/dist/esm/common/envelopes.js +95 -0
- package/dist/esm/common/objects.js +74 -0
- package/dist/esm/common/params.js +203 -0
- package/dist/esm/common/primitives.js +35 -0
- package/dist/esm/contributions.js +5 -0
- package/dist/esm/index.js +26 -134
- package/dist/esm/openapi/document.js +294 -0
- package/dist/esm/openapi/index.js +2 -0
- package/dist/esm/openapi/webhooks.js +14 -0
- package/dist/esm/resources/billingEngine/billingPortal.js +234 -0
- package/dist/esm/resources/billingEngine/creditNotes.js +186 -0
- package/dist/esm/resources/billingEngine/customerBalanceTransactions.js +87 -0
- package/dist/esm/resources/billingEngine/index.js +26 -0
- package/dist/esm/resources/billingEngine/invoiceItems.js +152 -0
- package/dist/esm/resources/billingEngine/invoices.js +506 -0
- package/dist/esm/resources/billingEngine/params.js +39 -0
- package/dist/esm/resources/billingEngine/public.js +323 -0
- package/dist/esm/resources/billingEngine/subscriptions.js +473 -0
- package/dist/esm/resources/catalog/billing.js +752 -0
- package/dist/esm/resources/catalog/billingSettings.js +128 -0
- package/dist/esm/resources/catalog/coupons.js +219 -0
- package/dist/esm/resources/catalog/entitlements.js +254 -0
- package/dist/esm/resources/catalog/index.js +38 -0
- package/dist/esm/resources/catalog/meters.js +276 -0
- package/dist/esm/resources/catalog/prices.js +419 -0
- package/dist/esm/resources/catalog/products.js +225 -0
- package/dist/esm/resources/catalog/promotionCodes.js +171 -0
- package/dist/esm/resources/catalog/shared.js +67 -0
- package/dist/esm/resources/catalog/testClocks.js +124 -0
- package/dist/esm/resources/checkout/checkoutSessions.js +579 -0
- package/dist/esm/resources/checkout/contributions.js +167 -0
- package/dist/esm/resources/checkout/files.js +130 -0
- package/dist/esm/resources/checkout/index.js +25 -0
- package/dist/esm/resources/checkout/merchants.js +287 -0
- package/dist/esm/resources/checkout/paymentLinks.js +327 -0
- package/dist/esm/resources/checkout/paymentMethodConfigurations.js +259 -0
- package/dist/esm/resources/checkout/shared.js +363 -0
- package/dist/esm/resources/connect/account.js +329 -0
- package/dist/esm/resources/connect/applicationFees.js +110 -0
- package/dist/esm/resources/connect/balance.js +209 -0
- package/dist/esm/resources/connect/connectedAccounts.js +257 -0
- package/dist/esm/resources/connect/index.js +34 -0
- package/dist/esm/resources/connect/onboarding.js +79 -0
- package/dist/esm/resources/connect/payouts.js +193 -0
- package/dist/esm/resources/connect/reporting.js +232 -0
- package/dist/esm/resources/connect/requestLogs.js +107 -0
- package/dist/esm/resources/connect/transfers.js +224 -0
- package/dist/esm/resources/core/customers.js +191 -0
- package/dist/esm/resources/core/index.js +6 -0
- package/dist/esm/resources/core/paymentMethods.js +131 -0
- package/dist/esm/resources/events/events.js +353 -0
- package/dist/esm/resources/events/index.js +12 -0
- package/dist/esm/resources/events/webhookDeliveries.js +90 -0
- package/dist/esm/resources/events/webhookEndpoints.js +212 -0
- package/dist/esm/resources/payments/charges.js +154 -0
- package/dist/esm/resources/payments/disputes.js +201 -0
- package/dist/esm/resources/payments/index.js +24 -0
- package/dist/esm/resources/payments/paymentIntents.js +526 -0
- package/dist/esm/resources/payments/refunds.js +242 -0
- package/dist/esm/resources/payments/setupIntents.js +155 -0
- package/dist/esm/resources/payments/social.js +179 -0
- package/dist/esm/resources/payments/testHelpers.js +36 -0
- package/dist/esm/resources/tax/assessments.js +214 -0
- package/dist/esm/resources/tax/businessProfile.js +96 -0
- package/dist/esm/resources/tax/calculations.js +173 -0
- package/dist/esm/resources/tax/capabilities.js +39 -0
- package/dist/esm/resources/tax/codes.js +34 -0
- package/dist/esm/resources/tax/complianceActions.js +53 -0
- package/dist/esm/resources/tax/deadlines.js +56 -0
- package/dist/esm/resources/tax/documents.js +125 -0
- package/dist/esm/resources/tax/index.js +63 -0
- package/dist/esm/resources/tax/locationEvidence.js +128 -0
- package/dist/esm/resources/tax/operatingLocations.js +95 -0
- package/dist/esm/resources/tax/products.js +64 -0
- package/dist/esm/resources/tax/registrationDeclarations.js +121 -0
- package/dist/esm/resources/tax/registrations.js +79 -0
- package/dist/esm/resources/tax/reports.js +89 -0
- package/dist/esm/resources/tax/reviewItems.js +113 -0
- package/dist/esm/resources/tax/ruleSet.js +65 -0
- package/dist/esm/resources/tax/salesDestinations.js +91 -0
- package/dist/esm/resources/tax/settings.js +101 -0
- package/dist/esm/resources/tax/shared.js +58 -0
- package/dist/esm/resources/tax/transactions.js +99 -0
- package/dist/esm/route.js +16 -0
- package/dist/esm/routes.js +27 -0
- package/dist/esm/vocabulary/billingPortal.js +12 -0
- package/dist/esm/vocabulary/catalog.js +106 -0
- package/dist/esm/vocabulary/checkout.js +50 -0
- package/dist/esm/vocabulary/connect.js +92 -0
- package/dist/esm/vocabulary/errors.js +169 -0
- package/dist/esm/vocabulary/events.js +173 -0
- package/dist/esm/vocabulary/files.js +41 -0
- package/dist/esm/vocabulary/index.js +21 -0
- package/dist/esm/vocabulary/invoices.js +49 -0
- package/dist/esm/vocabulary/lists.js +19 -0
- package/dist/esm/vocabulary/merchants.js +20 -0
- package/dist/esm/vocabulary/money.js +98 -0
- package/dist/esm/vocabulary/paymentMethodConfigurations.js +33 -0
- package/dist/esm/vocabulary/payments.js +192 -0
- package/dist/esm/vocabulary/reporting.js +24 -0
- package/dist/esm/vocabulary/subscriptions.js +57 -0
- package/dist/esm/vocabulary/tax.js +233 -0
- package/dist/esm/vocabulary/version.js +9 -0
- package/dist/types/common/address.d.ts +62 -0
- package/dist/types/common/envelopes.d.ts +88 -0
- package/dist/types/common/objects.d.ts +107 -0
- package/dist/types/common/params.d.ts +156 -0
- package/dist/types/common/primitives.d.ts +56 -0
- package/dist/types/contributions.d.ts +1 -0
- package/dist/types/index.d.ts +16 -171
- package/dist/types/openapi/document.d.ts +16 -0
- package/dist/types/openapi/index.d.ts +2 -0
- package/dist/types/openapi/webhooks.d.ts +15 -0
- package/dist/types/resources/billingEngine/billingPortal.d.ts +742 -0
- package/dist/types/resources/billingEngine/creditNotes.d.ts +655 -0
- package/dist/types/resources/billingEngine/customerBalanceTransactions.d.ts +282 -0
- package/dist/types/resources/billingEngine/index.d.ts +6071 -0
- package/dist/types/resources/billingEngine/invoiceItems.d.ts +502 -0
- package/dist/types/resources/billingEngine/invoices.d.ts +2547 -0
- package/dist/types/resources/billingEngine/params.d.ts +51 -0
- package/dist/types/resources/billingEngine/public.d.ts +1860 -0
- package/dist/types/resources/billingEngine/subscriptions.d.ts +1519 -0
- package/dist/types/resources/catalog/billing.d.ts +1723 -0
- package/dist/types/resources/catalog/billingSettings.d.ts +160 -0
- package/dist/types/resources/catalog/coupons.d.ts +403 -0
- package/dist/types/resources/catalog/entitlements.d.ts +422 -0
- package/dist/types/resources/catalog/index.d.ts +3155 -0
- package/dist/types/resources/catalog/meters.d.ts +474 -0
- package/dist/types/resources/catalog/prices.d.ts +1091 -0
- package/dist/types/resources/catalog/products.d.ts +430 -0
- package/dist/types/resources/catalog/promotionCodes.d.ts +369 -0
- package/dist/types/resources/catalog/shared.d.ts +34 -0
- package/dist/types/resources/catalog/testClocks.d.ts +220 -0
- package/dist/types/resources/checkout/checkoutSessions.d.ts +3207 -0
- package/dist/types/resources/checkout/contributions.d.ts +375 -0
- package/dist/types/resources/checkout/files.d.ts +280 -0
- package/dist/types/resources/checkout/index.d.ts +5678 -0
- package/dist/types/resources/checkout/merchants.d.ts +395 -0
- package/dist/types/resources/checkout/paymentLinks.d.ts +1728 -0
- package/dist/types/resources/checkout/paymentMethodConfigurations.d.ts +2104 -0
- package/dist/types/resources/checkout/shared.d.ts +419 -0
- package/dist/types/resources/connect/account.d.ts +483 -0
- package/dist/types/resources/connect/applicationFees.d.ts +198 -0
- package/dist/types/resources/connect/balance.d.ts +399 -0
- package/dist/types/resources/connect/connectedAccounts.d.ts +494 -0
- package/dist/types/resources/connect/index.d.ts +2094 -0
- package/dist/types/resources/connect/onboarding.d.ts +95 -0
- package/dist/types/resources/connect/payouts.d.ts +527 -0
- package/dist/types/resources/connect/reporting.d.ts +506 -0
- package/dist/types/resources/connect/requestLogs.d.ts +236 -0
- package/dist/types/resources/connect/transfers.d.ts +436 -0
- package/dist/types/resources/core/customers.d.ts +619 -0
- package/dist/types/resources/core/index.d.ts +679 -0
- package/dist/types/resources/core/paymentMethods.d.ts +336 -0
- package/dist/types/resources/events/events.d.ts +731 -0
- package/dist/types/resources/events/index.d.ts +1727 -0
- package/dist/types/resources/events/webhookDeliveries.d.ts +436 -0
- package/dist/types/resources/events/webhookEndpoints.d.ts +1502 -0
- package/dist/types/resources/payments/charges.d.ts +390 -0
- package/dist/types/resources/payments/disputes.d.ts +822 -0
- package/dist/types/resources/payments/index.d.ts +3517 -0
- package/dist/types/resources/payments/paymentIntents.d.ts +2080 -0
- package/dist/types/resources/payments/refunds.d.ts +684 -0
- package/dist/types/resources/payments/setupIntents.d.ts +391 -0
- package/dist/types/resources/payments/social.d.ts +266 -0
- package/dist/types/resources/payments/testHelpers.d.ts +178 -0
- package/dist/types/resources/tax/assessments.d.ts +787 -0
- package/dist/types/resources/tax/businessProfile.d.ts +134 -0
- package/dist/types/resources/tax/calculations.d.ts +261 -0
- package/dist/types/resources/tax/capabilities.d.ts +81 -0
- package/dist/types/resources/tax/codes.d.ts +29 -0
- package/dist/types/resources/tax/complianceActions.d.ts +97 -0
- package/dist/types/resources/tax/deadlines.d.ts +133 -0
- package/dist/types/resources/tax/documents.d.ts +257 -0
- package/dist/types/resources/tax/index.d.ts +1946 -0
- package/dist/types/resources/tax/locationEvidence.d.ts +246 -0
- package/dist/types/resources/tax/operatingLocations.d.ts +170 -0
- package/dist/types/resources/tax/products.d.ts +68 -0
- package/dist/types/resources/tax/registrationDeclarations.d.ts +270 -0
- package/dist/types/resources/tax/registrations.d.ts +103 -0
- package/dist/types/resources/tax/reports.d.ts +129 -0
- package/dist/types/resources/tax/reviewItems.d.ts +226 -0
- package/dist/types/resources/tax/ruleSet.d.ts +219 -0
- package/dist/types/resources/tax/salesDestinations.d.ts +158 -0
- package/dist/types/resources/tax/settings.d.ts +122 -0
- package/dist/types/resources/tax/shared.d.ts +43 -0
- package/dist/types/resources/tax/transactions.d.ts +404 -0
- package/dist/types/route.d.ts +86 -0
- package/dist/types/routes.d.ts +23 -0
- package/dist/types/vocabulary/billingPortal.d.ts +15 -0
- package/dist/types/vocabulary/catalog.d.ts +97 -0
- package/dist/types/vocabulary/checkout.d.ts +49 -0
- package/dist/types/vocabulary/connect.d.ts +62 -0
- package/dist/types/vocabulary/errors.d.ts +145 -0
- package/dist/types/vocabulary/events.d.ts +171 -0
- package/dist/types/vocabulary/files.d.ts +30 -0
- package/dist/types/vocabulary/index.d.ts +17 -0
- package/dist/types/vocabulary/invoices.d.ts +39 -0
- package/dist/types/vocabulary/lists.d.ts +9 -0
- package/dist/types/vocabulary/merchants.d.ts +9 -0
- package/dist/types/vocabulary/money.d.ts +59 -0
- package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +22 -0
- package/dist/types/vocabulary/payments.d.ts +117 -0
- package/dist/types/vocabulary/reporting.d.ts +18 -0
- package/dist/types/vocabulary/subscriptions.d.ts +45 -0
- package/dist/types/vocabulary/tax.d.ts +163 -0
- package/dist/types/vocabulary/version.d.ts +10 -0
- package/package.json +51 -11
- package/dist/cjs/openapi.js +0 -165
- package/dist/esm/openapi.js +0 -161
- package/dist/types/openapi.d.ts +0 -148
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Expand } from '../../common/objects';
|
|
3
|
+
/**
|
|
4
|
+
* Peable Tax settings (ADR 0011): the seller's legal identity and defaults, and
|
|
5
|
+
* whether the owner has approved collection. Changed and approved by the owner
|
|
6
|
+
* in Orbit only; the merchant API reads them.
|
|
7
|
+
*/
|
|
8
|
+
/** An address as Peable Tax stores it: only `country` is always present. */
|
|
9
|
+
export declare const taxAddressSchema: z.ZodObject<{
|
|
10
|
+
country: z.ZodString;
|
|
11
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type TaxAddress = z.output<typeof taxAddressSchema>;
|
|
18
|
+
/** An address in a tax request. */
|
|
19
|
+
export declare const taxAddressParams: z.ZodObject<{
|
|
20
|
+
country: z.ZodString;
|
|
21
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type TaxAddressParams = z.input<typeof taxAddressParams>;
|
|
28
|
+
export declare const taxSettingsSchema: z.ZodObject<{
|
|
29
|
+
object: z.ZodLiteral<"tax.settings">;
|
|
30
|
+
merchant_id: z.ZodString;
|
|
31
|
+
status: z.ZodEnum<{
|
|
32
|
+
active: "active";
|
|
33
|
+
draft: "draft";
|
|
34
|
+
}>;
|
|
35
|
+
legal_name: z.ZodNullable<z.ZodString>;
|
|
36
|
+
head_office: z.ZodNullable<z.ZodObject<{
|
|
37
|
+
country: z.ZodString;
|
|
38
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
default_tax_code: z.ZodString;
|
|
45
|
+
default_tax_behavior: z.ZodEnum<{
|
|
46
|
+
inclusive: "inclusive";
|
|
47
|
+
exclusive: "exclusive";
|
|
48
|
+
}>;
|
|
49
|
+
calculation_account: z.ZodEnum<{
|
|
50
|
+
none: "none";
|
|
51
|
+
platform: "platform";
|
|
52
|
+
}>;
|
|
53
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
54
|
+
approved_at: z.ZodNullable<z.ZodNumber>;
|
|
55
|
+
approved_by: z.ZodNullable<z.ZodString>;
|
|
56
|
+
updated_at: z.ZodNullable<z.ZodNumber>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type TaxSettings = Expand<z.output<typeof taxSettingsSchema>>;
|
|
59
|
+
declare module '../../common/objects' {
|
|
60
|
+
interface ObjectMap {
|
|
61
|
+
'tax.settings': TaxSettings;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Orbit's settings update (the owner's, never the merchant API's). Any change returns the settings to `draft`. */
|
|
65
|
+
export declare const updateTaxSettingsParams: z.ZodObject<{
|
|
66
|
+
legal_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
head_office: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
68
|
+
country: z.ZodString;
|
|
69
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
}, z.core.$strict>>>;
|
|
75
|
+
default_tax_code: z.ZodOptional<z.ZodString>;
|
|
76
|
+
default_tax_behavior: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
inclusive: "inclusive";
|
|
78
|
+
exclusive: "exclusive";
|
|
79
|
+
}>>;
|
|
80
|
+
}, z.core.$strict>;
|
|
81
|
+
export type UpdateTaxSettingsParams = z.input<typeof updateTaxSettingsParams>;
|
|
82
|
+
export declare const taxSettingsRoutes: readonly [{
|
|
83
|
+
readonly operationId: "retrieveTaxSettings";
|
|
84
|
+
readonly method: "get";
|
|
85
|
+
readonly path: "/v1/tax/settings";
|
|
86
|
+
readonly tag: "Tax";
|
|
87
|
+
readonly summary: "Retrieve tax settings";
|
|
88
|
+
readonly description: "Settings are changed, and collection approved, by the owner in Orbit. Until approved, `POST /v1/tax/calculations` refuses with `tax_settings_not_active`.";
|
|
89
|
+
readonly auth: "service";
|
|
90
|
+
readonly scope: "payments:read";
|
|
91
|
+
readonly response: z.ZodObject<{
|
|
92
|
+
object: z.ZodLiteral<"tax.settings">;
|
|
93
|
+
merchant_id: z.ZodString;
|
|
94
|
+
status: z.ZodEnum<{
|
|
95
|
+
active: "active";
|
|
96
|
+
draft: "draft";
|
|
97
|
+
}>;
|
|
98
|
+
legal_name: z.ZodNullable<z.ZodString>;
|
|
99
|
+
head_office: z.ZodNullable<z.ZodObject<{
|
|
100
|
+
country: z.ZodString;
|
|
101
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
default_tax_code: z.ZodString;
|
|
108
|
+
default_tax_behavior: z.ZodEnum<{
|
|
109
|
+
inclusive: "inclusive";
|
|
110
|
+
exclusive: "exclusive";
|
|
111
|
+
}>;
|
|
112
|
+
calculation_account: z.ZodEnum<{
|
|
113
|
+
none: "none";
|
|
114
|
+
platform: "platform";
|
|
115
|
+
}>;
|
|
116
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
117
|
+
approved_at: z.ZodNullable<z.ZodNumber>;
|
|
118
|
+
approved_by: z.ZodNullable<z.ZodString>;
|
|
119
|
+
updated_at: z.ZodNullable<z.ZodNumber>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
readonly sdk: "tax.retrieveSettings";
|
|
122
|
+
}];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Building blocks every Peable Tax resource shares.
|
|
4
|
+
*
|
|
5
|
+
* Tax AMOUNTS (calculations, transactions, the report) are integer JSON
|
|
6
|
+
* numbers in the currency's minor unit, as Peable Tax has always answered
|
|
7
|
+
* them: unlike a FAIR amount, a tax amount is denominated in a fiat currency
|
|
8
|
+
* and is bounded by the safe-integer checks the calculator applies. Business
|
|
9
|
+
* compliance (ADR 0020) amounts are base-unit strings, as ADR 0014 D1 has it.
|
|
10
|
+
*/
|
|
11
|
+
/** ISO 3166-1 alpha-2, as returned. */
|
|
12
|
+
export declare const taxCountry: z.ZodString;
|
|
13
|
+
/** An ISO 3166-2 subdivision without its country prefix (`CA`, `QC`), as returned. */
|
|
14
|
+
export declare const taxState: z.ZodNullable<z.ZodString>;
|
|
15
|
+
/** A minor-unit integer amount (cents), signed: a reversal's amounts are negative. */
|
|
16
|
+
export declare const taxMinorAmount: z.ZodNumber;
|
|
17
|
+
/** A Peable-side reference: a product, a customer, a refund. */
|
|
18
|
+
export declare const taxReferenceParam: z.ZodString;
|
|
19
|
+
/** An instant in a tax request body. */
|
|
20
|
+
export declare const taxInstantParam: z.ZodNumber;
|
|
21
|
+
/** An official source a rule rests on. */
|
|
22
|
+
export declare const taxRuleSourceSchema: z.ZodObject<{
|
|
23
|
+
title: z.ZodString;
|
|
24
|
+
publisher: z.ZodString;
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type TaxRuleSource = z.output<typeof taxRuleSourceSchema>;
|
|
28
|
+
/** What a rule cannot see or decide, stated rather than implied. */
|
|
29
|
+
export declare const taxCoverageLimitSchema: z.ZodObject<{
|
|
30
|
+
code: z.ZodString;
|
|
31
|
+
message: z.ZodString;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
export type TaxCoverageLimit = z.output<typeof taxCoverageLimitSchema>;
|
|
34
|
+
/** The facts a finding or a change rests on: field names, counts, ids — never personal data. */
|
|
35
|
+
export declare const taxFacts: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
36
|
+
/** A country in a compliance request. */
|
|
37
|
+
export declare const complianceCountryParam: z.ZodString;
|
|
38
|
+
/** A subdivision in a compliance request; `null` for the whole country. */
|
|
39
|
+
export declare const complianceStateParam: z.ZodNullable<z.ZodString>;
|
|
40
|
+
/** Free text in a compliance request: trimmed, never empty (`null` clears it). */
|
|
41
|
+
export declare const complianceTextParam: (max: number) => z.ZodNullable<z.ZodString>;
|
|
42
|
+
/** An id another compliance object is linked by (`taxrd_…`, `taxreg_…`, `file_…`). */
|
|
43
|
+
export declare const complianceIdParam: z.ZodString;
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type List } from '../../common/envelopes';
|
|
3
|
+
import { type Expand } from '../../common/objects';
|
|
4
|
+
/**
|
|
5
|
+
* A tax transaction (`taxtxn_…`, ADR 0011/0013): a calculation that was paid,
|
|
6
|
+
* created by Peable when the payment it priced is accepted on its rail. The
|
|
7
|
+
* report and filings are built from these. A `reversal` is a refund (or credit
|
|
8
|
+
* note) of an earlier transaction, netted into the original's report rows,
|
|
9
|
+
* never a deletion of it.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* What a reversal gave back: the original calculation's amounts, scaled to the
|
|
13
|
+
* refunded share and NEGATIVE (positive only when it reinstates an earlier
|
|
14
|
+
* reversal, e.g. a refund the bank later failed).
|
|
15
|
+
*/
|
|
16
|
+
export declare const taxTransactionReversalSchema: z.ZodObject<{
|
|
17
|
+
amount_total: z.ZodNumber;
|
|
18
|
+
amount_net: z.ZodNumber;
|
|
19
|
+
tax_amount: z.ZodNumber;
|
|
20
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
21
|
+
reference: z.ZodString;
|
|
22
|
+
quantity: z.ZodNumber;
|
|
23
|
+
tax_code: z.ZodString;
|
|
24
|
+
tax_behavior: z.ZodEnum<{
|
|
25
|
+
inclusive: "inclusive";
|
|
26
|
+
exclusive: "exclusive";
|
|
27
|
+
}>;
|
|
28
|
+
amount: z.ZodNumber;
|
|
29
|
+
amount_tax: z.ZodNumber;
|
|
30
|
+
amount_net: z.ZodNumber;
|
|
31
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
32
|
+
country: z.ZodString;
|
|
33
|
+
state: z.ZodNullable<z.ZodString>;
|
|
34
|
+
level: z.ZodNullable<z.ZodString>;
|
|
35
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
36
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
37
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
38
|
+
taxable_amount: z.ZodNumber;
|
|
39
|
+
amount: z.ZodNumber;
|
|
40
|
+
inclusive: z.ZodBoolean;
|
|
41
|
+
taxability_reason: z.ZodString;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export type TaxTransactionReversal = z.output<typeof taxTransactionReversalSchema>;
|
|
46
|
+
export declare const taxTransactionSchema: z.ZodObject<{
|
|
47
|
+
object: z.ZodLiteral<"tax.transaction">;
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
type: z.ZodEnum<{
|
|
50
|
+
transaction: "transaction";
|
|
51
|
+
reversal: "reversal";
|
|
52
|
+
}>;
|
|
53
|
+
calculation_id: z.ZodString;
|
|
54
|
+
reference: z.ZodString;
|
|
55
|
+
rail: z.ZodString;
|
|
56
|
+
committed_at: z.ZodNumber;
|
|
57
|
+
reversal_of: z.ZodNullable<z.ZodString>;
|
|
58
|
+
reversal: z.ZodNullable<z.ZodObject<{
|
|
59
|
+
amount_total: z.ZodNumber;
|
|
60
|
+
amount_net: z.ZodNumber;
|
|
61
|
+
tax_amount: z.ZodNumber;
|
|
62
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
63
|
+
reference: z.ZodString;
|
|
64
|
+
quantity: z.ZodNumber;
|
|
65
|
+
tax_code: z.ZodString;
|
|
66
|
+
tax_behavior: z.ZodEnum<{
|
|
67
|
+
inclusive: "inclusive";
|
|
68
|
+
exclusive: "exclusive";
|
|
69
|
+
}>;
|
|
70
|
+
amount: z.ZodNumber;
|
|
71
|
+
amount_tax: z.ZodNumber;
|
|
72
|
+
amount_net: z.ZodNumber;
|
|
73
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
74
|
+
country: z.ZodString;
|
|
75
|
+
state: z.ZodNullable<z.ZodString>;
|
|
76
|
+
level: z.ZodNullable<z.ZodString>;
|
|
77
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
78
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
79
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
80
|
+
taxable_amount: z.ZodNumber;
|
|
81
|
+
amount: z.ZodNumber;
|
|
82
|
+
inclusive: z.ZodBoolean;
|
|
83
|
+
taxability_reason: z.ZodString;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
calculation: z.ZodObject<{
|
|
88
|
+
object: z.ZodLiteral<"tax.calculation">;
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
currency: z.ZodString;
|
|
91
|
+
collection: z.ZodEnum<{
|
|
92
|
+
collect: "collect";
|
|
93
|
+
not_registered: "not_registered";
|
|
94
|
+
nontaxable: "nontaxable";
|
|
95
|
+
}>;
|
|
96
|
+
registration_id: z.ZodNullable<z.ZodString>;
|
|
97
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
98
|
+
provider_calculation_ref: z.ZodNullable<z.ZodString>;
|
|
99
|
+
customer_location_evidence_id: z.ZodString;
|
|
100
|
+
country: z.ZodString;
|
|
101
|
+
state: z.ZodNullable<z.ZodString>;
|
|
102
|
+
amount_total: z.ZodNumber;
|
|
103
|
+
amount_net: z.ZodNumber;
|
|
104
|
+
tax_amount_exclusive: z.ZodNumber;
|
|
105
|
+
tax_amount_inclusive: z.ZodNumber;
|
|
106
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
107
|
+
reference: z.ZodString;
|
|
108
|
+
quantity: z.ZodNumber;
|
|
109
|
+
tax_code: z.ZodString;
|
|
110
|
+
tax_behavior: z.ZodEnum<{
|
|
111
|
+
inclusive: "inclusive";
|
|
112
|
+
exclusive: "exclusive";
|
|
113
|
+
}>;
|
|
114
|
+
amount: z.ZodNumber;
|
|
115
|
+
amount_tax: z.ZodNumber;
|
|
116
|
+
amount_net: z.ZodNumber;
|
|
117
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
118
|
+
country: z.ZodString;
|
|
119
|
+
state: z.ZodNullable<z.ZodString>;
|
|
120
|
+
level: z.ZodNullable<z.ZodString>;
|
|
121
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
122
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
123
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
124
|
+
taxable_amount: z.ZodNumber;
|
|
125
|
+
amount: z.ZodNumber;
|
|
126
|
+
inclusive: z.ZodBoolean;
|
|
127
|
+
taxability_reason: z.ZodString;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
tax_date: z.ZodNumber;
|
|
131
|
+
created: z.ZodNumber;
|
|
132
|
+
expires_at: z.ZodNumber;
|
|
133
|
+
livemode: z.ZodBoolean;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
export type TaxTransaction = Expand<z.output<typeof taxTransactionSchema>>;
|
|
137
|
+
declare module '../../common/objects' {
|
|
138
|
+
interface ObjectMap {
|
|
139
|
+
'tax.transaction': TaxTransaction;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export type TaxTransactionList = List<TaxTransaction>;
|
|
143
|
+
/** The shared list parameters; `created[...]` filters `committed_at`. */
|
|
144
|
+
export declare const listTaxTransactionsQuery: z.ZodObject<{
|
|
145
|
+
limit: z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>, z.ZodTransform<number, number | undefined>>;
|
|
146
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
147
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
148
|
+
created: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>, z.ZodTransform<import("../..").RangeFilter, number>>, z.ZodPipe<z.ZodObject<{
|
|
149
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
150
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
151
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
152
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
153
|
+
}, z.core.$strict>, z.ZodTransform<import("../..").RangeFilter, {
|
|
154
|
+
gt?: number | undefined;
|
|
155
|
+
gte?: number | undefined;
|
|
156
|
+
lt?: number | undefined;
|
|
157
|
+
lte?: number | undefined;
|
|
158
|
+
}>>]>>;
|
|
159
|
+
expand: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>, z.ZodArray<z.ZodString>>>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
export type ListTaxTransactionsParams = z.input<typeof listTaxTransactionsQuery>;
|
|
162
|
+
/**
|
|
163
|
+
* Record a refund made outside Peable (a FairCoin payment is refunded from the
|
|
164
|
+
* seller's own wallet, never by the gateway). Card refunds and credit notes are
|
|
165
|
+
* observed from the provider instead, so the two cannot double-count one refund.
|
|
166
|
+
*/
|
|
167
|
+
export declare const createTaxReversalParams: z.ZodObject<{
|
|
168
|
+
reference: z.ZodString;
|
|
169
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
export type CreateTaxReversalParams = z.input<typeof createTaxReversalParams>;
|
|
172
|
+
export declare const taxTransactionRoutes: readonly [{
|
|
173
|
+
readonly operationId: "listTaxTransactions";
|
|
174
|
+
readonly method: "get";
|
|
175
|
+
readonly path: "/v1/tax/transactions";
|
|
176
|
+
readonly tag: "Tax";
|
|
177
|
+
readonly summary: "List tax transactions";
|
|
178
|
+
readonly description: "Newest first. `created` filters on `committed_at` — the tax date a filing period is judged by.";
|
|
179
|
+
readonly auth: "service";
|
|
180
|
+
readonly scope: "payments:read";
|
|
181
|
+
readonly query: z.ZodObject<{
|
|
182
|
+
limit: z.ZodPipe<z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>, z.ZodTransform<number, number | undefined>>;
|
|
183
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
184
|
+
ending_before: z.ZodOptional<z.ZodString>;
|
|
185
|
+
created: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>, z.ZodTransform<import("../..").RangeFilter, number>>, z.ZodPipe<z.ZodObject<{
|
|
186
|
+
gt: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
187
|
+
gte: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
188
|
+
lt: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
189
|
+
lte: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
|
|
190
|
+
}, z.core.$strict>, z.ZodTransform<import("../..").RangeFilter, {
|
|
191
|
+
gt?: number | undefined;
|
|
192
|
+
gte?: number | undefined;
|
|
193
|
+
lt?: number | undefined;
|
|
194
|
+
lte?: number | undefined;
|
|
195
|
+
}>>]>>;
|
|
196
|
+
expand: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>, z.ZodArray<z.ZodString>>>;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
readonly response: z.ZodObject<{
|
|
199
|
+
object: z.ZodLiteral<"list">;
|
|
200
|
+
data: z.ZodArray<z.ZodObject<{
|
|
201
|
+
object: z.ZodLiteral<"tax.transaction">;
|
|
202
|
+
id: z.ZodString;
|
|
203
|
+
type: z.ZodEnum<{
|
|
204
|
+
transaction: "transaction";
|
|
205
|
+
reversal: "reversal";
|
|
206
|
+
}>;
|
|
207
|
+
calculation_id: z.ZodString;
|
|
208
|
+
reference: z.ZodString;
|
|
209
|
+
rail: z.ZodString;
|
|
210
|
+
committed_at: z.ZodNumber;
|
|
211
|
+
reversal_of: z.ZodNullable<z.ZodString>;
|
|
212
|
+
reversal: z.ZodNullable<z.ZodObject<{
|
|
213
|
+
amount_total: z.ZodNumber;
|
|
214
|
+
amount_net: z.ZodNumber;
|
|
215
|
+
tax_amount: z.ZodNumber;
|
|
216
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
217
|
+
reference: z.ZodString;
|
|
218
|
+
quantity: z.ZodNumber;
|
|
219
|
+
tax_code: z.ZodString;
|
|
220
|
+
tax_behavior: z.ZodEnum<{
|
|
221
|
+
inclusive: "inclusive";
|
|
222
|
+
exclusive: "exclusive";
|
|
223
|
+
}>;
|
|
224
|
+
amount: z.ZodNumber;
|
|
225
|
+
amount_tax: z.ZodNumber;
|
|
226
|
+
amount_net: z.ZodNumber;
|
|
227
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
228
|
+
country: z.ZodString;
|
|
229
|
+
state: z.ZodNullable<z.ZodString>;
|
|
230
|
+
level: z.ZodNullable<z.ZodString>;
|
|
231
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
232
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
233
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
234
|
+
taxable_amount: z.ZodNumber;
|
|
235
|
+
amount: z.ZodNumber;
|
|
236
|
+
inclusive: z.ZodBoolean;
|
|
237
|
+
taxability_reason: z.ZodString;
|
|
238
|
+
}, z.core.$strict>>;
|
|
239
|
+
}, z.core.$strict>>;
|
|
240
|
+
}, z.core.$strict>>;
|
|
241
|
+
calculation: z.ZodObject<{
|
|
242
|
+
object: z.ZodLiteral<"tax.calculation">;
|
|
243
|
+
id: z.ZodString;
|
|
244
|
+
currency: z.ZodString;
|
|
245
|
+
collection: z.ZodEnum<{
|
|
246
|
+
collect: "collect";
|
|
247
|
+
not_registered: "not_registered";
|
|
248
|
+
nontaxable: "nontaxable";
|
|
249
|
+
}>;
|
|
250
|
+
registration_id: z.ZodNullable<z.ZodString>;
|
|
251
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
252
|
+
provider_calculation_ref: z.ZodNullable<z.ZodString>;
|
|
253
|
+
customer_location_evidence_id: z.ZodString;
|
|
254
|
+
country: z.ZodString;
|
|
255
|
+
state: z.ZodNullable<z.ZodString>;
|
|
256
|
+
amount_total: z.ZodNumber;
|
|
257
|
+
amount_net: z.ZodNumber;
|
|
258
|
+
tax_amount_exclusive: z.ZodNumber;
|
|
259
|
+
tax_amount_inclusive: z.ZodNumber;
|
|
260
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
261
|
+
reference: z.ZodString;
|
|
262
|
+
quantity: z.ZodNumber;
|
|
263
|
+
tax_code: z.ZodString;
|
|
264
|
+
tax_behavior: z.ZodEnum<{
|
|
265
|
+
inclusive: "inclusive";
|
|
266
|
+
exclusive: "exclusive";
|
|
267
|
+
}>;
|
|
268
|
+
amount: z.ZodNumber;
|
|
269
|
+
amount_tax: z.ZodNumber;
|
|
270
|
+
amount_net: z.ZodNumber;
|
|
271
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
272
|
+
country: z.ZodString;
|
|
273
|
+
state: z.ZodNullable<z.ZodString>;
|
|
274
|
+
level: z.ZodNullable<z.ZodString>;
|
|
275
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
276
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
277
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
278
|
+
taxable_amount: z.ZodNumber;
|
|
279
|
+
amount: z.ZodNumber;
|
|
280
|
+
inclusive: z.ZodBoolean;
|
|
281
|
+
taxability_reason: z.ZodString;
|
|
282
|
+
}, z.core.$strict>>;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
tax_date: z.ZodNumber;
|
|
285
|
+
created: z.ZodNumber;
|
|
286
|
+
expires_at: z.ZodNumber;
|
|
287
|
+
livemode: z.ZodBoolean;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
}, z.core.$strict>>;
|
|
290
|
+
has_more: z.ZodBoolean;
|
|
291
|
+
url: z.ZodString;
|
|
292
|
+
}, z.core.$strict>;
|
|
293
|
+
readonly sdk: "tax.transactions.list";
|
|
294
|
+
readonly expandable: "tax.transaction";
|
|
295
|
+
}, {
|
|
296
|
+
readonly operationId: "createTaxReversal";
|
|
297
|
+
readonly method: "post";
|
|
298
|
+
readonly path: "/v1/tax/transactions/{id}/reversals";
|
|
299
|
+
readonly tag: "Tax";
|
|
300
|
+
readonly summary: "Reverse a tax transaction";
|
|
301
|
+
readonly description: "For a refund the rail cannot report itself (FairCoin). Card refunds and credit notes, and Orbit invoices, are reversed from their own records and are refused here.";
|
|
302
|
+
readonly auth: "service";
|
|
303
|
+
readonly scope: "payments:write";
|
|
304
|
+
readonly idempotent: true;
|
|
305
|
+
readonly params: {
|
|
306
|
+
readonly id: "The original transaction (`taxtxn_…`).";
|
|
307
|
+
};
|
|
308
|
+
readonly body: z.ZodObject<{
|
|
309
|
+
reference: z.ZodString;
|
|
310
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
311
|
+
}, z.core.$strict>;
|
|
312
|
+
readonly response: z.ZodObject<{
|
|
313
|
+
object: z.ZodLiteral<"tax.transaction">;
|
|
314
|
+
id: z.ZodString;
|
|
315
|
+
type: z.ZodEnum<{
|
|
316
|
+
transaction: "transaction";
|
|
317
|
+
reversal: "reversal";
|
|
318
|
+
}>;
|
|
319
|
+
calculation_id: z.ZodString;
|
|
320
|
+
reference: z.ZodString;
|
|
321
|
+
rail: z.ZodString;
|
|
322
|
+
committed_at: z.ZodNumber;
|
|
323
|
+
reversal_of: z.ZodNullable<z.ZodString>;
|
|
324
|
+
reversal: z.ZodNullable<z.ZodObject<{
|
|
325
|
+
amount_total: z.ZodNumber;
|
|
326
|
+
amount_net: z.ZodNumber;
|
|
327
|
+
tax_amount: z.ZodNumber;
|
|
328
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
329
|
+
reference: z.ZodString;
|
|
330
|
+
quantity: z.ZodNumber;
|
|
331
|
+
tax_code: z.ZodString;
|
|
332
|
+
tax_behavior: z.ZodEnum<{
|
|
333
|
+
inclusive: "inclusive";
|
|
334
|
+
exclusive: "exclusive";
|
|
335
|
+
}>;
|
|
336
|
+
amount: z.ZodNumber;
|
|
337
|
+
amount_tax: z.ZodNumber;
|
|
338
|
+
amount_net: z.ZodNumber;
|
|
339
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
340
|
+
country: z.ZodString;
|
|
341
|
+
state: z.ZodNullable<z.ZodString>;
|
|
342
|
+
level: z.ZodNullable<z.ZodString>;
|
|
343
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
344
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
345
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
346
|
+
taxable_amount: z.ZodNumber;
|
|
347
|
+
amount: z.ZodNumber;
|
|
348
|
+
inclusive: z.ZodBoolean;
|
|
349
|
+
taxability_reason: z.ZodString;
|
|
350
|
+
}, z.core.$strict>>;
|
|
351
|
+
}, z.core.$strict>>;
|
|
352
|
+
}, z.core.$strict>>;
|
|
353
|
+
calculation: z.ZodObject<{
|
|
354
|
+
object: z.ZodLiteral<"tax.calculation">;
|
|
355
|
+
id: z.ZodString;
|
|
356
|
+
currency: z.ZodString;
|
|
357
|
+
collection: z.ZodEnum<{
|
|
358
|
+
collect: "collect";
|
|
359
|
+
not_registered: "not_registered";
|
|
360
|
+
nontaxable: "nontaxable";
|
|
361
|
+
}>;
|
|
362
|
+
registration_id: z.ZodNullable<z.ZodString>;
|
|
363
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
364
|
+
provider_calculation_ref: z.ZodNullable<z.ZodString>;
|
|
365
|
+
customer_location_evidence_id: z.ZodString;
|
|
366
|
+
country: z.ZodString;
|
|
367
|
+
state: z.ZodNullable<z.ZodString>;
|
|
368
|
+
amount_total: z.ZodNumber;
|
|
369
|
+
amount_net: z.ZodNumber;
|
|
370
|
+
tax_amount_exclusive: z.ZodNumber;
|
|
371
|
+
tax_amount_inclusive: z.ZodNumber;
|
|
372
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
373
|
+
reference: z.ZodString;
|
|
374
|
+
quantity: z.ZodNumber;
|
|
375
|
+
tax_code: z.ZodString;
|
|
376
|
+
tax_behavior: z.ZodEnum<{
|
|
377
|
+
inclusive: "inclusive";
|
|
378
|
+
exclusive: "exclusive";
|
|
379
|
+
}>;
|
|
380
|
+
amount: z.ZodNumber;
|
|
381
|
+
amount_tax: z.ZodNumber;
|
|
382
|
+
amount_net: z.ZodNumber;
|
|
383
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
384
|
+
country: z.ZodString;
|
|
385
|
+
state: z.ZodNullable<z.ZodString>;
|
|
386
|
+
level: z.ZodNullable<z.ZodString>;
|
|
387
|
+
display_name: z.ZodNullable<z.ZodString>;
|
|
388
|
+
tax_type: z.ZodNullable<z.ZodString>;
|
|
389
|
+
rate_percentage: z.ZodNullable<z.ZodString>;
|
|
390
|
+
taxable_amount: z.ZodNumber;
|
|
391
|
+
amount: z.ZodNumber;
|
|
392
|
+
inclusive: z.ZodBoolean;
|
|
393
|
+
taxability_reason: z.ZodString;
|
|
394
|
+
}, z.core.$strict>>;
|
|
395
|
+
}, z.core.$strict>>;
|
|
396
|
+
tax_date: z.ZodNumber;
|
|
397
|
+
created: z.ZodNumber;
|
|
398
|
+
expires_at: z.ZodNumber;
|
|
399
|
+
livemode: z.ZodBoolean;
|
|
400
|
+
}, z.core.$strict>;
|
|
401
|
+
}, z.core.$strict>;
|
|
402
|
+
readonly status: 201;
|
|
403
|
+
readonly sdk: "tax.transactions.createReversal";
|
|
404
|
+
}];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { Expand } from './common/objects';
|
|
3
|
+
/**
|
|
4
|
+
* One public route of the gateway, declared once (ADR 0014 D5).
|
|
5
|
+
*
|
|
6
|
+
* The backend validates its request with `query` / `body` (the SAME schema
|
|
7
|
+
* objects, imported), its route tests check every answer against `response`,
|
|
8
|
+
* the OpenAPI document is generated from the list of these, and the SDK's
|
|
9
|
+
* methods are generated from `sdk` — so the four cannot disagree.
|
|
10
|
+
*/
|
|
11
|
+
export type HttpMethod = 'get' | 'post' | 'put' | 'delete';
|
|
12
|
+
/**
|
|
13
|
+
* Who may call it.
|
|
14
|
+
*
|
|
15
|
+
* - `service`: an Oxy service token (`Authorization: Bearer …`) the merchant's
|
|
16
|
+
* server mints from its application credential — the merchant API;
|
|
17
|
+
* - `user`: an Oxy user session (`Authorization: Bearer …`) — the person, in
|
|
18
|
+
* the Peable app or an Oxy app (social payments, contributions, onboarding);
|
|
19
|
+
* - `public`: no credential. A payer-facing route, authorised by the
|
|
20
|
+
* unguessable id or client secret it is called with.
|
|
21
|
+
*/
|
|
22
|
+
export type RouteAuth = 'service' | 'user' | 'public';
|
|
23
|
+
/** A non-JSON success: bytes (a PDF, a CSV, a file's contents). */
|
|
24
|
+
export interface BinaryResponse {
|
|
25
|
+
readonly kind: 'binary';
|
|
26
|
+
readonly contentType: string;
|
|
27
|
+
}
|
|
28
|
+
/** A Server-Sent Events stream (a live tail). */
|
|
29
|
+
export interface StreamResponse {
|
|
30
|
+
readonly kind: 'stream';
|
|
31
|
+
/** The schema of each event's `data`. */
|
|
32
|
+
readonly event: z.ZodType;
|
|
33
|
+
}
|
|
34
|
+
export type RouteResponse = z.ZodType | BinaryResponse | StreamResponse;
|
|
35
|
+
export interface RouteContract {
|
|
36
|
+
/** Unique, camelCase: `createCustomer`. */
|
|
37
|
+
readonly operationId: string;
|
|
38
|
+
readonly method: HttpMethod;
|
|
39
|
+
/** OpenAPI template: `/v1/customers/{id}`. */
|
|
40
|
+
readonly path: string;
|
|
41
|
+
/** The reference section it is listed under: `Customers`. */
|
|
42
|
+
readonly tag: string;
|
|
43
|
+
readonly summary: string;
|
|
44
|
+
readonly description?: string;
|
|
45
|
+
readonly auth: RouteAuth;
|
|
46
|
+
/** The Oxy scope a `service` route requires. */
|
|
47
|
+
readonly scope?: string;
|
|
48
|
+
/** Path parameters, in path order. Each is a string; documented here. */
|
|
49
|
+
readonly params?: Readonly<Record<string, string>>;
|
|
50
|
+
readonly query?: z.ZodType;
|
|
51
|
+
readonly body?: z.ZodType;
|
|
52
|
+
/** `multipart` for a file upload; JSON otherwise. */
|
|
53
|
+
readonly bodyEncoding?: 'json' | 'multipart';
|
|
54
|
+
/** Accepts `Idempotency-Key` (every merchant `POST` but the few ADR 0014 D3 names). */
|
|
55
|
+
readonly idempotent?: boolean;
|
|
56
|
+
/** Accepts `Peable-Account: ca_…` (a platform acting on a connected account). */
|
|
57
|
+
readonly peableAccount?: boolean;
|
|
58
|
+
/** Answers only in test mode. */
|
|
59
|
+
readonly testModeOnly?: boolean;
|
|
60
|
+
readonly response: RouteResponse;
|
|
61
|
+
/** The success status. Default 200. */
|
|
62
|
+
readonly status?: 200 | 201 | 202 | 204;
|
|
63
|
+
/**
|
|
64
|
+
* The SDK method, as a dotted path from the client: `customers.create`,
|
|
65
|
+
* `billing.meters.listEventSummaries`. Absent: not exposed by the server SDK
|
|
66
|
+
* (a payer route the browser entry owns, a route an Oxy app calls with a
|
|
67
|
+
* user session).
|
|
68
|
+
*/
|
|
69
|
+
readonly sdk?: string;
|
|
70
|
+
/** The object type `expand[]` paths are rooted at (`x-peable-expandable`). */
|
|
71
|
+
readonly expandable?: string;
|
|
72
|
+
}
|
|
73
|
+
/** Declare a route, keeping its literal types for the SDK's inference. */
|
|
74
|
+
export declare function defineRoute<const R extends RouteContract>(route: R): R;
|
|
75
|
+
/** The parameters a route's body accepts (its wire input). */
|
|
76
|
+
export type BodyOf<R extends RouteContract> = R['body'] extends z.ZodType ? z.input<R['body']> : never;
|
|
77
|
+
/** The parameters a route's query accepts (its wire input). */
|
|
78
|
+
export type QueryOf<R extends RouteContract> = R['query'] extends z.ZodType ? z.input<R['query']> : never;
|
|
79
|
+
/** What a route answers with on success, references resolved. */
|
|
80
|
+
export type ResponseOf<R extends RouteContract> = R['response'] extends z.ZodType ? Expand<z.output<R['response']>> : R['response'] extends BinaryResponse ? Uint8Array : R['response'] extends StreamResponse ? Expand<z.output<R['response']['event']>> : never;
|
|
81
|
+
/** `/v1/customers/{id}` → `/v1/customers/:id`, Express's spelling. */
|
|
82
|
+
export declare function expressPath(path: string): string;
|
|
83
|
+
/** The path parameter names of a template, in order. */
|
|
84
|
+
export declare function pathParamNames(path: string): string[];
|
|
85
|
+
/** Whether `response` is a JSON schema (as opposed to bytes or a stream). */
|
|
86
|
+
export declare function isJsonResponse(response: RouteResponse): response is z.ZodType;
|