@fiatden/openpay 0.0.0-stage → 0.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 (119) hide show
  1. package/README.md +309 -2
  2. package/dist/analytics.test.d.ts +2 -0
  3. package/dist/analytics.test.d.ts.map +1 -0
  4. package/dist/analytics.test.js +184 -0
  5. package/dist/apps.test.d.ts +2 -0
  6. package/dist/apps.test.d.ts.map +1 -0
  7. package/dist/apps.test.js +92 -0
  8. package/dist/http.d.ts +22 -0
  9. package/dist/http.d.ts.map +1 -0
  10. package/dist/http.js +56 -0
  11. package/dist/http.test.d.ts +2 -0
  12. package/dist/http.test.d.ts.map +1 -0
  13. package/dist/http.test.js +47 -0
  14. package/dist/index.d.ts +157 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +207 -0
  17. package/dist/index.test.d.ts +2 -0
  18. package/dist/index.test.d.ts.map +1 -0
  19. package/dist/index.test.js +55 -0
  20. package/dist/resources/analytics.d.ts +220 -0
  21. package/dist/resources/analytics.d.ts.map +1 -0
  22. package/dist/resources/analytics.js +70 -0
  23. package/dist/resources/apiKeys.d.ts +22 -0
  24. package/dist/resources/apiKeys.d.ts.map +1 -0
  25. package/dist/resources/apiKeys.js +40 -0
  26. package/dist/resources/apps.d.ts +142 -0
  27. package/dist/resources/apps.d.ts.map +1 -0
  28. package/dist/resources/apps.js +49 -0
  29. package/dist/resources/auth.d.ts +71 -0
  30. package/dist/resources/auth.d.ts.map +1 -0
  31. package/dist/resources/auth.js +71 -0
  32. package/dist/resources/billing.d.ts +148 -0
  33. package/dist/resources/billing.d.ts.map +1 -0
  34. package/dist/resources/billing.js +55 -0
  35. package/dist/resources/charges.d.ts +67 -0
  36. package/dist/resources/charges.d.ts.map +1 -0
  37. package/dist/resources/charges.js +103 -0
  38. package/dist/resources/checkout.d.ts +80 -0
  39. package/dist/resources/checkout.d.ts.map +1 -0
  40. package/dist/resources/checkout.js +36 -0
  41. package/dist/resources/coupons.d.ts +66 -0
  42. package/dist/resources/coupons.d.ts.map +1 -0
  43. package/dist/resources/coupons.js +39 -0
  44. package/dist/resources/currencies.d.ts +45 -0
  45. package/dist/resources/currencies.d.ts.map +1 -0
  46. package/dist/resources/currencies.js +48 -0
  47. package/dist/resources/currencyPortfolio.d.ts +62 -0
  48. package/dist/resources/currencyPortfolio.d.ts.map +1 -0
  49. package/dist/resources/currencyPortfolio.js +34 -0
  50. package/dist/resources/customers.d.ts +171 -0
  51. package/dist/resources/customers.d.ts.map +1 -0
  52. package/dist/resources/customers.js +72 -0
  53. package/dist/resources/disputes.d.ts +48 -0
  54. package/dist/resources/disputes.d.ts.map +1 -0
  55. package/dist/resources/disputes.js +47 -0
  56. package/dist/resources/emailTemplates.d.ts +55 -0
  57. package/dist/resources/emailTemplates.d.ts.map +1 -0
  58. package/dist/resources/emailTemplates.js +49 -0
  59. package/dist/resources/financialAccounts.d.ts +49 -0
  60. package/dist/resources/financialAccounts.d.ts.map +1 -0
  61. package/dist/resources/financialAccounts.js +22 -0
  62. package/dist/resources/fx.d.ts +34 -0
  63. package/dist/resources/fx.d.ts.map +1 -0
  64. package/dist/resources/fx.js +27 -0
  65. package/dist/resources/invoices.d.ts +32 -0
  66. package/dist/resources/invoices.d.ts.map +1 -0
  67. package/dist/resources/invoices.js +36 -0
  68. package/dist/resources/merchants.d.ts +95 -0
  69. package/dist/resources/merchants.d.ts.map +1 -0
  70. package/dist/resources/merchants.js +113 -0
  71. package/dist/resources/metering.d.ts +65 -0
  72. package/dist/resources/metering.d.ts.map +1 -0
  73. package/dist/resources/metering.js +36 -0
  74. package/dist/resources/paymentLinks.d.ts +45 -0
  75. package/dist/resources/paymentLinks.d.ts.map +1 -0
  76. package/dist/resources/paymentLinks.js +32 -0
  77. package/dist/resources/paymentMethods.d.ts +34 -0
  78. package/dist/resources/paymentMethods.d.ts.map +1 -0
  79. package/dist/resources/paymentMethods.js +17 -0
  80. package/dist/resources/payouts.d.ts +51 -0
  81. package/dist/resources/payouts.d.ts.map +1 -0
  82. package/dist/resources/payouts.js +62 -0
  83. package/dist/resources/platform.d.ts +72 -0
  84. package/dist/resources/platform.d.ts.map +1 -0
  85. package/dist/resources/platform.js +42 -0
  86. package/dist/resources/providers.d.ts +61 -0
  87. package/dist/resources/providers.d.ts.map +1 -0
  88. package/dist/resources/providers.js +42 -0
  89. package/dist/resources/reconciliation.d.ts +125 -0
  90. package/dist/resources/reconciliation.d.ts.map +1 -0
  91. package/dist/resources/reconciliation.js +55 -0
  92. package/dist/resources/referrals.d.ts +25 -0
  93. package/dist/resources/referrals.d.ts.map +1 -0
  94. package/dist/resources/referrals.js +16 -0
  95. package/dist/resources/riskReview.d.ts +96 -0
  96. package/dist/resources/riskReview.d.ts.map +1 -0
  97. package/dist/resources/riskReview.js +44 -0
  98. package/dist/resources/roles.d.ts +59 -0
  99. package/dist/resources/roles.d.ts.map +1 -0
  100. package/dist/resources/roles.js +42 -0
  101. package/dist/resources/status.d.ts +20 -0
  102. package/dist/resources/status.d.ts.map +1 -0
  103. package/dist/resources/status.js +14 -0
  104. package/dist/resources/subscriptions.d.ts +46 -0
  105. package/dist/resources/subscriptions.d.ts.map +1 -0
  106. package/dist/resources/subscriptions.js +69 -0
  107. package/dist/resources/totp.d.ts +36 -0
  108. package/dist/resources/totp.d.ts.map +1 -0
  109. package/dist/resources/totp.js +41 -0
  110. package/dist/resources/wallets.d.ts +128 -0
  111. package/dist/resources/wallets.d.ts.map +1 -0
  112. package/dist/resources/wallets.js +74 -0
  113. package/dist/resources/webhooks.d.ts +47 -0
  114. package/dist/resources/webhooks.d.ts.map +1 -0
  115. package/dist/resources/webhooks.js +41 -0
  116. package/dist/types.d.ts +484 -0
  117. package/dist/types.d.ts.map +1 -0
  118. package/dist/types.js +15 -0
  119. package/package.json +46 -4
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailTemplatesResource = void 0;
4
+ class EmailTemplatesResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ /** List all email templates for the authenticated merchant. */
10
+ async list(params) {
11
+ return this.client.request('/v1/email-templates', { params });
12
+ }
13
+ /** Get a single email template by ID. */
14
+ async get(id) {
15
+ return this.client.request(`/v1/email-templates/${id}`);
16
+ }
17
+ /** Create a new email template. */
18
+ async create(params) {
19
+ return this.client.request('/v1/email-templates', {
20
+ method: 'POST',
21
+ body: params,
22
+ });
23
+ }
24
+ /** Update an existing email template. */
25
+ async update(id, params) {
26
+ return this.client.request(`/v1/email-templates/${id}`, {
27
+ method: 'PATCH',
28
+ body: params,
29
+ });
30
+ }
31
+ /** Soft-delete (deactivate) an email template. */
32
+ async delete(id) {
33
+ return this.client.request(`/v1/email-templates/${id}`, { method: 'DELETE' });
34
+ }
35
+ /** Preview a template rendered with sample data (returns HTML). */
36
+ async preview(id) {
37
+ const response = await fetch(`${this.client.baseUrl}/v1/email-templates/preview/${encodeURIComponent(id)}`, {
38
+ headers: {
39
+ Accept: 'text/html',
40
+ 'x-api-key': this.client.apiKey,
41
+ },
42
+ });
43
+ if (!response.ok) {
44
+ throw new Error(`Template preview failed: ${response.status}`);
45
+ }
46
+ return response.text();
47
+ }
48
+ }
49
+ exports.EmailTemplatesResource = EmailTemplatesResource;
@@ -0,0 +1,49 @@
1
+ import { HttpClient } from '../http';
2
+ export interface FinancialAccount {
3
+ id: string;
4
+ merchant_id: string;
5
+ app_id: string;
6
+ currency: string;
7
+ status: 'active' | 'restricted' | 'closed';
8
+ /** Σ active wallet balances in the workspace (minor units). */
9
+ balance: number;
10
+ paid_credits: number;
11
+ granted_credits: number;
12
+ wallet_count: number;
13
+ metadata: Record<string, unknown>;
14
+ created_at: string;
15
+ updated_at: string;
16
+ }
17
+ export interface FinancialAccountStatementEntry {
18
+ id: string;
19
+ wallet_id: string;
20
+ app_id: string;
21
+ customer_id: string;
22
+ source_type: 'api_credit' | 'checkout_topup' | 'usage_deduction' | 'adjustment' | 'refund' | 'expiration';
23
+ entry_type: 'credit' | 'debit';
24
+ amount: number;
25
+ balance_after: number;
26
+ credit_type: 'paid' | 'granted' | null;
27
+ description: string;
28
+ created_at: string;
29
+ }
30
+ export declare class FinancialAccountsResource {
31
+ private client;
32
+ constructor(client: HttpClient);
33
+ /** List every workspace financial account + derived balances. */
34
+ list(): Promise<{
35
+ data: FinancialAccount[];
36
+ }>;
37
+ /** Fetch (auto-provisioning) one workspace's financial account. */
38
+ get(appId: string): Promise<FinancialAccount>;
39
+ /** Workspace-wide ledger across every wallet (financial-account statement). */
40
+ statement(appId: string, params?: {
41
+ limit?: number;
42
+ offset?: number;
43
+ }): Promise<{
44
+ account: FinancialAccount;
45
+ data: FinancialAccountStatementEntry[];
46
+ has_more: boolean;
47
+ }>;
48
+ }
49
+ //# sourceMappingURL=financialAccounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financialAccounts.d.ts","sourceRoot":"","sources":["../../src/resources/financialAccounts.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC3C,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,8BAA8B;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAC;IAC1G,UAAU,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,yBAAyB;IACxB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC,iEAAiE;IAC3D,IAAI,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAC;IAInD,mEAAmE;IAC7D,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAInD,+EAA+E;IACzE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QACpF,OAAO,EAAE,gBAAgB,CAAC;QAC1B,IAAI,EAAE,8BAA8B,EAAE,CAAC;QACvC,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;CAGH"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FinancialAccountsResource = void 0;
4
+ class FinancialAccountsResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ /** List every workspace financial account + derived balances. */
10
+ async list() {
11
+ return this.client.request('/v1/financial-accounts');
12
+ }
13
+ /** Fetch (auto-provisioning) one workspace's financial account. */
14
+ async get(appId) {
15
+ return this.client.request(`/v1/financial-accounts/${encodeURIComponent(appId)}`);
16
+ }
17
+ /** Workspace-wide ledger across every wallet (financial-account statement). */
18
+ async statement(appId, params) {
19
+ return this.client.request(`/v1/financial-accounts/${encodeURIComponent(appId)}/statement`, { params });
20
+ }
21
+ }
22
+ exports.FinancialAccountsResource = FinancialAccountsResource;
@@ -0,0 +1,34 @@
1
+ import { HttpClient } from '../http';
2
+ export interface FxRate {
3
+ base: string;
4
+ target: string;
5
+ rate: number;
6
+ source: string;
7
+ spread: number;
8
+ scope: 'platform' | 'merchant';
9
+ /** Null for platform rates; merchant UUID for per-merchant overrides. */
10
+ merchant_id: string | null;
11
+ }
12
+ export interface SetFxRateParams {
13
+ base_currency: string;
14
+ target_currency: string;
15
+ rate: number;
16
+ source?: string;
17
+ expires_at?: string | null;
18
+ }
19
+ /**
20
+ * Currency exchange rates. GET returns ALL active rates (platform
21
+ * + per-merchant overrides) when the calling API key belongs to a
22
+ * merchant. POST creates a per-merchant override for the calling
23
+ * merchant when the key is merchant-scoped, or a platform-wide
24
+ * rate when the key is admin-scoped.
25
+ */
26
+ export declare class FxResource {
27
+ private client;
28
+ constructor(client: HttpClient);
29
+ list(): Promise<{
30
+ data: FxRate[];
31
+ }>;
32
+ set(params: SetFxRateParams): Promise<FxRate>;
33
+ }
34
+ //# sourceMappingURL=fx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fx.d.ts","sourceRoot":"","sources":["../../src/resources/fx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B,yEAAyE;IACzE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAID;;;;;;GAMG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,IAAI,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAInC,GAAG,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAMpD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FxResource = void 0;
4
+ // ── Resource ───────────────────────────────────────────────────────
5
+ /**
6
+ * Currency exchange rates. GET returns ALL active rates (platform
7
+ * + per-merchant overrides) when the calling API key belongs to a
8
+ * merchant. POST creates a per-merchant override for the calling
9
+ * merchant when the key is merchant-scoped, or a platform-wide
10
+ * rate when the key is admin-scoped.
11
+ */
12
+ class FxResource {
13
+ client;
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ async list() {
18
+ return this.client.request('/v1/analytics/fx-rates');
19
+ }
20
+ async set(params) {
21
+ return this.client.request('/v1/analytics/fx-rates', {
22
+ method: 'POST',
23
+ body: params,
24
+ });
25
+ }
26
+ }
27
+ exports.FxResource = FxResource;
@@ -0,0 +1,32 @@
1
+ import { HttpClient } from '../http';
2
+ import { Invoice, InvoiceLineItem, ListResponse } from '../types';
3
+ export interface InvoiceCreateParams {
4
+ customer_id?: string | null;
5
+ currency?: string;
6
+ net_days?: number;
7
+ line_items: InvoiceLineItem[];
8
+ notes?: string | null;
9
+ metadata?: Record<string, unknown>;
10
+ app_id?: string | null;
11
+ status?: 'draft' | 'open';
12
+ }
13
+ export declare class InvoicesResource {
14
+ private client;
15
+ constructor(client: HttpClient);
16
+ /** Issue an invoice with net payment terms. */
17
+ create(params: InvoiceCreateParams): Promise<Invoice>;
18
+ /** List invoices, optionally filtered by status or customer. */
19
+ list(params?: {
20
+ status?: string;
21
+ customer_id?: string;
22
+ limit?: number;
23
+ offset?: number;
24
+ }): Promise<ListResponse<Invoice>>;
25
+ /** Retrieve an invoice by id. */
26
+ retrieve(id: string): Promise<Invoice>;
27
+ /** Mark an invoice paid (optionally partially, in minor units). */
28
+ markPaid(id: string, amount?: number): Promise<Invoice>;
29
+ /** Void an unpaid invoice. */
30
+ void(id: string, reason?: string): Promise<Invoice>;
31
+ }
32
+ //# sourceMappingURL=invoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../src/resources/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC3B;AAED,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC,+CAA+C;IACzC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3D,gEAAgE;IAC1D,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAI/H,iCAAiC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI5C,mEAAmE;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO7D,8BAA8B;IACxB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAM1D"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoicesResource = void 0;
4
+ class InvoicesResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ /** Issue an invoice with net payment terms. */
10
+ async create(params) {
11
+ return this.client.request('/v1/invoices', { method: 'POST', body: params });
12
+ }
13
+ /** List invoices, optionally filtered by status or customer. */
14
+ async list(params) {
15
+ return this.client.request('/v1/invoices', { params });
16
+ }
17
+ /** Retrieve an invoice by id. */
18
+ async retrieve(id) {
19
+ return this.client.request(`/v1/invoices/${id}`);
20
+ }
21
+ /** Mark an invoice paid (optionally partially, in minor units). */
22
+ async markPaid(id, amount) {
23
+ return this.client.request(`/v1/invoices/${id}/paid`, {
24
+ method: 'POST',
25
+ body: amount !== undefined ? { amount } : {},
26
+ });
27
+ }
28
+ /** Void an unpaid invoice. */
29
+ async void(id, reason) {
30
+ return this.client.request(`/v1/invoices/${id}/void`, {
31
+ method: 'POST',
32
+ body: reason ? { reason } : {},
33
+ });
34
+ }
35
+ }
36
+ exports.InvoicesResource = InvoicesResource;
@@ -0,0 +1,95 @@
1
+ import { HttpClient } from '../http';
2
+ import { MerchantCreateParams, Merchant, MerchantBalance, KYCUpdateParams, ListResponse, PayoutPolicy, AutoPayoutSchedule } from '../types';
3
+ export declare class MerchantsResource {
4
+ private client;
5
+ constructor(client: HttpClient);
6
+ /** Register a new merchant. A wallet is auto-created. */
7
+ create(params: MerchantCreateParams): Promise<Merchant>;
8
+ /** Retrieve a merchant by ID. */
9
+ retrieve(id: string): Promise<Merchant>;
10
+ /** List all merchants. */
11
+ list(): Promise<ListResponse<Merchant>>;
12
+ /** Get merchant wallet balance. */
13
+ balance(id: string): Promise<MerchantBalance>;
14
+ /** Update merchant KYC / settlement bank details. */
15
+ updateKYC(id: string, params: KYCUpdateParams): Promise<Merchant>;
16
+ /** Upload structured KYC documents and move the merchant into review. */
17
+ updateKYCDocuments(id: string, documents: Record<string, unknown>): Promise<{
18
+ id: string;
19
+ kyc_status: string;
20
+ kyc_documents: Record<string, unknown>;
21
+ }>;
22
+ /** Create or refresh a provider subaccount for the merchant. */
23
+ createSubaccount(id: string, provider: 'paystack' | 'flutterwave' | 'korapay' | 'hyperswitch'): Promise<{
24
+ merchant_id: string;
25
+ provider: string;
26
+ subaccount_code: string;
27
+ }>;
28
+ /** Fetch the merchant's effective payout governance policy (minimum + approval). */
29
+ getPayoutPolicy(id: string): Promise<PayoutPolicy & {
30
+ effective_minimum: number;
31
+ effective_approval_threshold: number;
32
+ }>;
33
+ /** Fetch the merchant's auto-payout schedule (null when none is configured). */
34
+ getAutoPayoutSchedule(id: string): Promise<{
35
+ merchant_id: string;
36
+ schedule: AutoPayoutSchedule | null;
37
+ }>;
38
+ /** Create or update the merchant's auto-payout schedule. */
39
+ updateAutoPayoutSchedule(id: string, params: {
40
+ enabled?: boolean;
41
+ minimum_amount?: number | null;
42
+ run_hour?: number | null;
43
+ }): Promise<{
44
+ merchant_id: string;
45
+ schedule: AutoPayoutSchedule;
46
+ }>;
47
+ /** Disable the merchant's auto-payout schedule. */
48
+ disableAutoPayoutSchedule(id: string): Promise<{
49
+ merchant_id: string;
50
+ schedule: AutoPayoutSchedule;
51
+ disabled: boolean;
52
+ }>;
53
+ /** 8.4 marketplace: onboard a child merchant under this parent. */
54
+ createChild(id: string, params: {
55
+ business_name: string;
56
+ email: string;
57
+ phone?: string;
58
+ country?: string;
59
+ parent_commission_bps?: number;
60
+ }): Promise<Merchant>;
61
+ /** List this parent's immediate child merchants. */
62
+ listChildren(id: string): Promise<{
63
+ data: Merchant[];
64
+ }>;
65
+ /** List the whole descendant subtree (children, grandchildren, ...). */
66
+ listDescendants(id: string): Promise<{
67
+ data: Merchant[];
68
+ }>;
69
+ /** Update a child merchant's marketplace commission (basis points). */
70
+ updateChildCommission(id: string, childId: string, parentCommissionBps: number): Promise<Merchant>;
71
+ /** Detach a child merchant from this parent. */
72
+ detachChild(id: string, childId: string): Promise<{
73
+ id: string;
74
+ detached: boolean;
75
+ }>;
76
+ /** Update a merchant's lifecycle status (admin/operator). */
77
+ updateStatus(id: string, params: {
78
+ status: string;
79
+ reason?: string;
80
+ }): Promise<Merchant>;
81
+ /** Fetch a merchant's resolved branding. */
82
+ getBranding(id: string): Promise<Record<string, unknown>>;
83
+ /** Update a merchant's branding overrides. */
84
+ updateBranding(id: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
85
+ /** List a merchant's transactions (admin/operator view). */
86
+ listTransactions(id: string, params?: {
87
+ limit?: number;
88
+ offset?: number;
89
+ status?: string;
90
+ }): Promise<{
91
+ data: Array<Record<string, unknown>>;
92
+ has_more: boolean;
93
+ }>;
94
+ }
95
+ //# sourceMappingURL=merchants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merchants.d.ts","sourceRoot":"","sources":["../../src/resources/merchants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,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,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOxG,gDAAgD;IAC1C,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAI1F,6DAA6D;IACvD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI9F,4CAA4C;IACtC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI/D,8CAA8C;IACxC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAIjG,4DAA4D;IACtD,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;CAGxK"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MerchantsResource = void 0;
4
+ class MerchantsResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ /** Register a new merchant. A wallet is auto-created. */
10
+ async create(params) {
11
+ return this.client.request('/v1/merchants', {
12
+ method: 'POST',
13
+ body: params,
14
+ });
15
+ }
16
+ /** Retrieve a merchant by ID. */
17
+ async retrieve(id) {
18
+ return this.client.request(`/v1/merchants/${id}`);
19
+ }
20
+ /** List all merchants. */
21
+ async list() {
22
+ return this.client.request('/v1/merchants');
23
+ }
24
+ /** Get merchant wallet balance. */
25
+ async balance(id) {
26
+ return this.client.request(`/v1/merchants/${id}/balance`);
27
+ }
28
+ /** Update merchant KYC / settlement bank details. */
29
+ async updateKYC(id, params) {
30
+ return this.client.request(`/v1/merchants/${id}/kyc`, {
31
+ method: 'PATCH',
32
+ body: params,
33
+ });
34
+ }
35
+ /** Upload structured KYC documents and move the merchant into review. */
36
+ async updateKYCDocuments(id, documents) {
37
+ return this.client.request(`/v1/merchants/${id}/kyc-documents`, {
38
+ method: 'PATCH',
39
+ body: { documents },
40
+ });
41
+ }
42
+ /** Create or refresh a provider subaccount for the merchant. */
43
+ async createSubaccount(id, provider) {
44
+ return this.client.request(`/v1/merchants/${id}/subaccount`, {
45
+ method: 'POST',
46
+ body: { provider },
47
+ });
48
+ }
49
+ /** Fetch the merchant's effective payout governance policy (minimum + approval). */
50
+ async getPayoutPolicy(id) {
51
+ return this.client.request(`/v1/merchants/${id}/payout-policy`);
52
+ }
53
+ /** Fetch the merchant's auto-payout schedule (null when none is configured). */
54
+ async getAutoPayoutSchedule(id) {
55
+ return this.client.request(`/v1/merchants/${id}/auto-payout-schedule`);
56
+ }
57
+ /** Create or update the merchant's auto-payout schedule. */
58
+ async updateAutoPayoutSchedule(id, params) {
59
+ return this.client.request(`/v1/merchants/${id}/auto-payout-schedule`, {
60
+ method: 'PUT',
61
+ body: params,
62
+ });
63
+ }
64
+ /** Disable the merchant's auto-payout schedule. */
65
+ async disableAutoPayoutSchedule(id) {
66
+ return this.client.request(`/v1/merchants/${id}/auto-payout-schedule`, {
67
+ method: 'DELETE',
68
+ });
69
+ }
70
+ /** 8.4 marketplace: onboard a child merchant under this parent. */
71
+ async createChild(id, params) {
72
+ return this.client.request(`/v1/merchants/${id}/children`, {
73
+ method: 'POST',
74
+ body: params,
75
+ });
76
+ }
77
+ /** List this parent's immediate child merchants. */
78
+ async listChildren(id) {
79
+ return this.client.request(`/v1/merchants/${id}/children`);
80
+ }
81
+ /** List the whole descendant subtree (children, grandchildren, ...). */
82
+ async listDescendants(id) {
83
+ return this.client.request(`/v1/merchants/${id}/descendants`);
84
+ }
85
+ /** Update a child merchant's marketplace commission (basis points). */
86
+ async updateChildCommission(id, childId, parentCommissionBps) {
87
+ return this.client.request(`/v1/merchants/${id}/children/${childId}`, {
88
+ method: 'PATCH',
89
+ body: { parent_commission_bps: parentCommissionBps },
90
+ });
91
+ }
92
+ /** Detach a child merchant from this parent. */
93
+ async detachChild(id, childId) {
94
+ return this.client.request(`/v1/merchants/${id}/children/${childId}`, { method: 'DELETE' });
95
+ }
96
+ /** Update a merchant's lifecycle status (admin/operator). */
97
+ async updateStatus(id, params) {
98
+ return this.client.request(`/v1/merchants/${id}/status`, { method: 'PATCH', body: params });
99
+ }
100
+ /** Fetch a merchant's resolved branding. */
101
+ async getBranding(id) {
102
+ return this.client.request(`/v1/merchants/${id}/branding`);
103
+ }
104
+ /** Update a merchant's branding overrides. */
105
+ async updateBranding(id, body) {
106
+ return this.client.request(`/v1/merchants/${id}/branding`, { method: 'PATCH', body });
107
+ }
108
+ /** List a merchant's transactions (admin/operator view). */
109
+ async listTransactions(id, params) {
110
+ return this.client.request(`/v1/merchants/${id}/transactions`, { params });
111
+ }
112
+ }
113
+ exports.MerchantsResource = MerchantsResource;
@@ -0,0 +1,65 @@
1
+ import { HttpClient } from '../http';
2
+ export interface UsageRecord {
3
+ metric_name: string;
4
+ current_count: number;
5
+ window: string;
6
+ }
7
+ export interface UsageReport {
8
+ metric_name: string;
9
+ period: string;
10
+ period_start: string;
11
+ period_end: string;
12
+ usage: {
13
+ realtime: number;
14
+ persisted: number;
15
+ total: number;
16
+ };
17
+ meter?: {
18
+ name: string;
19
+ price_per_unit: number;
20
+ aggregation_window: string;
21
+ };
22
+ estimated_cost: number;
23
+ }
24
+ export interface MeterCreateParams {
25
+ name: string;
26
+ metric_name: string;
27
+ metric_label?: string;
28
+ aggregation_window?: 'minute' | 'hour' | 'day' | 'month';
29
+ price_per_unit?: number;
30
+ }
31
+ export interface Meter {
32
+ id: string;
33
+ merchant_id: string;
34
+ name: string;
35
+ metric_name: string;
36
+ metric_label?: string;
37
+ aggregation_window: string;
38
+ price_per_unit: number;
39
+ is_active: boolean;
40
+ created_at: string;
41
+ }
42
+ export declare class MeteringResource {
43
+ private client;
44
+ constructor(client: HttpClient);
45
+ record(metric_name: string, count?: number, subscription_id?: string, customer_id?: string): Promise<UsageRecord>;
46
+ report(metric_name: string, period?: 'hour' | 'day' | 'week' | 'month'): Promise<UsageReport>;
47
+ history(params?: {
48
+ metric_name?: string;
49
+ subscription_id?: string;
50
+ days?: number;
51
+ }): Promise<{
52
+ data: any[];
53
+ has_more: boolean;
54
+ }>;
55
+ createMeter(params: MeterCreateParams): Promise<Meter>;
56
+ listMeters(): Promise<{
57
+ data: Meter[];
58
+ has_more: boolean;
59
+ }>;
60
+ deactivateMeter(id: string): Promise<{
61
+ deleted: boolean;
62
+ meter: Meter;
63
+ }>;
64
+ }
65
+ //# sourceMappingURL=metering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metering.d.ts","sourceRoot":"","sources":["../../src/resources/metering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QACL,QAAQ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AC,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAIhI,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAOtD,UAAU,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAI3D,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;CAG/E"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MeteringResource = void 0;
4
+ class MeteringResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ async record(metric_name, count, subscription_id, customer_id) {
10
+ return this.client.request('/v1/usage/record', {
11
+ method: 'POST',
12
+ body: { metric_name, count: count || 1, subscription_id, customer_id },
13
+ });
14
+ }
15
+ async report(metric_name, period) {
16
+ return this.client.request('/v1/usage/report', {
17
+ params: { metric_name, period: period || 'day' },
18
+ });
19
+ }
20
+ async history(params) {
21
+ return this.client.request('/v1/usage/history', { params });
22
+ }
23
+ async createMeter(params) {
24
+ return this.client.request('/v1/meters', {
25
+ method: 'POST',
26
+ body: params,
27
+ });
28
+ }
29
+ async listMeters() {
30
+ return this.client.request('/v1/meters');
31
+ }
32
+ async deactivateMeter(id) {
33
+ return this.client.request(`/v1/meters/${id}`, { method: 'DELETE' });
34
+ }
35
+ }
36
+ exports.MeteringResource = MeteringResource;
@@ -0,0 +1,45 @@
1
+ import { HttpClient } from '../http';
2
+ import { Currency, ListResponse } from '../types';
3
+ export interface PaymentLinkCreateParams {
4
+ amount: number;
5
+ currency?: Currency;
6
+ description?: string;
7
+ success_url?: string;
8
+ cancel_url?: string;
9
+ max_payments?: number;
10
+ /** Optional key forwarded as the Idempotency-Key header. */
11
+ idempotency_key?: string;
12
+ }
13
+ export interface PaymentLink {
14
+ id: string;
15
+ merchant_id: string;
16
+ code: string;
17
+ amount: number;
18
+ currency: Currency;
19
+ description?: string;
20
+ success_url?: string;
21
+ cancel_url?: string;
22
+ is_active: boolean;
23
+ max_payments?: number;
24
+ payment_count: number;
25
+ total_collected: number;
26
+ payment_url: string;
27
+ created_at: string;
28
+ updated_at: string;
29
+ }
30
+ export declare class PaymentLinksResource {
31
+ private client;
32
+ constructor(client: HttpClient);
33
+ /** Create a shareable payment link. Returns a payment_url customers can visit. */
34
+ create(params: PaymentLinkCreateParams): Promise<PaymentLink>;
35
+ /** List payment links (optionally filtered by active status). */
36
+ list(params?: {
37
+ is_active?: boolean;
38
+ limit?: number;
39
+ }): Promise<ListResponse<PaymentLink>>;
40
+ /** Get a single payment link by code. */
41
+ get(code: string): Promise<PaymentLink>;
42
+ /** Deactivate a payment link so it stops accepting payments. */
43
+ deactivate(code: string): Promise<PaymentLink>;
44
+ }
45
+ //# sourceMappingURL=paymentLinks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentLinks.d.ts","sourceRoot":"","sources":["../../src/resources/paymentLinks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,eAAe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