@naturalpay/sdk 1.6.18 → 1.6.19

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 (112) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/events/client/Client.js +4 -4
  3. package/dist/cjs/api/resources/events/client/requests/GetEventsRequest.d.ts +1 -1
  4. package/dist/cjs/api/resources/events/client/requests/ListEventsRequest.d.ts +1 -1
  5. package/dist/cjs/api/resources/events/types/ListEventsRequestEventType.d.ts +1 -1
  6. package/dist/cjs/api/resources/events/types/ListEventsRequestEventType.js +1 -1
  7. package/dist/cjs/api/resources/externalAccounts/client/Client.d.ts +1 -1
  8. package/dist/cjs/api/resources/externalAccounts/client/Client.js +1 -1
  9. package/dist/cjs/api/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.d.ts +2 -2
  10. package/dist/cjs/api/resources/paymentRequests/client/Client.d.ts +2 -1
  11. package/dist/cjs/api/resources/paymentRequests/client/Client.js +15 -8
  12. package/dist/cjs/api/resources/paymentRequests/client/requests/CancelPaymentRequestsRequest.d.ts +4 -1
  13. package/dist/cjs/api/resources/paymentRequests/client/requests/GetPaymentRequestsRequest.d.ts +1 -1
  14. package/dist/cjs/api/resources/paymentRequests/client/requests/ListIncomingPaymentRequestsRequest.d.ts +1 -1
  15. package/dist/cjs/api/resources/paymentRequests/client/requests/ListPaymentRequestsRequest.d.ts +1 -1
  16. package/dist/cjs/api/resources/paymentRequests/client/requests/NewFulfilledReqParams.d.ts +2 -0
  17. package/dist/cjs/api/resources/payments/client/Client.d.ts +2 -1
  18. package/dist/cjs/api/resources/payments/client/Client.js +13 -6
  19. package/dist/cjs/api/resources/payments/client/requests/CancelPaymentsRequest.d.ts +4 -1
  20. package/dist/cjs/api/resources/payments/client/requests/GetPaymentsRequest.d.ts +1 -1
  21. package/dist/cjs/api/resources/payments/client/requests/ListPaymentsRequest.d.ts +1 -1
  22. package/dist/cjs/api/resources/transactions/client/Client.js +2 -2
  23. package/dist/cjs/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +1 -1
  24. package/dist/cjs/api/resources/transfers/client/Client.js +4 -4
  25. package/dist/cjs/api/resources/transfers/client/requests/GetTransfersRequest.d.ts +1 -1
  26. package/dist/cjs/api/resources/transfers/client/requests/InitiateInternalTransfersRequest.d.ts +1 -1
  27. package/dist/cjs/api/resources/transfers/client/requests/ListTransfersRequest.d.ts +1 -1
  28. package/dist/cjs/api/resources/transfers/client/requests/NewDepositParams.d.ts +1 -1
  29. package/dist/cjs/api/resources/transfers/client/requests/NewWithdrawalParams.d.ts +1 -1
  30. package/dist/cjs/api/resources/wallets/client/Client.js +4 -4
  31. package/dist/cjs/api/resources/wallets/client/requests/CreateWalletsRequest.d.ts +1 -1
  32. package/dist/cjs/api/resources/wallets/client/requests/GetWalletsRequest.d.ts +1 -1
  33. package/dist/cjs/api/resources/wallets/client/requests/ListWalletsRequest.d.ts +1 -1
  34. package/dist/cjs/serialization/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.d.ts +1 -1
  35. package/dist/cjs/serialization/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.js +1 -1
  36. package/dist/cjs/serialization/resources/paymentRequests/client/requests/CancelPaymentRequestsRequest.d.ts +9 -0
  37. package/dist/cjs/serialization/resources/paymentRequests/client/requests/CancelPaymentRequestsRequest.js +41 -0
  38. package/dist/cjs/serialization/resources/paymentRequests/client/requests/NewFulfilledReqParams.d.ts +1 -0
  39. package/dist/cjs/serialization/resources/paymentRequests/client/requests/NewFulfilledReqParams.js +1 -0
  40. package/dist/cjs/serialization/resources/paymentRequests/client/requests/index.d.ts +1 -0
  41. package/dist/cjs/serialization/resources/paymentRequests/client/requests/index.js +3 -1
  42. package/dist/cjs/serialization/resources/payments/client/requests/CancelPaymentsRequest.d.ts +9 -0
  43. package/dist/cjs/serialization/resources/payments/client/requests/CancelPaymentsRequest.js +41 -0
  44. package/dist/cjs/serialization/resources/payments/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/serialization/resources/payments/client/requests/index.js +3 -1
  46. package/dist/cjs/serialization/resources/transfers/client/requests/InitiateInternalTransfersRequest.d.ts +1 -1
  47. package/dist/cjs/serialization/resources/transfers/client/requests/InitiateInternalTransfersRequest.js +1 -1
  48. package/dist/cjs/serialization/resources/transfers/client/requests/NewDepositParams.d.ts +1 -1
  49. package/dist/cjs/serialization/resources/transfers/client/requests/NewDepositParams.js +1 -1
  50. package/dist/cjs/serialization/resources/transfers/client/requests/NewWithdrawalParams.d.ts +1 -1
  51. package/dist/cjs/serialization/resources/transfers/client/requests/NewWithdrawalParams.js +1 -1
  52. package/dist/cjs/serialization/resources/wallets/client/requests/CreateWalletsRequest.d.ts +1 -1
  53. package/dist/cjs/serialization/resources/wallets/client/requests/CreateWalletsRequest.js +1 -1
  54. package/dist/cjs/version.d.ts +1 -1
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/esm/BaseClient.mjs +2 -2
  57. package/dist/esm/api/resources/events/client/Client.mjs +4 -4
  58. package/dist/esm/api/resources/events/client/requests/GetEventsRequest.d.mts +1 -1
  59. package/dist/esm/api/resources/events/client/requests/ListEventsRequest.d.mts +1 -1
  60. package/dist/esm/api/resources/events/types/ListEventsRequestEventType.d.mts +1 -1
  61. package/dist/esm/api/resources/events/types/ListEventsRequestEventType.mjs +1 -1
  62. package/dist/esm/api/resources/externalAccounts/client/Client.d.mts +1 -1
  63. package/dist/esm/api/resources/externalAccounts/client/Client.mjs +1 -1
  64. package/dist/esm/api/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.d.mts +2 -2
  65. package/dist/esm/api/resources/paymentRequests/client/Client.d.mts +2 -1
  66. package/dist/esm/api/resources/paymentRequests/client/Client.mjs +15 -8
  67. package/dist/esm/api/resources/paymentRequests/client/requests/CancelPaymentRequestsRequest.d.mts +4 -1
  68. package/dist/esm/api/resources/paymentRequests/client/requests/GetPaymentRequestsRequest.d.mts +1 -1
  69. package/dist/esm/api/resources/paymentRequests/client/requests/ListIncomingPaymentRequestsRequest.d.mts +1 -1
  70. package/dist/esm/api/resources/paymentRequests/client/requests/ListPaymentRequestsRequest.d.mts +1 -1
  71. package/dist/esm/api/resources/paymentRequests/client/requests/NewFulfilledReqParams.d.mts +2 -0
  72. package/dist/esm/api/resources/payments/client/Client.d.mts +2 -1
  73. package/dist/esm/api/resources/payments/client/Client.mjs +13 -6
  74. package/dist/esm/api/resources/payments/client/requests/CancelPaymentsRequest.d.mts +4 -1
  75. package/dist/esm/api/resources/payments/client/requests/GetPaymentsRequest.d.mts +1 -1
  76. package/dist/esm/api/resources/payments/client/requests/ListPaymentsRequest.d.mts +1 -1
  77. package/dist/esm/api/resources/transactions/client/Client.mjs +2 -2
  78. package/dist/esm/api/resources/transactions/client/requests/GetTransactionsRequest.d.mts +1 -1
  79. package/dist/esm/api/resources/transfers/client/Client.mjs +4 -4
  80. package/dist/esm/api/resources/transfers/client/requests/GetTransfersRequest.d.mts +1 -1
  81. package/dist/esm/api/resources/transfers/client/requests/InitiateInternalTransfersRequest.d.mts +1 -1
  82. package/dist/esm/api/resources/transfers/client/requests/ListTransfersRequest.d.mts +1 -1
  83. package/dist/esm/api/resources/transfers/client/requests/NewDepositParams.d.mts +1 -1
  84. package/dist/esm/api/resources/transfers/client/requests/NewWithdrawalParams.d.mts +1 -1
  85. package/dist/esm/api/resources/wallets/client/Client.mjs +4 -4
  86. package/dist/esm/api/resources/wallets/client/requests/CreateWalletsRequest.d.mts +1 -1
  87. package/dist/esm/api/resources/wallets/client/requests/GetWalletsRequest.d.mts +1 -1
  88. package/dist/esm/api/resources/wallets/client/requests/ListWalletsRequest.d.mts +1 -1
  89. package/dist/esm/serialization/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.d.mts +1 -1
  90. package/dist/esm/serialization/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.mjs +1 -1
  91. package/dist/esm/serialization/resources/paymentRequests/client/requests/CancelPaymentRequestsRequest.d.mts +9 -0
  92. package/dist/esm/serialization/resources/paymentRequests/client/requests/CancelPaymentRequestsRequest.mjs +5 -0
  93. package/dist/esm/serialization/resources/paymentRequests/client/requests/NewFulfilledReqParams.d.mts +1 -0
  94. package/dist/esm/serialization/resources/paymentRequests/client/requests/NewFulfilledReqParams.mjs +1 -0
  95. package/dist/esm/serialization/resources/paymentRequests/client/requests/index.d.mts +1 -0
  96. package/dist/esm/serialization/resources/paymentRequests/client/requests/index.mjs +1 -0
  97. package/dist/esm/serialization/resources/payments/client/requests/CancelPaymentsRequest.d.mts +9 -0
  98. package/dist/esm/serialization/resources/payments/client/requests/CancelPaymentsRequest.mjs +5 -0
  99. package/dist/esm/serialization/resources/payments/client/requests/index.d.mts +1 -0
  100. package/dist/esm/serialization/resources/payments/client/requests/index.mjs +1 -0
  101. package/dist/esm/serialization/resources/transfers/client/requests/InitiateInternalTransfersRequest.d.mts +1 -1
  102. package/dist/esm/serialization/resources/transfers/client/requests/InitiateInternalTransfersRequest.mjs +1 -1
  103. package/dist/esm/serialization/resources/transfers/client/requests/NewDepositParams.d.mts +1 -1
  104. package/dist/esm/serialization/resources/transfers/client/requests/NewDepositParams.mjs +1 -1
  105. package/dist/esm/serialization/resources/transfers/client/requests/NewWithdrawalParams.d.mts +1 -1
  106. package/dist/esm/serialization/resources/transfers/client/requests/NewWithdrawalParams.mjs +1 -1
  107. package/dist/esm/serialization/resources/wallets/client/requests/CreateWalletsRequest.d.mts +1 -1
  108. package/dist/esm/serialization/resources/wallets/client/requests/CreateWalletsRequest.mjs +1 -1
  109. package/dist/esm/version.d.mts +1 -1
  110. package/dist/esm/version.mjs +1 -1
  111. package/package.json +1 -1
  112. package/reference.md +5 -3
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@naturalpay/sdk",
46
- "X-Fern-SDK-Version": "1.6.18",
47
- "User-Agent": "@naturalpay/sdk/1.6.18",
46
+ "X-Fern-SDK-Version": "1.6.19",
47
+ "User-Agent": "@naturalpay/sdk/1.6.19",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "X-Instance-ID": options === null || options === void 0 ? void 0 : options.instanceId,
@@ -89,9 +89,9 @@ class EventsClient {
89
89
  __list() {
90
90
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
91
91
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
92
- const { partyId, eventType, createdAfter, createdBefore, cursor, limit } = request;
92
+ const { customerPartyId, eventType, createdAfter, createdBefore, cursor, limit } = request;
93
93
  const _queryParams = {
94
- partyId,
94
+ customerPartyId,
95
95
  eventType: eventType != null
96
96
  ? serializers.ListEventsRequestEventType.jsonOrThrow(eventType, {
97
97
  unrecognizedObjectKeys: "strip",
@@ -201,9 +201,9 @@ class EventsClient {
201
201
  __get(request, requestOptions) {
202
202
  return __awaiter(this, void 0, void 0, function* () {
203
203
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
204
- const { eventId, partyId } = request;
204
+ const { eventId, customerPartyId } = request;
205
205
  const _queryParams = {
206
- partyId,
206
+ customerPartyId,
207
207
  };
208
208
  const _authRequest = yield this._options.authProvider.getAuthRequest();
209
209
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export interface GetEventsRequest {
8
8
  eventId: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  }
@@ -4,7 +4,7 @@ import type * as Natural from "../../../../index.js";
4
4
  * {}
5
5
  */
6
6
  export interface ListEventsRequest {
7
- partyId?: string;
7
+ customerPartyId?: string;
8
8
  eventType?: Natural.ListEventsRequestEventType;
9
9
  createdAfter?: Date;
10
10
  createdBefore?: Date;
@@ -1,4 +1,4 @@
1
- /** Filter by event type. Required when partyId names another party. */
1
+ /** Filter by event type. Required when customerPartyId names another party. */
2
2
  export declare const ListEventsRequestEventType: {
3
3
  readonly PartyUpdated: "party.updated";
4
4
  readonly ComplianceCaseUpdated: "compliance_case.updated";
@@ -2,7 +2,7 @@
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ListEventsRequestEventType = void 0;
5
- /** Filter by event type. Required when partyId names another party. */
5
+ /** Filter by event type. Required when customerPartyId names another party. */
6
6
  exports.ListEventsRequestEventType = {
7
7
  PartyUpdated: "party.updated",
8
8
  ComplianceCaseUpdated: "compliance_case.updated",
@@ -39,7 +39,7 @@ export declare class ExternalAccountsClient {
39
39
  * @example
40
40
  * await client.externalAccounts.createFromProcessorToken({
41
41
  * idempotencyKey: "Idempotency-Key",
42
- * partyId: "pty_550e8400e29b41d4a716446655440000",
42
+ * customerPartyId: "pty_550e8400e29b41d4a716446655440000",
43
43
  * processorToken: "processor-sandbox-abc123",
44
44
  * institutionName: "Plaid Sandbox",
45
45
  * tags: {
@@ -97,7 +97,7 @@ class ExternalAccountsClient {
97
97
  * @example
98
98
  * await client.externalAccounts.createFromProcessorToken({
99
99
  * idempotencyKey: "Idempotency-Key",
100
- * partyId: "pty_550e8400e29b41d4a716446655440000",
100
+ * customerPartyId: "pty_550e8400e29b41d4a716446655440000",
101
101
  * processorToken: "processor-sandbox-abc123",
102
102
  * institutionName: "Plaid Sandbox",
103
103
  * tags: {
@@ -2,7 +2,7 @@
2
2
  * @example
3
3
  * {
4
4
  * idempotencyKey: "Idempotency-Key",
5
- * partyId: "pty_550e8400e29b41d4a716446655440000",
5
+ * customerPartyId: "pty_550e8400e29b41d4a716446655440000",
6
6
  * processorToken: "processor-sandbox-abc123",
7
7
  * institutionName: "Plaid Sandbox",
8
8
  * tags: {
@@ -14,7 +14,7 @@ export interface CreateFromProcessorTokenExternalAccountsRequest {
14
14
  /** Unique key for safely retrying a request without creating duplicates. */
15
15
  idempotencyKey: string;
16
16
  /** Party that will own the account. */
17
- partyId: string;
17
+ customerPartyId: string;
18
18
  /** Plaid processor token created for Natural and scoped to one account. */
19
19
  processorToken: string;
20
20
  /** Institution display name to store with the linked external account. */
@@ -219,7 +219,8 @@ export declare class PaymentRequestsClient {
219
219
  * @example
220
220
  * await client.paymentRequests.cancel({
221
221
  * idempotencyKey: "Idempotency-Key",
222
- * paymentRequestId: "paymentRequestId"
222
+ * paymentRequestId: "paymentRequestId",
223
+ * customerPartyId: "pty_019cd1798d627ad9bc302511c4f2c115"
223
224
  * })
224
225
  */
225
226
  cancel(request: Natural.CancelPaymentRequestsRequest, requestOptions?: PaymentRequestsClient.RequestOptions): core.HttpResponsePromise<Natural.CancelPaymentRequestsResponse>;
@@ -100,11 +100,11 @@ class PaymentRequestsClient {
100
100
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
101
101
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
102
102
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
103
- const { limit, cursor, partyId, includeCompleted, includeCanceled, initiatedByAgent, addressedToAgent, } = request;
103
+ const { limit, cursor, customerPartyId, includeCompleted, includeCanceled, initiatedByAgent, addressedToAgent, } = request;
104
104
  const _queryParams = {
105
105
  limit,
106
106
  cursor,
107
- partyId,
107
+ customerPartyId,
108
108
  includeCompleted: Array.isArray(includeCompleted)
109
109
  ? includeCompleted.map((item) => (() => {
110
110
  const mapped = serializers.ListPaymentRequestsRequestIncludeCompleted.jsonOrThrow(item, { unrecognizedObjectKeys: "strip", omitUndefined: true });
@@ -354,11 +354,11 @@ class PaymentRequestsClient {
354
354
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
355
355
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
356
356
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
357
- const { limit, cursor, partyId, addressedToAgent } = request;
357
+ const { limit, cursor, customerPartyId, addressedToAgent } = request;
358
358
  const _queryParams = {
359
359
  limit,
360
360
  cursor,
361
- partyId,
361
+ customerPartyId,
362
362
  addressedToAgent,
363
363
  };
364
364
  const _authRequest = yield this._options.authProvider.getAuthRequest();
@@ -474,9 +474,9 @@ class PaymentRequestsClient {
474
474
  __get(request, requestOptions) {
475
475
  return __awaiter(this, void 0, void 0, function* () {
476
476
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
477
- const { paymentRequestId, partyId } = request;
477
+ const { paymentRequestId, customerPartyId } = request;
478
478
  const _queryParams = {
479
- partyId,
479
+ customerPartyId,
480
480
  };
481
481
  const _authRequest = yield this._options.authProvider.getAuthRequest();
482
482
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -779,7 +779,8 @@ class PaymentRequestsClient {
779
779
  * @example
780
780
  * await client.paymentRequests.cancel({
781
781
  * idempotencyKey: "Idempotency-Key",
782
- * paymentRequestId: "paymentRequestId"
782
+ * paymentRequestId: "paymentRequestId",
783
+ * customerPartyId: "pty_019cd1798d627ad9bc302511c4f2c115"
783
784
  * })
784
785
  */
785
786
  cancel(request, requestOptions) {
@@ -788,7 +789,7 @@ class PaymentRequestsClient {
788
789
  __cancel(request, requestOptions) {
789
790
  return __awaiter(this, void 0, void 0, function* () {
790
791
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
791
- const { paymentRequestId, idempotencyKey } = request;
792
+ const { paymentRequestId, idempotencyKey } = request, _body = __rest(request, ["paymentRequestId", "idempotencyKey"]);
792
793
  const _authRequest = yield this._options.authProvider.getAuthRequest();
793
794
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
794
795
  "Idempotency-Key": idempotencyKey,
@@ -798,7 +799,13 @@ class PaymentRequestsClient {
798
799
  url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.NaturalEnvironment.Production, `payment-requests/${core.url.encodePathParam(paymentRequestId)}/cancel`),
799
800
  method: "POST",
800
801
  headers: _headers,
802
+ contentType: "application/json",
801
803
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
804
+ requestType: "json",
805
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.CancelPaymentRequestsRequest.jsonOrThrow(_body, {
806
+ unrecognizedObjectKeys: "strip",
807
+ omitUndefined: true,
808
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
802
809
  timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
803
810
  maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
804
811
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -2,11 +2,14 @@
2
2
  * @example
3
3
  * {
4
4
  * idempotencyKey: "Idempotency-Key",
5
- * paymentRequestId: "paymentRequestId"
5
+ * paymentRequestId: "paymentRequestId",
6
+ * customerPartyId: "pty_019cd1798d627ad9bc302511c4f2c115"
6
7
  * }
7
8
  */
8
9
  export interface CancelPaymentRequestsRequest {
9
10
  paymentRequestId: string;
10
11
  /** Unique key for safely retrying a request without creating duplicates. */
11
12
  idempotencyKey: string;
13
+ /** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
14
+ customerPartyId?: string;
12
15
  }
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export interface GetPaymentRequestsRequest {
8
8
  paymentRequestId: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  }
@@ -5,6 +5,6 @@
5
5
  export interface ListIncomingPaymentRequestsRequest {
6
6
  limit?: number;
7
7
  cursor?: string;
8
- partyId?: string;
8
+ customerPartyId?: string;
9
9
  addressedToAgent?: string;
10
10
  }
@@ -6,7 +6,7 @@ import type * as Natural from "../../../../index.js";
6
6
  export interface ListPaymentRequestsRequest {
7
7
  limit?: number;
8
8
  cursor?: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  includeCompleted?: Natural.ListPaymentRequestsRequestIncludeCompleted;
11
11
  includeCanceled?: Natural.ListPaymentRequestsRequestIncludeCanceled;
12
12
  initiatedByAgent?: string;
@@ -17,6 +17,8 @@ export interface NewFulfilledReqParams {
17
17
  paymentRequestId: string;
18
18
  /** Unique key for safely retrying a request without creating duplicates. */
19
19
  idempotencyKey: string;
20
+ /** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
21
+ customerPartyId?: string;
20
22
  /** Source of funds for the payment. */
21
23
  paymentSource: Natural.FulfillPaymentRequestsRequestPaymentSource;
22
24
  /** Key-value metadata stored on the resource. At most 30 keys; keys 1-128 characters, alphanumeric and underscores; values 1-256 characters. Visible to anyone who can read the resource; do not include sensitive data. */
@@ -128,7 +128,8 @@ export declare class PaymentsClient {
128
128
  * @example
129
129
  * await client.payments.cancel({
130
130
  * idempotencyKey: "Idempotency-Key",
131
- * paymentId: "paymentId"
131
+ * paymentId: "paymentId",
132
+ * customerPartyId: "pty_019cd1798d627ad9bc302511c4f2c115"
132
133
  * })
133
134
  */
134
135
  cancel(request: Natural.CancelPaymentsRequest, requestOptions?: PaymentsClient.RequestOptions): core.HttpResponsePromise<Natural.CancelledPmt>;
@@ -99,9 +99,9 @@ class PaymentsClient {
99
99
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
100
100
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
101
101
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
102
- const { partyId, limit, cursor } = request;
102
+ const { customerPartyId, limit, cursor } = request;
103
103
  const _queryParams = {
104
- partyId,
104
+ customerPartyId,
105
105
  limit,
106
106
  cursor,
107
107
  };
@@ -332,9 +332,9 @@ class PaymentsClient {
332
332
  __get(request, requestOptions) {
333
333
  return __awaiter(this, void 0, void 0, function* () {
334
334
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
335
- const { paymentId, partyId } = request;
335
+ const { paymentId, customerPartyId } = request;
336
336
  const _queryParams = {
337
- partyId,
337
+ customerPartyId,
338
338
  };
339
339
  const _authRequest = yield this._options.authProvider.getAuthRequest();
340
340
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -426,7 +426,8 @@ class PaymentsClient {
426
426
  * @example
427
427
  * await client.payments.cancel({
428
428
  * idempotencyKey: "Idempotency-Key",
429
- * paymentId: "paymentId"
429
+ * paymentId: "paymentId",
430
+ * customerPartyId: "pty_019cd1798d627ad9bc302511c4f2c115"
430
431
  * })
431
432
  */
432
433
  cancel(request, requestOptions) {
@@ -435,7 +436,7 @@ class PaymentsClient {
435
436
  __cancel(request, requestOptions) {
436
437
  return __awaiter(this, void 0, void 0, function* () {
437
438
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
438
- const { paymentId, idempotencyKey } = request;
439
+ const { paymentId, idempotencyKey } = request, _body = __rest(request, ["paymentId", "idempotencyKey"]);
439
440
  const _authRequest = yield this._options.authProvider.getAuthRequest();
440
441
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
441
442
  "Idempotency-Key": idempotencyKey,
@@ -445,7 +446,13 @@ class PaymentsClient {
445
446
  url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.NaturalEnvironment.Production, `payments/${core.url.encodePathParam(paymentId)}/cancel`),
446
447
  method: "POST",
447
448
  headers: _headers,
449
+ contentType: "application/json",
448
450
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
451
+ requestType: "json",
452
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.CancelPaymentsRequest.jsonOrThrow(_body, {
453
+ unrecognizedObjectKeys: "strip",
454
+ omitUndefined: true,
455
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
449
456
  timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
450
457
  maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
451
458
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -2,11 +2,14 @@
2
2
  * @example
3
3
  * {
4
4
  * idempotencyKey: "Idempotency-Key",
5
- * paymentId: "paymentId"
5
+ * paymentId: "paymentId",
6
+ * customerPartyId: "pty_019cd1798d627ad9bc302511c4f2c115"
6
7
  * }
7
8
  */
8
9
  export interface CancelPaymentsRequest {
9
10
  paymentId: string;
10
11
  /** Unique key for safely retrying a request without creating duplicates. */
11
12
  idempotencyKey: string;
13
+ /** Defaults to your party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
14
+ customerPartyId?: string;
12
15
  }
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export interface GetPaymentsRequest {
8
8
  paymentId: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  }
@@ -3,7 +3,7 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListPaymentsRequest {
6
- partyId?: string;
6
+ customerPartyId?: string;
7
7
  limit?: number;
8
8
  cursor?: string;
9
9
  }
@@ -215,9 +215,9 @@ class TransactionsClient {
215
215
  __get(request, requestOptions) {
216
216
  return __awaiter(this, void 0, void 0, function* () {
217
217
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
218
- const { transactionId, partyId } = request;
218
+ const { transactionId, customerPartyId } = request;
219
219
  const _queryParams = {
220
- partyId,
220
+ customerPartyId,
221
221
  };
222
222
  const _authRequest = yield this._options.authProvider.getAuthRequest();
223
223
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export interface GetTransactionsRequest {
8
8
  transactionId: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  }
@@ -433,9 +433,9 @@ class TransfersClient {
433
433
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
434
434
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
435
435
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
436
- const { partyId, limit, cursor } = request;
436
+ const { customerPartyId, limit, cursor } = request;
437
437
  const _queryParams = {
438
- partyId,
438
+ customerPartyId,
439
439
  limit,
440
440
  cursor,
441
441
  };
@@ -552,9 +552,9 @@ class TransfersClient {
552
552
  __get(request, requestOptions) {
553
553
  return __awaiter(this, void 0, void 0, function* () {
554
554
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
555
- const { transferId, partyId } = request;
555
+ const { transferId, customerPartyId } = request;
556
556
  const _queryParams = {
557
- partyId,
557
+ customerPartyId,
558
558
  };
559
559
  const _authRequest = yield this._options.authProvider.getAuthRequest();
560
560
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export interface GetTransfersRequest {
8
8
  transferId: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  }
@@ -15,7 +15,7 @@ export interface InitiateInternalTransfersRequest {
15
15
  /** Unique key for safely retrying a request without creating duplicates. */
16
16
  idempotencyKey: string;
17
17
  /** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
18
- partyId?: string;
18
+ customerPartyId?: string;
19
19
  /** Amount in cents. */
20
20
  amount: number;
21
21
  /** Source wallet ID (wal_*). */
@@ -3,7 +3,7 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListTransfersRequest {
6
- partyId?: string;
6
+ customerPartyId?: string;
7
7
  limit?: number;
8
8
  cursor?: string;
9
9
  }
@@ -16,7 +16,7 @@ export interface NewDepositParams {
16
16
  /** Unique key for safely retrying a request without creating duplicates. */
17
17
  idempotencyKey: string;
18
18
  /** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
19
- partyId?: string;
19
+ customerPartyId?: string;
20
20
  /** Amount in cents. */
21
21
  amount: number;
22
22
  /** Currency code. */
@@ -17,7 +17,7 @@ export interface NewWithdrawalParams {
17
17
  /** Unique key for safely retrying a request without creating duplicates. */
18
18
  idempotencyKey: string;
19
19
  /** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
20
- partyId?: string;
20
+ customerPartyId?: string;
21
21
  /** Amount in cents. */
22
22
  amount: number;
23
23
  /** Currency code. */
@@ -101,9 +101,9 @@ class WalletsClient {
101
101
  __list() {
102
102
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
103
103
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
104
- const { partyId } = request;
104
+ const { customerPartyId } = request;
105
105
  const _queryParams = {
106
- partyId,
106
+ customerPartyId,
107
107
  };
108
108
  const _authRequest = yield this._options.authProvider.getAuthRequest();
109
109
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -312,9 +312,9 @@ class WalletsClient {
312
312
  __get(request, requestOptions) {
313
313
  return __awaiter(this, void 0, void 0, function* () {
314
314
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
315
- const { walletId, partyId } = request;
315
+ const { walletId, customerPartyId } = request;
316
316
  const _queryParams = {
317
- partyId,
317
+ customerPartyId,
318
318
  };
319
319
  const _authRequest = yield this._options.authProvider.getAuthRequest();
320
320
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -13,7 +13,7 @@ export interface CreateWalletsRequest {
13
13
  /** Unique key for safely retrying a request without creating duplicates. */
14
14
  idempotencyKey: string;
15
15
  /** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
16
- partyId?: string;
16
+ customerPartyId?: string;
17
17
  /** Wallet name. */
18
18
  displayName: string;
19
19
  /** User-facing wallet description. */
@@ -6,5 +6,5 @@
6
6
  */
7
7
  export interface GetWalletsRequest {
8
8
  walletId: string;
9
- partyId?: string;
9
+ customerPartyId?: string;
10
10
  }
@@ -3,5 +3,5 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListWalletsRequest {
6
- partyId?: string;
6
+ customerPartyId?: string;
7
7
  }
@@ -4,7 +4,7 @@ import type * as serializers from "../../../../index.js";
4
4
  export declare const CreateFromProcessorTokenExternalAccountsRequest: core.serialization.Schema<serializers.CreateFromProcessorTokenExternalAccountsRequest.Raw, Omit<Natural.CreateFromProcessorTokenExternalAccountsRequest, "idempotencyKey">>;
5
5
  export declare namespace CreateFromProcessorTokenExternalAccountsRequest {
6
6
  interface Raw {
7
- partyId: string;
7
+ customerPartyId: string;
8
8
  processorToken: string;
9
9
  institutionName?: (string | null | undefined) | null;
10
10
  tags?: Record<string, string> | null;
@@ -37,7 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.CreateFromProcessorTokenExternalAccountsRequest = void 0;
38
38
  const core = __importStar(require("../../../../../core/index.js"));
39
39
  exports.CreateFromProcessorTokenExternalAccountsRequest = core.serialization.object({
40
- partyId: core.serialization.string(),
40
+ customerPartyId: core.serialization.string(),
41
41
  processorToken: core.serialization.string(),
42
42
  institutionName: core.serialization.string().optionalNullable(),
43
43
  tags: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(),
@@ -0,0 +1,9 @@
1
+ import type * as Natural from "../../../../../api/index.js";
2
+ import * as core from "../../../../../core/index.js";
3
+ import type * as serializers from "../../../../index.js";
4
+ export declare const CancelPaymentRequestsRequest: core.serialization.Schema<serializers.CancelPaymentRequestsRequest.Raw, Omit<Natural.CancelPaymentRequestsRequest, "paymentRequestId" | "idempotencyKey">>;
5
+ export declare namespace CancelPaymentRequestsRequest {
6
+ interface Raw {
7
+ customerPartyId?: string | null;
8
+ }
9
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.CancelPaymentRequestsRequest = void 0;
38
+ const core = __importStar(require("../../../../../core/index.js"));
39
+ exports.CancelPaymentRequestsRequest = core.serialization.object({
40
+ customerPartyId: core.serialization.string().optional(),
41
+ });
@@ -5,6 +5,7 @@ import { FulfillPaymentRequestsRequestPaymentSource } from "../../types/FulfillP
5
5
  export declare const NewFulfilledReqParams: core.serialization.Schema<serializers.NewFulfilledReqParams.Raw, Omit<Natural.NewFulfilledReqParams, "paymentRequestId" | "idempotencyKey">>;
6
6
  export declare namespace NewFulfilledReqParams {
7
7
  interface Raw {
8
+ customerPartyId?: string | null;
8
9
  paymentSource: FulfillPaymentRequestsRequestPaymentSource.Raw;
9
10
  tags?: Record<string, string> | null;
10
11
  }
@@ -38,6 +38,7 @@ exports.NewFulfilledReqParams = void 0;
38
38
  const core = __importStar(require("../../../../../core/index.js"));
39
39
  const FulfillPaymentRequestsRequestPaymentSource_js_1 = require("../../types/FulfillPaymentRequestsRequestPaymentSource.js");
40
40
  exports.NewFulfilledReqParams = core.serialization.object({
41
+ customerPartyId: core.serialization.string().optional(),
41
42
  paymentSource: FulfillPaymentRequestsRequestPaymentSource_js_1.FulfillPaymentRequestsRequestPaymentSource,
42
43
  tags: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(),
43
44
  });
@@ -1,2 +1,3 @@
1
+ export { CancelPaymentRequestsRequest } from "./CancelPaymentRequestsRequest.js";
1
2
  export { NewFulfilledReqParams } from "./NewFulfilledReqParams.js";
2
3
  export { NewPayReqParams } from "./NewPayReqParams.js";
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NewPayReqParams = exports.NewFulfilledReqParams = void 0;
3
+ exports.NewPayReqParams = exports.NewFulfilledReqParams = exports.CancelPaymentRequestsRequest = void 0;
4
+ var CancelPaymentRequestsRequest_js_1 = require("./CancelPaymentRequestsRequest.js");
5
+ Object.defineProperty(exports, "CancelPaymentRequestsRequest", { enumerable: true, get: function () { return CancelPaymentRequestsRequest_js_1.CancelPaymentRequestsRequest; } });
4
6
  var NewFulfilledReqParams_js_1 = require("./NewFulfilledReqParams.js");
5
7
  Object.defineProperty(exports, "NewFulfilledReqParams", { enumerable: true, get: function () { return NewFulfilledReqParams_js_1.NewFulfilledReqParams; } });
6
8
  var NewPayReqParams_js_1 = require("./NewPayReqParams.js");