@peable.to/contracts 0.3.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 -97
- 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 -94
- 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 -134
- 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 -138
- package/dist/esm/openapi.js +0 -134
- package/dist/types/openapi.d.ts +0 -145
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taxDeadlineRoutes = exports.taxDeadlineListSchema = exports.taxDeadlineUnavailableSchema = exports.taxDeadlineSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const envelopes_1 = require("../../common/envelopes");
|
|
6
|
+
const objects_1 = require("../../common/objects");
|
|
7
|
+
const primitives_1 = require("../../common/primitives");
|
|
8
|
+
const route_1 = require("../../route");
|
|
9
|
+
const tax_1 = require("../../vocabulary/tax");
|
|
10
|
+
const shared_1 = require("./shared");
|
|
11
|
+
/**
|
|
12
|
+
* A due date the rule set can compute. `filing_status` is `not_tracked`:
|
|
13
|
+
* Peable files nothing, so it never claims a return was or was not filed.
|
|
14
|
+
*/
|
|
15
|
+
exports.taxDeadlineSchema = (0, objects_1.defineObject)('tax.deadline', 'TaxDeadline', zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
object: zod_1.z.literal('tax.deadline'),
|
|
18
|
+
kind: zod_1.z.enum(tax_1.TAX_DEADLINE_KINDS),
|
|
19
|
+
rule: zod_1.z.string().describe('The rule that sets it.'),
|
|
20
|
+
country: primitives_1.nullableString,
|
|
21
|
+
state: shared_1.taxState,
|
|
22
|
+
period_start: primitives_1.unixSeconds.nullable(),
|
|
23
|
+
period_end: primitives_1.unixSeconds.nullable(),
|
|
24
|
+
due: primitives_1.unixSeconds,
|
|
25
|
+
status: zod_1.z.enum(tax_1.TAX_DEADLINE_STATUSES),
|
|
26
|
+
filing_status: zod_1.z.literal('not_tracked'),
|
|
27
|
+
description: zod_1.z.string(),
|
|
28
|
+
source: shared_1.taxRuleSourceSchema,
|
|
29
|
+
})
|
|
30
|
+
.strict());
|
|
31
|
+
/** Where a deadline exists but the rule set cannot compute it, and why. */
|
|
32
|
+
exports.taxDeadlineUnavailableSchema = (0, objects_1.defineComponent)('TaxDeadlineUnavailable', zod_1.z
|
|
33
|
+
.object({
|
|
34
|
+
rule: primitives_1.nullableString,
|
|
35
|
+
country: primitives_1.nullableString,
|
|
36
|
+
state: shared_1.taxState,
|
|
37
|
+
reason: zod_1.z.string(),
|
|
38
|
+
})
|
|
39
|
+
.strict());
|
|
40
|
+
/** A complete list (`has_more` is `false`), with what could not be computed beside it. */
|
|
41
|
+
exports.taxDeadlineListSchema = (0, objects_1.defineComponent)('TaxDeadlineList', (0, envelopes_1.listOf)(exports.taxDeadlineSchema).extend({
|
|
42
|
+
unavailable: zod_1.z
|
|
43
|
+
.array(exports.taxDeadlineUnavailableSchema)
|
|
44
|
+
.describe('Where a deadline exists but the rule set cannot compute it, and why.'),
|
|
45
|
+
}));
|
|
46
|
+
exports.taxDeadlineRoutes = [
|
|
47
|
+
(0, route_1.defineRoute)({
|
|
48
|
+
operationId: 'listTaxDeadlines',
|
|
49
|
+
method: 'get',
|
|
50
|
+
path: '/v1/tax/deadlines',
|
|
51
|
+
tag: 'Tax compliance',
|
|
52
|
+
summary: 'List tax deadlines',
|
|
53
|
+
description: 'Due dates the rule set computes from declared registrations and the latest assessment, soonest first.',
|
|
54
|
+
auth: 'service',
|
|
55
|
+
scope: 'payments:read',
|
|
56
|
+
response: exports.taxDeadlineListSchema,
|
|
57
|
+
sdk: 'tax.compliance.listDeadlines',
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taxDocumentRoutes = exports.listTaxDocumentsQuery = exports.createTaxDocumentParams = exports.taxDocumentChecklistSchema = exports.taxDocumentChecklistItemSchema = exports.taxDocumentSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const envelopes_1 = require("../../common/envelopes");
|
|
6
|
+
const objects_1 = require("../../common/objects");
|
|
7
|
+
const params_1 = require("../../common/params");
|
|
8
|
+
const primitives_1 = require("../../common/primitives");
|
|
9
|
+
const route_1 = require("../../route");
|
|
10
|
+
const tax_1 = require("../../vocabulary/tax");
|
|
11
|
+
const shared_1 = require("./shared");
|
|
12
|
+
/**
|
|
13
|
+
* A supporting document (`taxdoc_…`): a `file_…` of purpose `tax_document`
|
|
14
|
+
* (private, never addressable by URL) with what it is for. Attaching a
|
|
15
|
+
* document proves nothing by itself; it is what a reviewer reads.
|
|
16
|
+
*/
|
|
17
|
+
exports.taxDocumentSchema = (0, objects_1.defineObject)('tax.document', 'TaxDocument', zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
object: zod_1.z.literal('tax.document'),
|
|
20
|
+
id: zod_1.z.string().describe('`taxdoc_…`.'),
|
|
21
|
+
livemode: primitives_1.livemode,
|
|
22
|
+
file: zod_1.z.string().describe('The file (`file_…`, purpose `tax_document`).'),
|
|
23
|
+
// The file's `status` vocabulary (`available` / `withheld` / `removed`).
|
|
24
|
+
file_status: zod_1.z
|
|
25
|
+
.enum(['available', 'withheld', 'removed'])
|
|
26
|
+
.describe("The file's standing now: a `removed` file is a document that is gone."),
|
|
27
|
+
filename: primitives_1.nullableString,
|
|
28
|
+
kind: zod_1.z.enum(tax_1.TAX_DOCUMENT_KINDS),
|
|
29
|
+
country: primitives_1.nullableString.describe('ISO 3166-1 alpha-2.'),
|
|
30
|
+
state: shared_1.taxState,
|
|
31
|
+
registration_declaration: primitives_1.nullableString.describe('The declaration (`taxrd_…`) it supports, when it names one.'),
|
|
32
|
+
description: primitives_1.nullableString,
|
|
33
|
+
metadata: primitives_1.metadata,
|
|
34
|
+
created: primitives_1.unixSeconds,
|
|
35
|
+
})
|
|
36
|
+
.strict(), {
|
|
37
|
+
examples: [
|
|
38
|
+
{
|
|
39
|
+
object: 'tax.document',
|
|
40
|
+
id: 'taxdoc_0193b8f2c1a87d3e9f4a',
|
|
41
|
+
livemode: false,
|
|
42
|
+
file: 'file_0193b8f2c1a87d3e9f4a',
|
|
43
|
+
file_status: 'available',
|
|
44
|
+
filename: 'oss-registration.pdf',
|
|
45
|
+
kind: 'registration_certificate',
|
|
46
|
+
country: 'ES',
|
|
47
|
+
state: null,
|
|
48
|
+
registration_declaration: 'taxrd_0193b8f2c1a87d3e9f4a',
|
|
49
|
+
description: null,
|
|
50
|
+
metadata: {},
|
|
51
|
+
created: 1793750400,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
});
|
|
55
|
+
exports.taxDocumentChecklistItemSchema = (0, objects_1.defineComponent)('TaxDocumentChecklistItem', zod_1.z
|
|
56
|
+
.object({
|
|
57
|
+
key: zod_1.z.string(),
|
|
58
|
+
kind: zod_1.z.enum(tax_1.TAX_DOCUMENT_KINDS),
|
|
59
|
+
country: primitives_1.nullableString,
|
|
60
|
+
state: shared_1.taxState,
|
|
61
|
+
status: zod_1.z
|
|
62
|
+
.enum(tax_1.TAX_DOCUMENT_CHECKLIST_STATUSES)
|
|
63
|
+
.describe('`provided`: an available document is attached; `unavailable`: only removed ones are.'),
|
|
64
|
+
documents: zod_1.z.array(zod_1.z.string()).describe('The attached documents (`taxdoc_…`).'),
|
|
65
|
+
reason: zod_1.z.string(),
|
|
66
|
+
})
|
|
67
|
+
.strict());
|
|
68
|
+
/** The documents the recorded facts call for, and which are attached. */
|
|
69
|
+
exports.taxDocumentChecklistSchema = (0, objects_1.defineObject)('tax.document_checklist', 'TaxDocumentChecklist', zod_1.z
|
|
70
|
+
.object({
|
|
71
|
+
object: zod_1.z.literal('tax.document_checklist'),
|
|
72
|
+
livemode: primitives_1.livemode,
|
|
73
|
+
items: zod_1.z.array(exports.taxDocumentChecklistItemSchema),
|
|
74
|
+
})
|
|
75
|
+
.strict());
|
|
76
|
+
/** Orbit's attachment of a document (the owner's). Attaching the same file again answers the same document. */
|
|
77
|
+
exports.createTaxDocumentParams = zod_1.z
|
|
78
|
+
.object({
|
|
79
|
+
file: shared_1.complianceIdParam.describe('A `file_…` of purpose `tax_document`.'),
|
|
80
|
+
kind: zod_1.z.enum(tax_1.TAX_DOCUMENT_KINDS),
|
|
81
|
+
country: shared_1.complianceCountryParam.nullable().optional(),
|
|
82
|
+
state: shared_1.complianceStateParam.optional(),
|
|
83
|
+
registration_declaration: shared_1.complianceIdParam.nullable().optional(),
|
|
84
|
+
description: (0, shared_1.complianceTextParam)(500).optional(),
|
|
85
|
+
metadata: params_1.metadataCreateParam.optional(),
|
|
86
|
+
})
|
|
87
|
+
.strict();
|
|
88
|
+
exports.listTaxDocumentsQuery = (0, params_1.listQuery)({});
|
|
89
|
+
exports.taxDocumentRoutes = [
|
|
90
|
+
(0, route_1.defineRoute)({
|
|
91
|
+
operationId: 'listTaxDocuments',
|
|
92
|
+
method: 'get',
|
|
93
|
+
path: '/v1/tax/documents',
|
|
94
|
+
tag: 'Tax compliance',
|
|
95
|
+
summary: 'List tax documents',
|
|
96
|
+
auth: 'service',
|
|
97
|
+
scope: 'payments:read',
|
|
98
|
+
query: exports.listTaxDocumentsQuery,
|
|
99
|
+
response: (0, envelopes_1.listOf)(exports.taxDocumentSchema),
|
|
100
|
+
sdk: 'tax.compliance.listDocuments',
|
|
101
|
+
expandable: 'tax.document',
|
|
102
|
+
}),
|
|
103
|
+
(0, route_1.defineRoute)({
|
|
104
|
+
operationId: 'retrieveTaxDocument',
|
|
105
|
+
method: 'get',
|
|
106
|
+
path: '/v1/tax/documents/{id}',
|
|
107
|
+
tag: 'Tax compliance',
|
|
108
|
+
summary: 'Retrieve a tax document',
|
|
109
|
+
auth: 'service',
|
|
110
|
+
scope: 'payments:read',
|
|
111
|
+
params: { id: 'The document (`taxdoc_…`).' },
|
|
112
|
+
query: params_1.expandOnlyQuery,
|
|
113
|
+
response: exports.taxDocumentSchema,
|
|
114
|
+
sdk: 'tax.compliance.retrieveDocument',
|
|
115
|
+
expandable: 'tax.document',
|
|
116
|
+
}),
|
|
117
|
+
(0, route_1.defineRoute)({
|
|
118
|
+
operationId: 'retrieveTaxDocumentChecklist',
|
|
119
|
+
method: 'get',
|
|
120
|
+
path: '/v1/tax/document_checklist',
|
|
121
|
+
tag: 'Tax compliance',
|
|
122
|
+
summary: 'Retrieve the document checklist',
|
|
123
|
+
auth: 'service',
|
|
124
|
+
scope: 'payments:read',
|
|
125
|
+
response: exports.taxDocumentChecklistSchema,
|
|
126
|
+
sdk: 'tax.compliance.retrieveDocumentChecklist',
|
|
127
|
+
}),
|
|
128
|
+
];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.taxRoutes = void 0;
|
|
18
|
+
// Peable Tax (ADR 0011) and its business compliance (ADR 0020): one module per
|
|
19
|
+
// resource, re-exported here, and their routes concatenated into `taxRoutes`.
|
|
20
|
+
const assessments_1 = require("./assessments");
|
|
21
|
+
const businessProfile_1 = require("./businessProfile");
|
|
22
|
+
const calculations_1 = require("./calculations");
|
|
23
|
+
const capabilities_1 = require("./capabilities");
|
|
24
|
+
const codes_1 = require("./codes");
|
|
25
|
+
const complianceActions_1 = require("./complianceActions");
|
|
26
|
+
const deadlines_1 = require("./deadlines");
|
|
27
|
+
const documents_1 = require("./documents");
|
|
28
|
+
const locationEvidence_1 = require("./locationEvidence");
|
|
29
|
+
const operatingLocations_1 = require("./operatingLocations");
|
|
30
|
+
const products_1 = require("./products");
|
|
31
|
+
const registrationDeclarations_1 = require("./registrationDeclarations");
|
|
32
|
+
const registrations_1 = require("./registrations");
|
|
33
|
+
const reports_1 = require("./reports");
|
|
34
|
+
const reviewItems_1 = require("./reviewItems");
|
|
35
|
+
const ruleSet_1 = require("./ruleSet");
|
|
36
|
+
const salesDestinations_1 = require("./salesDestinations");
|
|
37
|
+
const settings_1 = require("./settings");
|
|
38
|
+
const transactions_1 = require("./transactions");
|
|
39
|
+
__exportStar(require("./assessments"), exports);
|
|
40
|
+
__exportStar(require("./businessProfile"), exports);
|
|
41
|
+
__exportStar(require("./calculations"), exports);
|
|
42
|
+
__exportStar(require("./capabilities"), exports);
|
|
43
|
+
__exportStar(require("./codes"), exports);
|
|
44
|
+
__exportStar(require("./complianceActions"), exports);
|
|
45
|
+
__exportStar(require("./deadlines"), exports);
|
|
46
|
+
__exportStar(require("./documents"), exports);
|
|
47
|
+
__exportStar(require("./locationEvidence"), exports);
|
|
48
|
+
__exportStar(require("./operatingLocations"), exports);
|
|
49
|
+
__exportStar(require("./products"), exports);
|
|
50
|
+
__exportStar(require("./registrationDeclarations"), exports);
|
|
51
|
+
__exportStar(require("./registrations"), exports);
|
|
52
|
+
__exportStar(require("./reports"), exports);
|
|
53
|
+
__exportStar(require("./reviewItems"), exports);
|
|
54
|
+
__exportStar(require("./ruleSet"), exports);
|
|
55
|
+
__exportStar(require("./salesDestinations"), exports);
|
|
56
|
+
__exportStar(require("./settings"), exports);
|
|
57
|
+
__exportStar(require("./shared"), exports);
|
|
58
|
+
__exportStar(require("./transactions"), exports);
|
|
59
|
+
/** Peable Tax: collection (settings, evidence, calculations, transactions, reports) and business compliance. */
|
|
60
|
+
exports.taxRoutes = [
|
|
61
|
+
...codes_1.taxCodeRoutes,
|
|
62
|
+
...settings_1.taxSettingsRoutes,
|
|
63
|
+
...registrations_1.taxRegistrationRoutes,
|
|
64
|
+
...products_1.taxProductRoutes,
|
|
65
|
+
...locationEvidence_1.taxLocationEvidenceRoutes,
|
|
66
|
+
...calculations_1.taxCalculationRoutes,
|
|
67
|
+
...transactions_1.taxTransactionRoutes,
|
|
68
|
+
...reports_1.taxReportRoutes,
|
|
69
|
+
...businessProfile_1.taxBusinessProfileRoutes,
|
|
70
|
+
...operatingLocations_1.taxOperatingLocationRoutes,
|
|
71
|
+
...salesDestinations_1.taxSalesDestinationRoutes,
|
|
72
|
+
...registrationDeclarations_1.taxRegistrationDeclarationRoutes,
|
|
73
|
+
...documents_1.taxDocumentRoutes,
|
|
74
|
+
...ruleSet_1.taxRuleSetRoutes,
|
|
75
|
+
...capabilities_1.taxCapabilityRoutes,
|
|
76
|
+
...deadlines_1.taxDeadlineRoutes,
|
|
77
|
+
...assessments_1.taxAssessmentRoutes,
|
|
78
|
+
...reviewItems_1.taxReviewItemRoutes,
|
|
79
|
+
...complianceActions_1.taxComplianceActionRoutes,
|
|
80
|
+
];
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taxLocationEvidenceRoutes = exports.createTaxLocationEvidenceParams = exports.taxLocationEvidenceItemsParam = exports.taxLocationEvidenceItemParams = exports.taxLocationEvidenceSchema = exports.taxLocationEvidenceResultItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const objects_1 = require("../../common/objects");
|
|
6
|
+
const primitives_1 = require("../../common/primitives");
|
|
7
|
+
const route_1 = require("../../route");
|
|
8
|
+
const tax_1 = require("../../vocabulary/tax");
|
|
9
|
+
const settings_1 = require("./settings");
|
|
10
|
+
const shared_1 = require("./shared");
|
|
11
|
+
/**
|
|
12
|
+
* Customer location evidence (`taxloc_…`, ADR 0011): what places a customer
|
|
13
|
+
* in a jurisdiction, judged against that jurisdiction's own rule. There is
|
|
14
|
+
* deliberately no language, currency, locale or timezone evidence. An IP
|
|
15
|
+
* address is never stored; at most its salted hash.
|
|
16
|
+
*/
|
|
17
|
+
/** An item as judged: the place it points at, never more of the customer than the rule needs. */
|
|
18
|
+
exports.taxLocationEvidenceResultItemSchema = (0, objects_1.defineComponent)('TaxLocationEvidenceResultItem', zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
type: zod_1.z.enum(tax_1.TAX_LOCATION_EVIDENCE_TYPES),
|
|
21
|
+
country: shared_1.taxCountry,
|
|
22
|
+
state: shared_1.taxState,
|
|
23
|
+
})
|
|
24
|
+
.strict());
|
|
25
|
+
exports.taxLocationEvidenceSchema = (0, objects_1.defineObject)('tax.location_evidence', 'TaxLocationEvidence', zod_1.z
|
|
26
|
+
.object({
|
|
27
|
+
object: zod_1.z.literal('tax.location_evidence'),
|
|
28
|
+
id: zod_1.z.string().describe('`taxloc_…`.'),
|
|
29
|
+
customer_ref: zod_1.z.string().describe('The customer this evidence is about.'),
|
|
30
|
+
status: zod_1.z
|
|
31
|
+
.enum(tax_1.TAX_EVIDENCE_STATUSES)
|
|
32
|
+
.describe('Only `sufficient` evidence can be calculated against.'),
|
|
33
|
+
rule: zod_1.z
|
|
34
|
+
.string()
|
|
35
|
+
.describe('The jurisdiction rule applied: `eu_digital_two_items`, `gb_digital_two_items`, `us_billing_address`, `ca_billing_address`, `default_one_item`, or `none` when no item names a country.'),
|
|
36
|
+
country: shared_1.taxCountry
|
|
37
|
+
.nullable()
|
|
38
|
+
.describe('Where the evidence places the customer, when it does.'),
|
|
39
|
+
state: shared_1.taxState,
|
|
40
|
+
items: zod_1.z.array(exports.taxLocationEvidenceResultItemSchema),
|
|
41
|
+
observed_at: primitives_1.unixSeconds,
|
|
42
|
+
expires_at: primitives_1.unixSeconds.describe('Evidence stays usable for a day.'),
|
|
43
|
+
livemode: primitives_1.livemode,
|
|
44
|
+
})
|
|
45
|
+
.strict(), {
|
|
46
|
+
examples: [
|
|
47
|
+
{
|
|
48
|
+
object: 'tax.location_evidence',
|
|
49
|
+
id: 'taxloc_0193b8f2c1a87d3e9f4a',
|
|
50
|
+
customer_ref: 'cus_0193b8f2c1a87d3e9f4a',
|
|
51
|
+
status: 'sufficient',
|
|
52
|
+
rule: 'eu_digital_two_items',
|
|
53
|
+
country: 'DE',
|
|
54
|
+
state: null,
|
|
55
|
+
items: [
|
|
56
|
+
{ type: 'billing_address', country: 'DE', state: null },
|
|
57
|
+
{ type: 'ip_address', country: 'DE', state: null },
|
|
58
|
+
],
|
|
59
|
+
observed_at: 1793750400,
|
|
60
|
+
expires_at: 1793836800,
|
|
61
|
+
livemode: false,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
const evidenceCountry = zod_1.z.string().regex(/^[A-Z]{2}$/);
|
|
66
|
+
const evidenceState = zod_1.z
|
|
67
|
+
.string()
|
|
68
|
+
.regex(/^[A-Z0-9]{1,3}$/)
|
|
69
|
+
.nullish();
|
|
70
|
+
const ipv4 = zod_1.z.ipv4();
|
|
71
|
+
const ipv6 = zod_1.z.ipv6();
|
|
72
|
+
/**
|
|
73
|
+
* One piece of evidence. Strict: an item claiming a language, currency, locale
|
|
74
|
+
* or timezone is not a smaller kind of evidence, it is refused.
|
|
75
|
+
*/
|
|
76
|
+
exports.taxLocationEvidenceItemParams = zod_1.z.discriminatedUnion('type', [
|
|
77
|
+
zod_1.z.object({ type: zod_1.z.literal('billing_address'), address: settings_1.taxAddressParams }).strict(),
|
|
78
|
+
zod_1.z
|
|
79
|
+
.object({
|
|
80
|
+
type: zod_1.z.literal('ip_address'),
|
|
81
|
+
ip_address: zod_1.z
|
|
82
|
+
.string()
|
|
83
|
+
.refine((value) => ipv4.safeParse(value).success || ipv6.safeParse(value).success, 'Not an IP address'),
|
|
84
|
+
country: evidenceCountry,
|
|
85
|
+
state: evidenceState,
|
|
86
|
+
})
|
|
87
|
+
.strict(),
|
|
88
|
+
zod_1.z
|
|
89
|
+
.object({
|
|
90
|
+
type: zod_1.z.enum(['payment_method_country', 'bank_country', 'sim_country', 'landline_country']),
|
|
91
|
+
country: evidenceCountry,
|
|
92
|
+
})
|
|
93
|
+
.strict(),
|
|
94
|
+
]);
|
|
95
|
+
/** At least one item and at most six. */
|
|
96
|
+
exports.taxLocationEvidenceItemsParam = zod_1.z.array(exports.taxLocationEvidenceItemParams).min(1).max(6);
|
|
97
|
+
exports.createTaxLocationEvidenceParams = zod_1.z
|
|
98
|
+
.object({
|
|
99
|
+
customer_ref: shared_1.taxReferenceParam.describe('The customer this evidence is about; for billing, the `storeId`.'),
|
|
100
|
+
evidence: exports.taxLocationEvidenceItemsParam,
|
|
101
|
+
})
|
|
102
|
+
.strict();
|
|
103
|
+
exports.taxLocationEvidenceRoutes = [
|
|
104
|
+
(0, route_1.defineRoute)({
|
|
105
|
+
operationId: 'createTaxLocationEvidence',
|
|
106
|
+
method: 'post',
|
|
107
|
+
path: '/v1/tax/location_evidence',
|
|
108
|
+
tag: 'Tax',
|
|
109
|
+
summary: 'Record customer location evidence',
|
|
110
|
+
description: "Judged at once against the customer's jurisdiction rule; the answer says whether it is `sufficient` to calculate against.",
|
|
111
|
+
auth: 'service',
|
|
112
|
+
scope: 'payments:write',
|
|
113
|
+
idempotent: true,
|
|
114
|
+
body: exports.createTaxLocationEvidenceParams,
|
|
115
|
+
response: exports.taxLocationEvidenceSchema,
|
|
116
|
+
status: 201,
|
|
117
|
+
sdk: 'tax.locationEvidence.create',
|
|
118
|
+
}),
|
|
119
|
+
(0, route_1.defineRoute)({
|
|
120
|
+
operationId: 'retrieveTaxLocationEvidence',
|
|
121
|
+
method: 'get',
|
|
122
|
+
path: '/v1/tax/location_evidence/{id}',
|
|
123
|
+
tag: 'Tax',
|
|
124
|
+
summary: 'Retrieve customer location evidence',
|
|
125
|
+
auth: 'service',
|
|
126
|
+
scope: 'payments:read',
|
|
127
|
+
params: { id: 'The evidence (`taxloc_…`).' },
|
|
128
|
+
response: exports.taxLocationEvidenceSchema,
|
|
129
|
+
sdk: 'tax.locationEvidence.retrieve',
|
|
130
|
+
}),
|
|
131
|
+
];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taxOperatingLocationRoutes = exports.listTaxOperatingLocationsQuery = exports.updateTaxOperatingLocationParams = exports.createTaxOperatingLocationParams = exports.taxOperatingLocationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const envelopes_1 = require("../../common/envelopes");
|
|
6
|
+
const objects_1 = require("../../common/objects");
|
|
7
|
+
const params_1 = require("../../common/params");
|
|
8
|
+
const primitives_1 = require("../../common/primitives");
|
|
9
|
+
const route_1 = require("../../route");
|
|
10
|
+
const tax_1 = require("../../vocabulary/tax");
|
|
11
|
+
const shared_1 = require("./shared");
|
|
12
|
+
/**
|
|
13
|
+
* Where the business ACTUALLY operates (`taxol_…`). `head_office` and
|
|
14
|
+
* `fixed_establishment` are the owner's statement of establishment (the EU
|
|
15
|
+
* rule reads them); any location in a US state is physical presence there.
|
|
16
|
+
*/
|
|
17
|
+
exports.taxOperatingLocationSchema = (0, objects_1.defineObject)('tax.operating_location', 'TaxOperatingLocation', zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
object: zod_1.z.literal('tax.operating_location'),
|
|
20
|
+
id: zod_1.z.string().describe('`taxol_…`.'),
|
|
21
|
+
livemode: primitives_1.livemode,
|
|
22
|
+
kind: zod_1.z.enum(tax_1.TAX_OPERATING_LOCATION_KINDS),
|
|
23
|
+
country: shared_1.taxCountry,
|
|
24
|
+
state: shared_1.taxState,
|
|
25
|
+
description: primitives_1.nullableString,
|
|
26
|
+
started: primitives_1.unixSeconds.nullable(),
|
|
27
|
+
ended: primitives_1.unixSeconds.nullable().describe('Set once the business no longer operates there.'),
|
|
28
|
+
metadata: primitives_1.metadata,
|
|
29
|
+
created: primitives_1.unixSeconds,
|
|
30
|
+
})
|
|
31
|
+
.strict(), {
|
|
32
|
+
examples: [
|
|
33
|
+
{
|
|
34
|
+
object: 'tax.operating_location',
|
|
35
|
+
id: 'taxol_0193b8f2c1a87d3e9f4a',
|
|
36
|
+
livemode: false,
|
|
37
|
+
kind: 'head_office',
|
|
38
|
+
country: 'ES',
|
|
39
|
+
state: null,
|
|
40
|
+
description: 'Registered office, Barcelona',
|
|
41
|
+
started: 1735689600,
|
|
42
|
+
ended: null,
|
|
43
|
+
metadata: {},
|
|
44
|
+
created: 1793750400,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
/** Orbit's new operating location (the owner's). */
|
|
49
|
+
exports.createTaxOperatingLocationParams = zod_1.z
|
|
50
|
+
.object({
|
|
51
|
+
kind: zod_1.z.enum(tax_1.TAX_OPERATING_LOCATION_KINDS),
|
|
52
|
+
country: shared_1.complianceCountryParam,
|
|
53
|
+
state: shared_1.complianceStateParam.optional(),
|
|
54
|
+
description: (0, shared_1.complianceTextParam)(500).optional(),
|
|
55
|
+
started: shared_1.taxInstantParam.nullable().optional(),
|
|
56
|
+
ended: shared_1.taxInstantParam.nullable().optional(),
|
|
57
|
+
metadata: params_1.metadataCreateParam.optional(),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
/** Orbit's update (the owner's): `kind` and the place are fixed; `metadata` is a patch. */
|
|
61
|
+
exports.updateTaxOperatingLocationParams = zod_1.z
|
|
62
|
+
.object({
|
|
63
|
+
description: (0, shared_1.complianceTextParam)(500).optional(),
|
|
64
|
+
started: shared_1.taxInstantParam.nullable().optional(),
|
|
65
|
+
ended: shared_1.taxInstantParam.nullable().optional(),
|
|
66
|
+
metadata: params_1.metadataUpdateParam.optional(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
exports.listTaxOperatingLocationsQuery = (0, params_1.listQuery)({});
|
|
70
|
+
exports.taxOperatingLocationRoutes = [
|
|
71
|
+
(0, route_1.defineRoute)({
|
|
72
|
+
operationId: 'listTaxOperatingLocations',
|
|
73
|
+
method: 'get',
|
|
74
|
+
path: '/v1/tax/operating_locations',
|
|
75
|
+
tag: 'Tax compliance',
|
|
76
|
+
summary: 'List operating locations',
|
|
77
|
+
auth: 'service',
|
|
78
|
+
scope: 'payments:read',
|
|
79
|
+
query: exports.listTaxOperatingLocationsQuery,
|
|
80
|
+
response: (0, envelopes_1.listOf)(exports.taxOperatingLocationSchema),
|
|
81
|
+
sdk: 'tax.compliance.listOperatingLocations',
|
|
82
|
+
expandable: 'tax.operating_location',
|
|
83
|
+
}),
|
|
84
|
+
(0, route_1.defineRoute)({
|
|
85
|
+
operationId: 'retrieveTaxOperatingLocation',
|
|
86
|
+
method: 'get',
|
|
87
|
+
path: '/v1/tax/operating_locations/{id}',
|
|
88
|
+
tag: 'Tax compliance',
|
|
89
|
+
summary: 'Retrieve an operating location',
|
|
90
|
+
auth: 'service',
|
|
91
|
+
scope: 'payments:read',
|
|
92
|
+
params: { id: 'The operating location (`taxol_…`).' },
|
|
93
|
+
query: params_1.expandOnlyQuery,
|
|
94
|
+
response: exports.taxOperatingLocationSchema,
|
|
95
|
+
sdk: 'tax.compliance.retrieveOperatingLocation',
|
|
96
|
+
expandable: 'tax.operating_location',
|
|
97
|
+
}),
|
|
98
|
+
];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taxProductRoutes = exports.setTaxProductCodeParams = exports.taxProductRefParam = exports.taxProductCodeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const envelopes_1 = require("../../common/envelopes");
|
|
6
|
+
const objects_1 = require("../../common/objects");
|
|
7
|
+
const primitives_1 = require("../../common/primitives");
|
|
8
|
+
const route_1 = require("../../route");
|
|
9
|
+
const shared_1 = require("./shared");
|
|
10
|
+
/**
|
|
11
|
+
* A product's tax code: what a calculation line naming `product_ref` is taxed
|
|
12
|
+
* as when the line does not say. Classifying a product is the seller's call.
|
|
13
|
+
*/
|
|
14
|
+
exports.taxProductCodeSchema = (0, objects_1.defineObject)('tax.product', 'TaxProductCode', zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
object: zod_1.z.literal('tax.product'),
|
|
17
|
+
product_ref: zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.describe("The merchant's product or plan reference (a billing `planId`)."),
|
|
20
|
+
tax_code: zod_1.z.string().describe('`txcd_…`.'),
|
|
21
|
+
updated_at: primitives_1.unixSeconds,
|
|
22
|
+
})
|
|
23
|
+
.strict(), {
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
object: 'tax.product',
|
|
27
|
+
product_ref: 'plan_pro_monthly',
|
|
28
|
+
tax_code: 'txcd_10103001',
|
|
29
|
+
updated_at: 1793750400,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
/** `{productRef}` of `PUT /v1/tax/products/{productRef}`. */
|
|
34
|
+
exports.taxProductRefParam = shared_1.taxReferenceParam;
|
|
35
|
+
exports.setTaxProductCodeParams = zod_1.z
|
|
36
|
+
.object({ tax_code: zod_1.z.string().describe('A `txcd_…` from `GET /v1/tax/codes`.') })
|
|
37
|
+
.strict();
|
|
38
|
+
exports.taxProductRoutes = [
|
|
39
|
+
(0, route_1.defineRoute)({
|
|
40
|
+
operationId: 'listTaxProducts',
|
|
41
|
+
method: 'get',
|
|
42
|
+
path: '/v1/tax/products',
|
|
43
|
+
tag: 'Tax',
|
|
44
|
+
summary: 'List product tax codes',
|
|
45
|
+
description: 'Every classified product, by `product_ref`: a complete list, `has_more` is `false`.',
|
|
46
|
+
auth: 'service',
|
|
47
|
+
scope: 'payments:read',
|
|
48
|
+
response: (0, envelopes_1.listOf)(exports.taxProductCodeSchema),
|
|
49
|
+
sdk: 'tax.products.list',
|
|
50
|
+
}),
|
|
51
|
+
(0, route_1.defineRoute)({
|
|
52
|
+
operationId: 'setTaxProductCode',
|
|
53
|
+
method: 'put',
|
|
54
|
+
path: '/v1/tax/products/{productRef}',
|
|
55
|
+
tag: 'Tax',
|
|
56
|
+
summary: "Set a product's tax code",
|
|
57
|
+
description: 'Creates the classification or replaces it.',
|
|
58
|
+
auth: 'service',
|
|
59
|
+
scope: 'payments:write',
|
|
60
|
+
params: {
|
|
61
|
+
productRef: "The merchant's product or plan reference: 1–128 of `A-Z a-z 0-9 _ . : -`.",
|
|
62
|
+
},
|
|
63
|
+
body: exports.setTaxProductCodeParams,
|
|
64
|
+
response: exports.taxProductCodeSchema,
|
|
65
|
+
sdk: 'tax.products.setTaxCode',
|
|
66
|
+
}),
|
|
67
|
+
];
|