@tagadapay/node-sdk 1.2.1 → 2.0.2

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.
Files changed (43) hide show
  1. package/README.md +182 -100
  2. package/dist/HttpClient.d.ts +15 -7
  3. package/dist/HttpClient.d.ts.map +1 -1
  4. package/dist/HttpClient.js +16 -10
  5. package/dist/HttpClient.js.map +1 -1
  6. package/dist/Tagada.d.ts +24 -5
  7. package/dist/Tagada.d.ts.map +1 -1
  8. package/dist/Tagada.js +4 -0
  9. package/dist/Tagada.js.map +1 -1
  10. package/dist/cli/init.js +47 -45
  11. package/dist/cli/init.js.map +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/resources/Partners.d.ts +62 -111
  16. package/dist/resources/Partners.d.ts.map +1 -1
  17. package/dist/resources/Partners.js +70 -121
  18. package/dist/resources/Partners.js.map +1 -1
  19. package/dist/resources/Processing.d.ts +107 -0
  20. package/dist/resources/Processing.d.ts.map +1 -0
  21. package/dist/resources/Processing.js +123 -0
  22. package/dist/resources/Processing.js.map +1 -0
  23. package/dist/resources/TaxExemptions.d.ts +23 -0
  24. package/dist/resources/TaxExemptions.d.ts.map +1 -0
  25. package/dist/resources/TaxExemptions.js +25 -0
  26. package/dist/resources/TaxExemptions.js.map +1 -0
  27. package/dist/resources/index.d.ts +1 -0
  28. package/dist/resources/index.d.ts.map +1 -1
  29. package/dist/resources/index.js +1 -0
  30. package/dist/resources/index.js.map +1 -1
  31. package/dist/types/index.d.ts +1 -0
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/index.js +1 -0
  34. package/dist/types/index.js.map +1 -1
  35. package/dist/types/partners.d.ts +117 -52
  36. package/dist/types/partners.d.ts.map +1 -1
  37. package/dist/types/partners.js +20 -4
  38. package/dist/types/partners.js.map +1 -1
  39. package/dist/types/taxExemptions.d.ts +25 -0
  40. package/dist/types/taxExemptions.d.ts.map +1 -0
  41. package/dist/types/taxExemptions.js +2 -0
  42. package/dist/types/taxExemptions.js.map +1 -0
  43. package/package.json +88 -88
@@ -1,151 +1,100 @@
1
- import { BaseResource } from './BaseResource.js';
1
+ import { ProcessingTpas } from './Processing.js';
2
2
  /**
3
- * Partner Accounts resource (`tagada.partners.accounts.*`).
3
+ * `tagada.partners.*` — the partner ("on behalf of") namespace. A partner
4
+ * provisions and manages merchants and TPAs for its own sub-merchants.
4
5
  *
5
- * Wraps `/api/tagadapay/v1/accounts`. Used by partners (PSPs, marketplaces,
6
- * embedded-payments platforms) to provision and manage sub-merchants (TPAs).
6
+ * The namespace mirrors the platform's two domains:
7
+ * - `partners.crm.*` → CRM provisioning (merchants + CRM keys),
8
+ * served on `/api/public/v1/partner/*`.
9
+ * - `partners.processing.*` → TagadaPay provisioning (TPAs, KYB, keys),
10
+ * served on `/api/tagadapay/v1/partner/*`.
7
11
  *
8
- * Each `create()` call atomically creates:
9
- * 1. an `accounts` row (private namespace, no Clerk user — never auto-invited)
10
- * 2. a `stores` row (auto-provisioned, `1 TPA = 1 store` invariant)
11
- * 3. a `tagadapay_accounts` row (the TPA itself)
12
+ * All write operations require a partner key (`tp_sk_partner_*`).
12
13
  *
13
- * Idempotency: pass `externalRef` to make `create()` idempotent on retries.
14
- * A second call with the same `(partnerId, externalRef)` returns the existing TPA.
14
+ * @see https://docs.tagadapay.com/developer-tools/partners/introduction
15
15
  */
16
- export class PartnerAccounts extends BaseResource {
16
+ // ═══════════════════════════════════════════════════════════════════
17
+ // CRM provisioning — partners.crm.*
18
+ // ═══════════════════════════════════════════════════════════════════
19
+ /** CRM keys (`sk_crm_…`) for a merchant. `partners.crm.merchants.keys.*`. */
20
+ export class PartnerCrmKeys {
21
+ constructor(client) {
22
+ this.client = client;
23
+ }
17
24
  /**
18
- * Provision a new sub-merchant. Atomically creates the `accounts` row,
19
- * the auto-provisioned store, and the TPA in a single round-trip.
25
+ * Mint a CRM Key for a merchant. The plaintext `token` is returned ONLY on
26
+ * creation. New tokens use the `sk_crm_…` format.
20
27
  *
21
28
  * @example
22
- * const tpa = await tagada.partners.accounts.create({
23
- * legalName: 'Acme SAS',
24
- * country: 'FR',
25
- * currency: 'EUR',
26
- * externalRef: 'merchant_42', // your own id — used for idempotency
27
- * });
28
- * // → { id: 'tpa_xxx', storeId: 'store_xxx', accountId: 'acc_xxx', ... }
29
+ * const key = await tagada.partners.crm.merchants.keys.create('acc_xxx');
30
+ * // key.token = 'sk_crm_live_…'
29
31
  */
30
- async create(params, opts) {
31
- return this.client.partnerPost('/v1/accounts', params, opts);
32
- }
33
- async retrieve(tpaId, opts) {
34
- return this.client.partnerGet(`/v1/accounts/${tpaId}`, undefined, opts);
32
+ async create(accountId, params, opts) {
33
+ return this.client.post(`/partner/merchants/${accountId}/keys`, params ?? {}, opts);
35
34
  }
36
- /**
37
- * Look up a TPA by your own external reference (e.g. your merchant id).
38
- * Returns `null` if no TPA matches.
39
- */
40
- async retrieveByExternalRef(externalRef, opts) {
41
- const list = await this.client.partnerGet('/v1/accounts', { externalRef, limit: 1 }, opts);
42
- return list.data?.[0] ?? null;
35
+ async list(accountId, opts) {
36
+ return this.client.get(`/partner/merchants/${accountId}/keys`, undefined, opts);
43
37
  }
44
- async list(params, opts) {
45
- return this.client.partnerGet('/v1/accounts', params, opts);
38
+ /** Revoke a CRM Key. Subsequent calls with that token get HTTP 401. */
39
+ async revoke(keyId, opts) {
40
+ return this.client.del(`/partner/keys/${keyId}`, undefined, opts);
46
41
  }
47
- async update(tpaId, params, opts) {
48
- return this.client.partnerPut(`/v1/accounts/${tpaId}`, params, opts);
42
+ }
43
+ /** Merchants (`acc_xxx`) managed by a partner. `partners.crm.merchants.*`. */
44
+ export class PartnerCrmMerchants {
45
+ constructor(client) {
46
+ this.client = client;
47
+ this.keys = new PartnerCrmKeys(client);
49
48
  }
50
49
  /**
51
- * Move the TPA from its current store to `targetStoreId`. The target
52
- * store MUST belong to the same `accounts` row — we never let a TPA
53
- * cross merchant entities. The old store stays intact (orphaned from
54
- * any active TPA) so historical data remains accessible.
55
- *
56
- * NOT YET IMPLEMENTED — the corresponding backend route
57
- * (`POST /api/tagadapay/v1/accounts/:id/repoint_store`) ships in a
58
- * later phase. This stub throws synchronously so partner code
59
- * doesn’t depend on a route that 404s in production. Track the
60
- * upstream ticket before re-enabling.
50
+ * Create a CRM merchant. CRM-only is valid a merchant needs no TPA. Pass
51
+ * `externalRef` for idempotency.
61
52
  *
62
- * @internal
53
+ * @example
54
+ * const merchant = await tagada.partners.crm.merchants.create({
55
+ * legalName: 'Acme SAS',
56
+ * externalRef: 'merchant_42',
57
+ * });
58
+ * // merchant.id = 'acc_xxx'
63
59
  */
64
- async repointStore(_tpaId, _params, _opts) {
65
- throw new Error("[tagada.partners.accounts.repointStore] route_not_implemented — " +
66
- "the backend route POST /v1/accounts/:id/repoint_store is not yet " +
67
- "available. Contact the TagadaPay team if you need TPA re-pointing.");
60
+ async create(params, opts) {
61
+ return this.client.post('/partner/merchants', params, opts);
68
62
  }
69
- /**
70
- * Send a TagadaPay portal invitation to the merchant. Only meaningful
71
- * when the partner’s `merchantPortalAccess` policy is `'on_request'`.
72
- *
73
- * NOT YET IMPLEMENTED — the corresponding backend route
74
- * (`POST /api/tagadapay/v1/accounts/:id/onboarding_link`) ships
75
- * alongside the merchant-portal access policy enforcement. Stub
76
- * throws synchronously to prevent silent 404s in partner code.
77
- *
78
- * @internal
79
- */
80
- async invite(_tpaId, _opts) {
81
- throw new Error("[tagada.partners.accounts.invite] route_not_implemented — " +
82
- "the backend route POST /v1/accounts/:id/onboarding_link is not " +
83
- "yet available. Contact the TagadaPay team if you need merchant " +
84
- "portal invitations.");
63
+ async retrieve(accountId, opts) {
64
+ return this.client.get(`/partner/merchants/${accountId}`, undefined, opts);
85
65
  }
86
- }
87
- /**
88
- * Partner API keys resource (`tagada.partners.apiKeys.*`).
89
- *
90
- * Sub-keys are restricted to a single TPA. Use sub-keys (not the partner key)
91
- * for charging — smaller blast radius if either leaks.
92
- */
93
- export class PartnerApiKeys extends BaseResource {
94
- /**
95
- * Mint a sub-key restricted to one TPA. The plaintext `secret` is
96
- * returned ONLY on creation — store it immediately in your secret manager.
97
- */
98
- async create(tpaId, params, opts) {
99
- return this.client.partnerPost(`/v1/accounts/${tpaId}/api_keys`, params ?? {}, opts);
100
- }
101
- async list(tpaId, opts) {
102
- return this.client.partnerGet(`/v1/accounts/${tpaId}/api_keys`, undefined, opts);
66
+ /** Look up a merchant by your own external reference. Returns `null` if none match. */
67
+ async retrieveByExternalRef(externalRef, opts) {
68
+ const list = await this.client.get('/partner/merchants', { externalRef, limit: 1 }, opts);
69
+ return list.data?.[0] ?? null;
103
70
  }
104
- /**
105
- * Revoke a sub-key. Subsequent calls with that secret get HTTP 401.
106
- * In-flight calls complete normally. Irreversible — mint a new key
107
- * and deploy it before revoking.
108
- */
109
- async revoke(apiKeyId, opts) {
110
- return this.client.partnerDel(`/v1/api_keys/${apiKeyId}`, undefined, opts);
71
+ async list(params, opts) {
72
+ return this.client.get('/partner/merchants', params, opts);
111
73
  }
112
74
  }
113
- /**
114
- * Partner KYB requirements resource (`tagada.partners.requirements.*`).
115
- */
116
- export class PartnerRequirements extends BaseResource {
117
- async list(tpaId, opts) {
118
- return this.client.partnerGet(`/v1/accounts/${tpaId}/requirements`, undefined, opts);
119
- }
120
- async update(tpaId, code, params, opts) {
121
- return this.client.partnerPut(`/v1/accounts/${tpaId}/requirements/${code}`, params, opts);
75
+ /** Aggregator for `tagada.partners.crm`. */
76
+ export class PartnerCrm {
77
+ constructor(client) {
78
+ this.merchants = new PartnerCrmMerchants(client);
122
79
  }
123
80
  }
124
- /**
125
- * Partner KYB documents resource (`tagada.partners.documents.*`).
126
- *
127
- * v1 ships only the metadata-only path. Document bytes live in S3 — you
128
- * upload directly via a presigned URL we issue (`getUploadUrl()`), then
129
- * call `record()` with the resulting `storageUrl` to attach metadata.
130
- */
131
- export class PartnerDocuments extends BaseResource {
132
- async list(tpaId, opts) {
133
- return this.client.partnerGet(`/v1/accounts/${tpaId}/documents`, undefined, opts);
134
- }
135
- async record(params, opts) {
136
- return this.client.partnerPost(`/v1/accounts/${params.tagadapayAccountId}/documents`, params, opts);
81
+ // ═══════════════════════════════════════════════════════════════════
82
+ // Processing provisioning partners.processing.*
83
+ // ═══════════════════════════════════════════════════════════════════
84
+ /** Aggregator for `tagada.partners.processing`. */
85
+ export class PartnerProcessing {
86
+ constructor(client) {
87
+ // Partner surface — `/partner` prefix on `/api/tagadapay/v1`.
88
+ this.tpas = new ProcessingTpas(client, '/partner');
137
89
  }
138
90
  }
139
- /**
140
- * Aggregator class exposed as `tagada.partners`. Holds the per-resource
141
- * sub-clients so you can write `tagada.partners.accounts.create(...)`.
142
- */
91
+ // ═══════════════════════════════════════════════════════════════════
92
+ // Root: tagada.partners
93
+ // ═══════════════════════════════════════════════════════════════════
143
94
  export class Partners {
144
95
  constructor(client) {
145
- this.accounts = new PartnerAccounts(client);
146
- this.apiKeys = new PartnerApiKeys(client);
147
- this.requirements = new PartnerRequirements(client);
148
- this.documents = new PartnerDocuments(client);
96
+ this.crm = new PartnerCrm(client);
97
+ this.processing = new PartnerProcessing(client);
149
98
  }
150
99
  }
151
100
  //# sourceMappingURL=Partners.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Partners.js","sourceRoot":"","sources":["../../src/resources/Partners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAiBjD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAC/C;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,MAAM,CACV,MAAkC,EAClC,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAiB,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/E,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAa,EAAE,IAAqB;QACjD,OAAO,IAAI,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Y,MAAkB;QAC5B,8DAA8D;QAC9D,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;CACF;AAED,sEAAsE;AACtE,wBAAwB;AACxB,sEAAsE;AAEtE,MAAM,OAAO,QAAQ;IAMnB,YAAY,MAAkB;QAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;CACF"}
@@ -0,0 +1,107 @@
1
+ import type { HttpClient } from '../HttpClient.js';
2
+ import type { RequestOptions } from '../types/common.js';
3
+ import type { Tpa, TpaCreateParams, TpaListParams, ProcessingKey, ProcessingKeyCreated, ProcessingKeyCreateParams, TpaRequirement, RequirementValue, TpaDocument, TpaDocumentRecordParams } from '../types/partners.js';
4
+ /**
5
+ * Processing domain (TagadaPay payfac), served on `/api/tagadapay/v1`.
6
+ *
7
+ * The same resource classes back two SDK entry points, differing only by a
8
+ * URL prefix:
9
+ * - `tagada.processing.*` → direct merchant, prefix `''`
10
+ * - `tagada.partners.processing.*` → partner "on behalf of", prefix `/partner`
11
+ */
12
+ /** Processing keys (`tp_sk_…`), each scoped to one TPA. */
13
+ export declare class ProcessingKeys {
14
+ private readonly client;
15
+ private readonly prefix;
16
+ constructor(client: HttpClient, prefix: string);
17
+ /**
18
+ * Mint a processing key restricted to one TPA. The plaintext `secret` is
19
+ * returned ONLY on creation — store it immediately in your secret manager.
20
+ */
21
+ create(tpaId: string, params?: ProcessingKeyCreateParams, opts?: RequestOptions): Promise<ProcessingKeyCreated>;
22
+ list(tpaId: string, opts?: RequestOptions): Promise<{
23
+ data: ProcessingKey[];
24
+ }>;
25
+ /** Revoke a processing key. Subsequent calls with that secret get HTTP 401. */
26
+ revoke(keyId: string, opts?: RequestOptions): Promise<{
27
+ id: string;
28
+ status: 'revoked';
29
+ }>;
30
+ }
31
+ /** KYB requirements for a TPA. */
32
+ export declare class ProcessingRequirements {
33
+ private readonly client;
34
+ private readonly prefix;
35
+ constructor(client: HttpClient, prefix: string);
36
+ list(tpaId: string, opts?: RequestOptions): Promise<{
37
+ data: TpaRequirement[];
38
+ }>;
39
+ /**
40
+ * Submit a value for a non-document requirement (e.g. `business.vat_number`,
41
+ * `banking.iban`). The requirement flips to `pending_verification` — it is
42
+ * never set directly to `satisfied` (Tagada ops / a provider verify it).
43
+ * Document requirements are satisfied via `documents.record()` instead.
44
+ */
45
+ update(tpaId: string, code: string, value: RequirementValue, opts?: RequestOptions): Promise<TpaRequirement>;
46
+ }
47
+ /**
48
+ * KYB documents for a TPA. v1 ships only the metadata path: upload bytes to
49
+ * S3 via a presigned URL, then `record()` the resulting `storageUrl`.
50
+ */
51
+ export declare class ProcessingDocuments {
52
+ private readonly client;
53
+ private readonly prefix;
54
+ constructor(client: HttpClient, prefix: string);
55
+ list(tpaId: string, opts?: RequestOptions): Promise<{
56
+ data: TpaDocument[];
57
+ }>;
58
+ record(tpaId: string, params: TpaDocumentRecordParams, opts?: RequestOptions): Promise<TpaDocument>;
59
+ }
60
+ /**
61
+ * TagadaPay Accounts (TPAs) — the processing provisioning surface.
62
+ * A merchant (`acc_xxx`) can own multiple TPAs (`tpa_xxx`).
63
+ */
64
+ export declare class ProcessingTpas {
65
+ private readonly client;
66
+ private readonly prefix;
67
+ readonly keys: ProcessingKeys;
68
+ readonly requirements: ProcessingRequirements;
69
+ readonly documents: ProcessingDocuments;
70
+ constructor(client: HttpClient, prefix: string);
71
+ /**
72
+ * Provision a new TPA. Pass `accountId` to attach it to an existing
73
+ * merchant (the multi-TPA case). Pass `externalRef` for idempotency.
74
+ *
75
+ * @example
76
+ * const tpa = await tagada.partners.processing.tpas.create({
77
+ * accountId: 'acc_xxx',
78
+ * country: 'FR', currency: 'EUR',
79
+ * externalRef: 'merchant_42_eu',
80
+ * });
81
+ */
82
+ create(params: TpaCreateParams, opts?: RequestOptions): Promise<Tpa>;
83
+ retrieve(tpaId: string, opts?: RequestOptions): Promise<Tpa>;
84
+ /** Look up a TPA by your own external reference. Returns `null` if none match. */
85
+ retrieveByExternalRef(externalRef: string, opts?: RequestOptions): Promise<Tpa | null>;
86
+ list(params?: TpaListParams, opts?: RequestOptions): Promise<{
87
+ data: Tpa[];
88
+ hasMore: boolean;
89
+ }>;
90
+ /**
91
+ * Re-point a TPA to a different store within the same merchant. This is the
92
+ * only mutation `PATCH /tpas/:id` exposes today — other fields (`status`,
93
+ * KYB outcomes) are operator-driven. The target store must belong to the
94
+ * same merchant (`acc_xxx`); crossing merchants is refused server-side.
95
+ */
96
+ repointStore(tpaId: string, storeId: string, opts?: RequestOptions): Promise<Tpa>;
97
+ }
98
+ /**
99
+ * Top-level processing namespace exposed as `tagada.processing`. For a direct
100
+ * merchant managing their own TPAs. Requires a key with processing access on
101
+ * the merchant (a partner key, or a merchant whose account has processing).
102
+ */
103
+ export declare class Processing {
104
+ readonly tpas: ProcessingTpas;
105
+ constructor(client: HttpClient);
106
+ }
107
+ //# sourceMappingURL=Processing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Processing.d.ts","sourceRoot":"","sources":["../../src/resources/Processing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,GAAG,EACH,eAAe,EACf,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,yBAAyB,EACzB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;GAOG;AAEH,2DAA2D;AAC3D,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,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on `/api/tagadapay/v1`.
3
+ *
4
+ * The same resource classes back two SDK entry points, differing only by a
5
+ * URL prefix:
6
+ * - `tagada.processing.*` → direct merchant, prefix `''`
7
+ * - `tagada.partners.processing.*` → partner "on behalf of", prefix `/partner`
8
+ */
9
+ /** Processing keys (`tp_sk_…`), each scoped to one TPA. */
10
+ export class ProcessingKeys {
11
+ constructor(client, prefix) {
12
+ this.client = client;
13
+ this.prefix = prefix;
14
+ }
15
+ /**
16
+ * Mint a processing key restricted to one TPA. The plaintext `secret` is
17
+ * returned ONLY on creation — store it immediately in your secret manager.
18
+ */
19
+ async create(tpaId, params, opts) {
20
+ return this.client.processingPost(`${this.prefix}/tpas/${tpaId}/keys`, params ?? {}, opts);
21
+ }
22
+ async list(tpaId, opts) {
23
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}/keys`, undefined, opts);
24
+ }
25
+ /** Revoke a processing key. Subsequent calls with that secret get HTTP 401. */
26
+ async revoke(keyId, opts) {
27
+ return this.client.processingDel(`${this.prefix}/keys/${keyId}`, undefined, opts);
28
+ }
29
+ }
30
+ /** KYB requirements for a TPA. */
31
+ export class ProcessingRequirements {
32
+ constructor(client, prefix) {
33
+ this.client = client;
34
+ this.prefix = prefix;
35
+ }
36
+ async list(tpaId, opts) {
37
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}/requirements`, undefined, opts);
38
+ }
39
+ /**
40
+ * Submit a value for a non-document requirement (e.g. `business.vat_number`,
41
+ * `banking.iban`). The requirement flips to `pending_verification` — it is
42
+ * never set directly to `satisfied` (Tagada ops / a provider verify it).
43
+ * Document requirements are satisfied via `documents.record()` instead.
44
+ */
45
+ async update(tpaId, code, value, opts) {
46
+ return this.client.processingPatch(`${this.prefix}/tpas/${tpaId}/requirements/${code}`, { value }, opts);
47
+ }
48
+ }
49
+ /**
50
+ * KYB documents for a TPA. v1 ships only the metadata path: upload bytes to
51
+ * S3 via a presigned URL, then `record()` the resulting `storageUrl`.
52
+ */
53
+ export class ProcessingDocuments {
54
+ constructor(client, prefix) {
55
+ this.client = client;
56
+ this.prefix = prefix;
57
+ }
58
+ async list(tpaId, opts) {
59
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}/documents`, undefined, opts);
60
+ }
61
+ async record(tpaId, params, opts) {
62
+ return this.client.processingPost(`${this.prefix}/tpas/${tpaId}/documents`, params, opts);
63
+ }
64
+ }
65
+ /**
66
+ * TagadaPay Accounts (TPAs) — the processing provisioning surface.
67
+ * A merchant (`acc_xxx`) can own multiple TPAs (`tpa_xxx`).
68
+ */
69
+ export class ProcessingTpas {
70
+ constructor(client, prefix) {
71
+ this.client = client;
72
+ this.prefix = prefix;
73
+ this.keys = new ProcessingKeys(client, prefix);
74
+ this.requirements = new ProcessingRequirements(client, prefix);
75
+ this.documents = new ProcessingDocuments(client, prefix);
76
+ }
77
+ /**
78
+ * Provision a new TPA. Pass `accountId` to attach it to an existing
79
+ * merchant (the multi-TPA case). Pass `externalRef` for idempotency.
80
+ *
81
+ * @example
82
+ * const tpa = await tagada.partners.processing.tpas.create({
83
+ * accountId: 'acc_xxx',
84
+ * country: 'FR', currency: 'EUR',
85
+ * externalRef: 'merchant_42_eu',
86
+ * });
87
+ */
88
+ async create(params, opts) {
89
+ return this.client.processingPost(`${this.prefix}/tpas`, params, opts);
90
+ }
91
+ async retrieve(tpaId, opts) {
92
+ return this.client.processingGet(`${this.prefix}/tpas/${tpaId}`, undefined, opts);
93
+ }
94
+ /** Look up a TPA by your own external reference. Returns `null` if none match. */
95
+ async retrieveByExternalRef(externalRef, opts) {
96
+ const list = await this.client.processingGet(`${this.prefix}/tpas`, { externalRef, limit: 1 }, opts);
97
+ return list.data?.[0] ?? null;
98
+ }
99
+ async list(params, opts) {
100
+ return this.client.processingGet(`${this.prefix}/tpas`, params, opts);
101
+ }
102
+ /**
103
+ * Re-point a TPA to a different store within the same merchant. This is the
104
+ * only mutation `PATCH /tpas/:id` exposes today — other fields (`status`,
105
+ * KYB outcomes) are operator-driven. The target store must belong to the
106
+ * same merchant (`acc_xxx`); crossing merchants is refused server-side.
107
+ */
108
+ async repointStore(tpaId, storeId, opts) {
109
+ return this.client.processingPatch(`${this.prefix}/tpas/${tpaId}`, { storeId }, opts);
110
+ }
111
+ }
112
+ /**
113
+ * Top-level processing namespace exposed as `tagada.processing`. For a direct
114
+ * merchant managing their own TPAs. Requires a key with processing access on
115
+ * the merchant (a partner key, or a merchant whose account has processing).
116
+ */
117
+ export class Processing {
118
+ constructor(client) {
119
+ // Direct surface — no `/partner` prefix.
120
+ this.tpas = new ProcessingTpas(client, '');
121
+ }
122
+ }
123
+ //# sourceMappingURL=Processing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Processing.js","sourceRoot":"","sources":["../../src/resources/Processing.ts"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AAEH,2DAA2D;AAC3D,MAAM,OAAO,cAAc;IACzB,YACmB,MAAkB,EAClB,MAAc;QADd,WAAM,GAAN,MAAM,CAAY;QAClB,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ;;;OAGG;IACH,KAAK,CAAC,MAAM,CACV,KAAa,EACb,MAAkC,EAClC,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAC/B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,OAAO,EACnC,MAAM,IAAI,EAAE,EACZ,IAAI,CACL,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,IAAqB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAC9B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,OAAO,EACnC,SAAS,EACT,IAAI,CACL,CAAC;IACJ,CAAC;IAED,+EAA+E;IAC/E,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,IAAqB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAC9B,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,EAAE,EAC9B,SAAS,E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,CAAC,KAAa,EAAE,OAAe,EAAE,IAAqB;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAM,GAAG,IAAI,CAAC,MAAM,SAAS,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7F,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,UAAU;IAGrB,YAAY,MAAkB;QAC5B,yCAAyC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ import type { RequestOptions } from '../types/common.js';
2
+ import type { TaxExemption, TaxExemptionCreateParams, TaxExemptionListParams, TaxExemptionListResult, TaxExemptionDeleteParams } from '../types/taxExemptions.js';
3
+ import { BaseResource } from './BaseResource.js';
4
+ export declare class TaxExemptions extends BaseResource {
5
+ /**
6
+ * Bulk-create tax exemptions for a store.
7
+ *
8
+ * Customers whose email matches an exemption are excluded from tax
9
+ * calculations at checkout.
10
+ */
11
+ create(params: TaxExemptionCreateParams, opts?: RequestOptions): Promise<TaxExemption[]>;
12
+ /**
13
+ * List tax exemptions for a store with pagination.
14
+ */
15
+ list(params: TaxExemptionListParams, opts?: RequestOptions): Promise<TaxExemptionListResult>;
16
+ /**
17
+ * Delete one or more tax exemptions by ID.
18
+ */
19
+ del(params: TaxExemptionDeleteParams, opts?: RequestOptions): Promise<{
20
+ success: boolean;
21
+ }>;
22
+ }
23
+ //# sourceMappingURL=TaxExemptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaxExemptions.d.ts","sourceRoot":"","sources":["../../src/resources/TaxExemptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACG,MAAM,CACV,MAAM,EAAE,wBAAwB,EAChC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC;IAI1B;;OAEG;IACG,IAAI,CACR,MAAM,EAAE,sBAAsB,EAC9B,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;OAEG;IACG,GAAG,CACP,MAAM,EAAE,wBAAwB,EAChC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAGjC"}
@@ -0,0 +1,25 @@
1
+ import { BaseResource } from './BaseResource.js';
2
+ export class TaxExemptions extends BaseResource {
3
+ /**
4
+ * Bulk-create tax exemptions for a store.
5
+ *
6
+ * Customers whose email matches an exemption are excluded from tax
7
+ * calculations at checkout.
8
+ */
9
+ async create(params, opts) {
10
+ return this._post('/tax-exemptions', params, opts);
11
+ }
12
+ /**
13
+ * List tax exemptions for a store with pagination.
14
+ */
15
+ async list(params, opts) {
16
+ return this._get('/tax-exemptions', params, opts);
17
+ }
18
+ /**
19
+ * Delete one or more tax exemptions by ID.
20
+ */
21
+ async del(params, opts) {
22
+ return this._del('/tax-exemptions', params, opts);
23
+ }
24
+ }
25
+ //# sourceMappingURL=TaxExemptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaxExemptions.js","sourceRoot":"","sources":["../../src/resources/TaxExemptions.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,MAAgC,EAChC,IAAqB;QAErB,OAAO,IAAI,CAAC,KAAK,CAAiB,iBAAiB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,MAA8B,EAC9B,IAAqB;QAErB,OAAO,IAAI,CAAC,IAAI,CAAyB,iBAAiB,EAAE,MAA4C,EAAE,IAAI,CAAC,CAAC;IAClH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,MAAgC,EAChC,IAAqB;QAErB,OAAO,IAAI,CAAC,IAAI,CAAuB,iBAAiB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -20,4 +20,5 @@ export { Offers } from './Offers.js';
20
20
  export { CheckoutOffers } from './CheckoutOffers.js';
21
21
  export { EmailTemplates } from './EmailTemplates.js';
22
22
  export { ShippingRates } from './ShippingRates.js';
23
+ export { TaxExemptions } from './TaxExemptions.js';
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAA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,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -20,4 +20,5 @@ export { Offers } from './Offers.js';
20
20
  export { CheckoutOffers } from './CheckoutOffers.js';
21
21
  export { EmailTemplates } from './EmailTemplates.js';
22
22
  export { ShippingRates } from './ShippingRates.js';
23
+ export { TaxExemptions } from './TaxExemptions.js';
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE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,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -21,4 +21,5 @@ export * from './emailTemplates.js';
21
21
  export * from './partners.js';
22
22
  export * from './paymentSetup.js';
23
23
  export * from './threeds.js';
24
+ export * from './taxExemptions.js';
24
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
@@ -21,4 +21,5 @@ export * from './emailTemplates.js';
21
21
  export * from './partners.js';
22
22
  export * from './paymentSetup.js';
23
23
  export * from './threeds.js';
24
+ export * from './taxExemptions.js';
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe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