modern-treasury 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +10 -0
- package/.prettierrc +6 -0
- package/LICENSE +7 -0
- package/README.md +198 -0
- package/build +10 -0
- package/core.ts +746 -0
- package/dist/cjs/core.d.ts +215 -0
- package/dist/cjs/core.js +815 -0
- package/dist/cjs/core.js.map +1 -0
- package/dist/cjs/index.d.ts +118 -0
- package/dist/cjs/index.js +128 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/pagination.d.ts +14 -0
- package/dist/cjs/pagination.js +22 -0
- package/dist/cjs/pagination.js.map +1 -0
- package/dist/cjs/resource.d.ts +11 -0
- package/dist/cjs/resource.js +16 -0
- package/dist/cjs/resource.js.map +1 -0
- package/dist/cjs/resources/counterparties.d.ts +500 -0
- package/dist/cjs/resources/counterparties.js +57 -0
- package/dist/cjs/resources/counterparties.js.map +1 -0
- package/dist/cjs/resources/documents.d.ts +66 -0
- package/dist/cjs/resources/documents.js +23 -0
- package/dist/cjs/resources/documents.js.map +1 -0
- package/dist/cjs/resources/events.d.ts +53 -0
- package/dist/cjs/resources/events.js +22 -0
- package/dist/cjs/resources/events.js.map +1 -0
- package/dist/cjs/resources/expected-payments.d.ts +928 -0
- package/dist/cjs/resources/expected-payments.js +31 -0
- package/dist/cjs/resources/expected-payments.js.map +1 -0
- package/dist/cjs/resources/external-accounts.d.ts +597 -0
- package/dist/cjs/resources/external-accounts.js +51 -0
- package/dist/cjs/resources/external-accounts.js.map +1 -0
- package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
- package/dist/cjs/resources/incoming-payment-details.js +35 -0
- package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +15 -0
- package/dist/cjs/resources/index.js +46 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/internal-accounts.d.ts +666 -0
- package/dist/cjs/resources/internal-accounts.js +31 -0
- package/dist/cjs/resources/internal-accounts.js.map +1 -0
- package/dist/cjs/resources/line-items.d.ts +90 -0
- package/dist/cjs/resources/line-items.js +38 -0
- package/dist/cjs/resources/line-items.js.map +1 -0
- package/dist/cjs/resources/paper-items.d.ts +279 -0
- package/dist/cjs/resources/paper-items.js +25 -0
- package/dist/cjs/resources/paper-items.js.map +1 -0
- package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
- package/dist/cjs/resources/payment-orders/index.js +33 -0
- package/dist/cjs/resources/payment-orders/index.js.map +1 -0
- package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
- package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
- package/dist/cjs/resources/payment-orders/reversals.js +23 -0
- package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
- package/dist/cjs/resources/returns.d.ts +487 -0
- package/dist/cjs/resources/returns.js +31 -0
- package/dist/cjs/resources/returns.js.map +1 -0
- package/dist/cjs/resources/top-level.d.ts +3 -0
- package/dist/cjs/resources/top-level.js +4 -0
- package/dist/cjs/resources/top-level.js.map +1 -0
- package/dist/cjs/resources/transactions.d.ts +377 -0
- package/dist/cjs/resources/transactions.js +31 -0
- package/dist/cjs/resources/transactions.js.map +1 -0
- package/dist/cjs/resources/validations.d.ts +97 -0
- package/dist/cjs/resources/validations.js +16 -0
- package/dist/cjs/resources/validations.js.map +1 -0
- package/dist/cjs/resources/webhooks.d.ts +31 -0
- package/dist/cjs/resources/webhooks.js +44 -0
- package/dist/cjs/resources/webhooks.js.map +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/documents.test.js +78 -0
- package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/events.test.js +100 -0
- package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
- package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/returns.test.js +116 -0
- package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
- package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
- package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/validations.test.js +62 -0
- package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
- package/dist/cjs/tests/form.test.d.ts +1 -0
- package/dist/cjs/tests/form.test.js +61 -0
- package/dist/cjs/tests/form.test.js.map +1 -0
- package/dist/cjs/tests/index.test.d.ts +1 -0
- package/dist/cjs/tests/index.test.js +57 -0
- package/dist/cjs/tests/index.test.js.map +1 -0
- package/dist/cjs/tests/responses.test.d.ts +1 -0
- package/dist/cjs/tests/responses.test.js +60 -0
- package/dist/cjs/tests/responses.test.js.map +1 -0
- package/index.ts +175 -0
- package/jest.config.js +8 -0
- package/package.json +47 -0
- package/pagination.ts +36 -0
- package/resource.ts +22 -0
- package/resources/counterparties.ts +666 -0
- package/resources/documents.ts +97 -0
- package/resources/events.ts +86 -0
- package/resources/expected-payments.ts +1016 -0
- package/resources/external-accounts.ts +762 -0
- package/resources/incoming-payment-details.ts +592 -0
- package/resources/index.ts +16 -0
- package/resources/internal-accounts.ts +774 -0
- package/resources/line-items.ts +138 -0
- package/resources/paper-items.ts +317 -0
- package/resources/payment-orders/index.ts +3 -0
- package/resources/payment-orders/payment-orders.ts +2486 -0
- package/resources/payment-orders/reversals.ts +72 -0
- package/resources/returns.ts +545 -0
- package/resources/top-level.ts +5 -0
- package/resources/transactions.ts +441 -0
- package/resources/validations.ts +115 -0
- package/resources/webhooks.ts +48 -0
- package/tests/api-resources/counterparties.test.ts +237 -0
- package/tests/api-resources/documents.test.ts +40 -0
- package/tests/api-resources/events.test.ts +62 -0
- package/tests/api-resources/expected-payments.test.ts +138 -0
- package/tests/api-resources/external-accounts.test.ts +210 -0
- package/tests/api-resources/incoming-payment-details.test.ts +92 -0
- package/tests/api-resources/internal-accounts.test.ts +103 -0
- package/tests/api-resources/line-items.test.ts +85 -0
- package/tests/api-resources/paper-items.test.ts +58 -0
- package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
- package/tests/api-resources/returns.test.ts +78 -0
- package/tests/api-resources/top-level.test.ts +21 -0
- package/tests/api-resources/transactions.test.ts +96 -0
- package/tests/api-resources/validations.test.ts +24 -0
- package/tests/api-resources/webhooks.test.ts +102 -0
- package/tests/form.test.ts +27 -0
- package/tests/index.test.ts +62 -0
- package/tests/responses.test.ts +25 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
exports.PaymentOrdersPage = exports.PaymentOrders = void 0;
|
|
5
|
+
const resource_1 = require('../../resource');
|
|
6
|
+
const core_1 = require('../../core');
|
|
7
|
+
const reversals_1 = require('./reversals');
|
|
8
|
+
const pagination_1 = require('../../pagination');
|
|
9
|
+
class PaymentOrders extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.reversals = new reversals_1.Reversals(this.client);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Payment Order
|
|
16
|
+
*/
|
|
17
|
+
create(body, options) {
|
|
18
|
+
return this.post('/api/payment_orders', Object.assign({ body }, options));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get details on a single payment order
|
|
22
|
+
*/
|
|
23
|
+
retrieve(id, options) {
|
|
24
|
+
return this.get(`/api/payment_orders/${id}`, options);
|
|
25
|
+
}
|
|
26
|
+
update(id, body = {}, options) {
|
|
27
|
+
if ((0, core_1.isRequestOptions)(body)) {
|
|
28
|
+
return this.update(id, {}, body);
|
|
29
|
+
}
|
|
30
|
+
return this.patch(`/api/payment_orders/${id}`, Object.assign({ body }, options));
|
|
31
|
+
}
|
|
32
|
+
list(query = {}, options) {
|
|
33
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
34
|
+
return this.list({}, query);
|
|
35
|
+
}
|
|
36
|
+
return this.getAPIList('/api/payment_orders', PaymentOrdersPage, Object.assign({ query }, options));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a new payment order asynchronously
|
|
40
|
+
*/
|
|
41
|
+
createAsync(body, options) {
|
|
42
|
+
return this.post(
|
|
43
|
+
'/api/payment_orders/create_async',
|
|
44
|
+
Object.assign(Object.assign({ body }, options), {
|
|
45
|
+
headers: Object.assign(
|
|
46
|
+
{ Accept: '' },
|
|
47
|
+
options === null || options === void 0 ? void 0 : options.headers,
|
|
48
|
+
),
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.PaymentOrders = PaymentOrders;
|
|
54
|
+
class PaymentOrdersPage extends pagination_1.Page {}
|
|
55
|
+
exports.PaymentOrdersPage = PaymentOrdersPage;
|
|
56
|
+
//# sourceMappingURL=payment-orders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-orders.js","sourceRoot":"","sources":["../../../../resources/payment-orders/payment-orders.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,yCAAyC;AACzC,iCAA0C;AAC1C,2CAAwC;AACxC,6CAAgD;AAGhD,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,cAAS,GAAc,IAAI,qBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAkEpD,CAAC;IAhEC;;OAEG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,kBAAI,IAAI,IAAK,OAAO,EAAG,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAWD,MAAM,CACJ,EAAU,EACV,OAAuD,EAAE,EACzD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,uBAAuB,EAAE,EAAE,kBAAI,IAAI,IAAK,OAAO,EAAG,CAAC;IACvE,CAAC;IAOD,IAAI,CACF,QAAsD,EAAE,EACxD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,iBAAiB,kBAAI,KAAK,IAAK,OAAO,EAAG,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,IAAmC,EAAE,OAA6B;QAC5E,OAAO,IAAI,CAAC,IAAI,CAAC,kCAAkC,gCACjD,IAAI,IACD,OAAO,KACV,OAAO,kBAAI,MAAM,EAAE,EAAE,IAAK,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,KAC1C,CAAC;IACL,CAAC;CACF;AAnED,sCAmEC;AAED,MAAa,iBAAkB,SAAQ,iBAAkB;CAAG;AAA5D,8CAA4D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as Core from '../../core';
|
|
2
|
+
import { APIResource } from '../../resource';
|
|
3
|
+
import { Page, PageParams } from '../../pagination';
|
|
4
|
+
export declare class Reversals extends APIResource {
|
|
5
|
+
list(
|
|
6
|
+
id: string,
|
|
7
|
+
query?: ReversalListParams,
|
|
8
|
+
options?: Core.RequestOptions,
|
|
9
|
+
): Core.PagePromise<ReversalsPage>;
|
|
10
|
+
list(id: string, options?: Core.RequestOptions): Core.PagePromise<ReversalsPage>;
|
|
11
|
+
}
|
|
12
|
+
export declare class ReversalsPage extends Page<Reversal> {}
|
|
13
|
+
export interface Reversal {
|
|
14
|
+
created_at?: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* This field will be true if this object exists in the live environment or false
|
|
18
|
+
* if it exists in the test environment.
|
|
19
|
+
*/
|
|
20
|
+
live_mode?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
23
|
+
* strings.
|
|
24
|
+
*/
|
|
25
|
+
metadata?: Record<string, string>;
|
|
26
|
+
object?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The ID of the relevant Payment Order.
|
|
29
|
+
*/
|
|
30
|
+
payment_order_id?: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The reason for the reversal.
|
|
33
|
+
*/
|
|
34
|
+
reason?:
|
|
35
|
+
| 'duplicate'
|
|
36
|
+
| 'incorrect_amount'
|
|
37
|
+
| 'incorrect_receiving_account'
|
|
38
|
+
| 'date_earlier_than_intended'
|
|
39
|
+
| 'date_later_than_intended';
|
|
40
|
+
/**
|
|
41
|
+
* The current status of the reversal.
|
|
42
|
+
*/
|
|
43
|
+
status?: 'completed' | 'failed' | 'pending' | 'processing' | 'returned' | 'sent';
|
|
44
|
+
updated_at?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ReversalListParams extends PageParams {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
exports.ReversalsPage = exports.Reversals = void 0;
|
|
5
|
+
const resource_1 = require('../../resource');
|
|
6
|
+
const core_1 = require('../../core');
|
|
7
|
+
const pagination_1 = require('../../pagination');
|
|
8
|
+
class Reversals extends resource_1.APIResource {
|
|
9
|
+
list(id, query = {}, options) {
|
|
10
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
11
|
+
return this.list(id, {}, query);
|
|
12
|
+
}
|
|
13
|
+
return this.getAPIList(
|
|
14
|
+
`/api/payment_orders/${id}/reversals`,
|
|
15
|
+
ReversalsPage,
|
|
16
|
+
Object.assign({ query }, options),
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Reversals = Reversals;
|
|
21
|
+
class ReversalsPage extends pagination_1.Page {}
|
|
22
|
+
exports.ReversalsPage = ReversalsPage;
|
|
23
|
+
//# sourceMappingURL=reversals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reversals.js","sourceRoot":"","sources":["../../../../resources/payment-orders/reversals.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,yCAAyC;AACzC,iCAA0C;AAC1C,6CAAgD;AAEhD,MAAa,SAAU,SAAQ,sBAAW;IAOxC,IAAI,CACF,EAAU,EACV,QAAkD,EAAE,EACpD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,EAAE,YAAY,EAAE,aAAa,kBAAI,KAAK,IAAK,OAAO,EAAG,CAAC;IACtG,CAAC;CACF;AAlBD,8BAkBC;AAED,MAAa,aAAc,SAAQ,iBAAc;CAAG;AAApD,sCAAoD"}
|
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import * as Core from '../core';
|
|
2
|
+
import { APIResource } from '../resource';
|
|
3
|
+
import { Page, PageParams } from '../pagination';
|
|
4
|
+
export declare class Returns extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a return.
|
|
7
|
+
*/
|
|
8
|
+
create(body: ReturnCreateParams, options?: Core.RequestOptions): Promise<Core.APIResponse<ReturnObject>>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a single return.
|
|
11
|
+
*/
|
|
12
|
+
retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<ReturnObject>>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a list of returns.
|
|
15
|
+
*/
|
|
16
|
+
list(query?: ReturnListParams, options?: Core.RequestOptions): Core.PagePromise<ReturnObjectsPage>;
|
|
17
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ReturnObjectsPage>;
|
|
18
|
+
}
|
|
19
|
+
export declare class ReturnObjectsPage extends Page<ReturnObject> {}
|
|
20
|
+
export interface ReturnObject {
|
|
21
|
+
/**
|
|
22
|
+
* Some returns may include additional information from the bank. In these cases,
|
|
23
|
+
* this string will be present.
|
|
24
|
+
*/
|
|
25
|
+
additional_information?: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
28
|
+
* as 1000.
|
|
29
|
+
*/
|
|
30
|
+
amount?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The return code. For ACH returns, this is the required ACH return code.
|
|
33
|
+
*/
|
|
34
|
+
code?:
|
|
35
|
+
| '901'
|
|
36
|
+
| '902'
|
|
37
|
+
| '903'
|
|
38
|
+
| '904'
|
|
39
|
+
| '905'
|
|
40
|
+
| '907'
|
|
41
|
+
| '908'
|
|
42
|
+
| '909'
|
|
43
|
+
| '910'
|
|
44
|
+
| '911'
|
|
45
|
+
| '912'
|
|
46
|
+
| '914'
|
|
47
|
+
| 'R01'
|
|
48
|
+
| 'R02'
|
|
49
|
+
| 'R03'
|
|
50
|
+
| 'R04'
|
|
51
|
+
| 'R05'
|
|
52
|
+
| 'R06'
|
|
53
|
+
| 'R07'
|
|
54
|
+
| 'R08'
|
|
55
|
+
| 'R09'
|
|
56
|
+
| 'R10'
|
|
57
|
+
| 'R11'
|
|
58
|
+
| 'R12'
|
|
59
|
+
| 'R14'
|
|
60
|
+
| 'R15'
|
|
61
|
+
| 'R16'
|
|
62
|
+
| 'R17'
|
|
63
|
+
| 'R20'
|
|
64
|
+
| 'R21'
|
|
65
|
+
| 'R22'
|
|
66
|
+
| 'R23'
|
|
67
|
+
| 'R24'
|
|
68
|
+
| 'R29'
|
|
69
|
+
| 'R31'
|
|
70
|
+
| 'R33'
|
|
71
|
+
| 'R37'
|
|
72
|
+
| 'R38'
|
|
73
|
+
| 'R39'
|
|
74
|
+
| 'R51'
|
|
75
|
+
| 'R52'
|
|
76
|
+
| 'R53'
|
|
77
|
+
| 'currencycloud'
|
|
78
|
+
| null;
|
|
79
|
+
created_at?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Currency that this transaction is denominated in.
|
|
82
|
+
*/
|
|
83
|
+
currency?:
|
|
84
|
+
| 'AED'
|
|
85
|
+
| 'AFN'
|
|
86
|
+
| 'ALL'
|
|
87
|
+
| 'AMD'
|
|
88
|
+
| 'ANG'
|
|
89
|
+
| 'AOA'
|
|
90
|
+
| 'ARS'
|
|
91
|
+
| 'AUD'
|
|
92
|
+
| 'AWG'
|
|
93
|
+
| 'AZN'
|
|
94
|
+
| 'BAM'
|
|
95
|
+
| 'BBD'
|
|
96
|
+
| 'BCH'
|
|
97
|
+
| 'BDT'
|
|
98
|
+
| 'BGN'
|
|
99
|
+
| 'BHD'
|
|
100
|
+
| 'BIF'
|
|
101
|
+
| 'BMD'
|
|
102
|
+
| 'BND'
|
|
103
|
+
| 'BOB'
|
|
104
|
+
| 'BRL'
|
|
105
|
+
| 'BSD'
|
|
106
|
+
| 'BTC'
|
|
107
|
+
| 'BTN'
|
|
108
|
+
| 'BWP'
|
|
109
|
+
| 'BYN'
|
|
110
|
+
| 'BYR'
|
|
111
|
+
| 'BZD'
|
|
112
|
+
| 'CAD'
|
|
113
|
+
| 'CDF'
|
|
114
|
+
| 'CHF'
|
|
115
|
+
| 'CLF'
|
|
116
|
+
| 'CLP'
|
|
117
|
+
| 'CNH'
|
|
118
|
+
| 'CNY'
|
|
119
|
+
| 'COP'
|
|
120
|
+
| 'CRC'
|
|
121
|
+
| 'CUC'
|
|
122
|
+
| 'CUP'
|
|
123
|
+
| 'CVE'
|
|
124
|
+
| 'CZK'
|
|
125
|
+
| 'DJF'
|
|
126
|
+
| 'DKK'
|
|
127
|
+
| 'DOP'
|
|
128
|
+
| 'DZD'
|
|
129
|
+
| 'EEK'
|
|
130
|
+
| 'EGP'
|
|
131
|
+
| 'ERN'
|
|
132
|
+
| 'ETB'
|
|
133
|
+
| 'EUR'
|
|
134
|
+
| 'FJD'
|
|
135
|
+
| 'FKP'
|
|
136
|
+
| 'GBP'
|
|
137
|
+
| 'GBX'
|
|
138
|
+
| 'GEL'
|
|
139
|
+
| 'GGP'
|
|
140
|
+
| 'GHS'
|
|
141
|
+
| 'GIP'
|
|
142
|
+
| 'GMD'
|
|
143
|
+
| 'GNF'
|
|
144
|
+
| 'GTQ'
|
|
145
|
+
| 'GYD'
|
|
146
|
+
| 'HKD'
|
|
147
|
+
| 'HNL'
|
|
148
|
+
| 'HRK'
|
|
149
|
+
| 'HTG'
|
|
150
|
+
| 'HUF'
|
|
151
|
+
| 'IDR'
|
|
152
|
+
| 'ILS'
|
|
153
|
+
| 'IMP'
|
|
154
|
+
| 'INR'
|
|
155
|
+
| 'IQD'
|
|
156
|
+
| 'IRR'
|
|
157
|
+
| 'ISK'
|
|
158
|
+
| 'JEP'
|
|
159
|
+
| 'JMD'
|
|
160
|
+
| 'JOD'
|
|
161
|
+
| 'JPY'
|
|
162
|
+
| 'KES'
|
|
163
|
+
| 'KGS'
|
|
164
|
+
| 'KHR'
|
|
165
|
+
| 'KMF'
|
|
166
|
+
| 'KPW'
|
|
167
|
+
| 'KRW'
|
|
168
|
+
| 'KWD'
|
|
169
|
+
| 'KYD'
|
|
170
|
+
| 'KZT'
|
|
171
|
+
| 'LAK'
|
|
172
|
+
| 'LBP'
|
|
173
|
+
| 'LKR'
|
|
174
|
+
| 'LRD'
|
|
175
|
+
| 'LSL'
|
|
176
|
+
| 'LTL'
|
|
177
|
+
| 'LVL'
|
|
178
|
+
| 'LYD'
|
|
179
|
+
| 'MAD'
|
|
180
|
+
| 'MDL'
|
|
181
|
+
| 'MGA'
|
|
182
|
+
| 'MKD'
|
|
183
|
+
| 'MMK'
|
|
184
|
+
| 'MNT'
|
|
185
|
+
| 'MOP'
|
|
186
|
+
| 'MRO'
|
|
187
|
+
| 'MRU'
|
|
188
|
+
| 'MTL'
|
|
189
|
+
| 'MUR'
|
|
190
|
+
| 'MVR'
|
|
191
|
+
| 'MWK'
|
|
192
|
+
| 'MXN'
|
|
193
|
+
| 'MYR'
|
|
194
|
+
| 'MZN'
|
|
195
|
+
| 'NAD'
|
|
196
|
+
| 'NGN'
|
|
197
|
+
| 'NIO'
|
|
198
|
+
| 'NOK'
|
|
199
|
+
| 'NPR'
|
|
200
|
+
| 'NZD'
|
|
201
|
+
| 'OMR'
|
|
202
|
+
| 'PAB'
|
|
203
|
+
| 'PEN'
|
|
204
|
+
| 'PGK'
|
|
205
|
+
| 'PHP'
|
|
206
|
+
| 'PKR'
|
|
207
|
+
| 'PLN'
|
|
208
|
+
| 'PYG'
|
|
209
|
+
| 'QAR'
|
|
210
|
+
| 'RON'
|
|
211
|
+
| 'RSD'
|
|
212
|
+
| 'RUB'
|
|
213
|
+
| 'RWF'
|
|
214
|
+
| 'SAR'
|
|
215
|
+
| 'SBD'
|
|
216
|
+
| 'SCR'
|
|
217
|
+
| 'SDG'
|
|
218
|
+
| 'SEK'
|
|
219
|
+
| 'SGD'
|
|
220
|
+
| 'SHP'
|
|
221
|
+
| 'SKK'
|
|
222
|
+
| 'SLL'
|
|
223
|
+
| 'SOS'
|
|
224
|
+
| 'SRD'
|
|
225
|
+
| 'SSP'
|
|
226
|
+
| 'STD'
|
|
227
|
+
| 'SVC'
|
|
228
|
+
| 'SYP'
|
|
229
|
+
| 'SZL'
|
|
230
|
+
| 'THB'
|
|
231
|
+
| 'TJS'
|
|
232
|
+
| 'TMM'
|
|
233
|
+
| 'TMT'
|
|
234
|
+
| 'TND'
|
|
235
|
+
| 'TOP'
|
|
236
|
+
| 'TRY'
|
|
237
|
+
| 'TTD'
|
|
238
|
+
| 'TWD'
|
|
239
|
+
| 'TZS'
|
|
240
|
+
| 'UAH'
|
|
241
|
+
| 'UGX'
|
|
242
|
+
| 'USD'
|
|
243
|
+
| 'UYU'
|
|
244
|
+
| 'UZS'
|
|
245
|
+
| 'VEF'
|
|
246
|
+
| 'VES'
|
|
247
|
+
| 'VND'
|
|
248
|
+
| 'VUV'
|
|
249
|
+
| 'WST'
|
|
250
|
+
| 'XAF'
|
|
251
|
+
| 'XAG'
|
|
252
|
+
| 'XAU'
|
|
253
|
+
| 'XBA'
|
|
254
|
+
| 'XBB'
|
|
255
|
+
| 'XBC'
|
|
256
|
+
| 'XBD'
|
|
257
|
+
| 'XCD'
|
|
258
|
+
| 'XDR'
|
|
259
|
+
| 'XFU'
|
|
260
|
+
| 'XOF'
|
|
261
|
+
| 'XPD'
|
|
262
|
+
| 'XPF'
|
|
263
|
+
| 'XPT'
|
|
264
|
+
| 'XTS'
|
|
265
|
+
| 'YER'
|
|
266
|
+
| 'ZAR'
|
|
267
|
+
| 'ZMK'
|
|
268
|
+
| 'ZMW'
|
|
269
|
+
| 'ZWD'
|
|
270
|
+
| 'ZWL'
|
|
271
|
+
| 'ZWN'
|
|
272
|
+
| 'ZWR';
|
|
273
|
+
/**
|
|
274
|
+
* If the return code is `R14` or `R15` this is the date the deceased counterparty
|
|
275
|
+
* passed away.
|
|
276
|
+
*/
|
|
277
|
+
date_of_death?: string | null;
|
|
278
|
+
id?: string;
|
|
279
|
+
/**
|
|
280
|
+
* The ID of the relevant Internal Account.
|
|
281
|
+
*/
|
|
282
|
+
internal_account_id?: string | null;
|
|
283
|
+
/**
|
|
284
|
+
* This field will be true if this object exists in the live environment or false
|
|
285
|
+
* if it exists in the test environment.
|
|
286
|
+
*/
|
|
287
|
+
live_mode?: boolean;
|
|
288
|
+
object?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Often the bank will provide an explanation for the return, which is a short
|
|
291
|
+
* human readable string.
|
|
292
|
+
*/
|
|
293
|
+
reason?: string | null;
|
|
294
|
+
/**
|
|
295
|
+
* An array of Payment Reference objects.
|
|
296
|
+
*/
|
|
297
|
+
reference_numbers?: Array<ReturnObject.ReferenceNumbers>;
|
|
298
|
+
/**
|
|
299
|
+
* The ID of the object being returned or `null`.
|
|
300
|
+
*/
|
|
301
|
+
returnable_id?: string | null;
|
|
302
|
+
/**
|
|
303
|
+
* The type of object being returned or `null`.
|
|
304
|
+
*/
|
|
305
|
+
returnable_type?: 'incoming_payment_detail' | 'paper_item' | 'payment_order' | 'reversal' | null;
|
|
306
|
+
/**
|
|
307
|
+
* The role of the return, can be `originating` or `receiving`.
|
|
308
|
+
*/
|
|
309
|
+
role?: 'originating' | 'receiving';
|
|
310
|
+
/**
|
|
311
|
+
* The current status of the return.
|
|
312
|
+
*/
|
|
313
|
+
status?: 'completed' | 'failed' | 'pending' | 'processing' | 'sent';
|
|
314
|
+
/**
|
|
315
|
+
* The ID of the relevant Transaction or `null`.
|
|
316
|
+
*/
|
|
317
|
+
transaction_id?: string | null;
|
|
318
|
+
/**
|
|
319
|
+
* The ID of the relevant Transaction Line Item or `null`.
|
|
320
|
+
*/
|
|
321
|
+
transaction_line_item_id?: string | null;
|
|
322
|
+
/**
|
|
323
|
+
* The type of return. Can be one of: `ach`, `paper_item`, `eft`, `wire`.
|
|
324
|
+
*/
|
|
325
|
+
type?: 'ach' | 'ach_noc' | 'au_becs' | 'bacs' | 'eft' | 'manual' | 'paper_item' | 'wire';
|
|
326
|
+
updated_at?: string;
|
|
327
|
+
}
|
|
328
|
+
export declare namespace ReturnObject {
|
|
329
|
+
interface ReferenceNumbers {
|
|
330
|
+
created_at?: string;
|
|
331
|
+
id?: string;
|
|
332
|
+
/**
|
|
333
|
+
* This field will be true if this object exists in the live environment or false
|
|
334
|
+
* if it exists in the test environment.
|
|
335
|
+
*/
|
|
336
|
+
live_mode?: boolean;
|
|
337
|
+
object?: string;
|
|
338
|
+
/**
|
|
339
|
+
* The vendor reference number.
|
|
340
|
+
*/
|
|
341
|
+
reference_number?: string;
|
|
342
|
+
/**
|
|
343
|
+
* The type of the reference number. Referring to the vendor payment id.
|
|
344
|
+
*/
|
|
345
|
+
reference_number_type?:
|
|
346
|
+
| 'ach_original_trace_number'
|
|
347
|
+
| 'ach_trace_number'
|
|
348
|
+
| 'bankprov_payment_id'
|
|
349
|
+
| 'bnk_dev_prenotification_id'
|
|
350
|
+
| 'bnk_dev_transfer_id'
|
|
351
|
+
| 'bofa_end_to_end_id'
|
|
352
|
+
| 'bofa_transaction_id'
|
|
353
|
+
| 'check_number'
|
|
354
|
+
| 'cross_river_payment_id'
|
|
355
|
+
| 'cross_river_transaction_id'
|
|
356
|
+
| 'currencycloud_conversion_id'
|
|
357
|
+
| 'currencycloud_payment_id'
|
|
358
|
+
| 'dwolla_transaction_id'
|
|
359
|
+
| 'eft_trace_number'
|
|
360
|
+
| 'fedwire_imad'
|
|
361
|
+
| 'fedwire_omad'
|
|
362
|
+
| 'first_republic_internal_id'
|
|
363
|
+
| 'goldman_sachs_collection_request_id'
|
|
364
|
+
| 'goldman_sachs_end_to_end_id'
|
|
365
|
+
| 'goldman_sachs_payment_request_id'
|
|
366
|
+
| 'goldman_sachs_request_id'
|
|
367
|
+
| 'goldman_sachs_unique_payment_id'
|
|
368
|
+
| 'jpmc_ccn'
|
|
369
|
+
| 'jpmc_end_to_end_id'
|
|
370
|
+
| 'jpmc_firm_root_id'
|
|
371
|
+
| 'jpmc_p3_id'
|
|
372
|
+
| 'jpmc_payment_information_id'
|
|
373
|
+
| 'lob_check_id'
|
|
374
|
+
| 'other'
|
|
375
|
+
| 'partial_swift_mir'
|
|
376
|
+
| 'pnc_clearing_reference'
|
|
377
|
+
| 'pnc_instruction_id'
|
|
378
|
+
| 'pnc_multipayment_id'
|
|
379
|
+
| 'pnc_payment_trace_id'
|
|
380
|
+
| 'rtp_instruction_id'
|
|
381
|
+
| 'signet_api_reference_id'
|
|
382
|
+
| 'signet_confirmation_id'
|
|
383
|
+
| 'signet_request_id'
|
|
384
|
+
| 'silvergate_payment_id'
|
|
385
|
+
| 'swift_mir'
|
|
386
|
+
| 'swift_uetr'
|
|
387
|
+
| 'usbank_transaction_id'
|
|
388
|
+
| 'wells_fargo_payment_id'
|
|
389
|
+
| 'wells_fargo_trace_number';
|
|
390
|
+
updated_at?: string;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
export interface ReturnCreateParams {
|
|
394
|
+
/**
|
|
395
|
+
* The ID of the object being returned or `null`.
|
|
396
|
+
*/
|
|
397
|
+
returnable_id: string | null;
|
|
398
|
+
/**
|
|
399
|
+
* The type of object being returned. Currently, this may only be
|
|
400
|
+
* incoming_payment_detail.
|
|
401
|
+
*/
|
|
402
|
+
returnable_type: 'incoming_payment_detail';
|
|
403
|
+
/**
|
|
404
|
+
* Some returns may include additional information from the bank. In these cases,
|
|
405
|
+
* this string will be present.
|
|
406
|
+
*/
|
|
407
|
+
additional_information?: string | null;
|
|
408
|
+
/**
|
|
409
|
+
* The return code. For ACH returns, this is the required ACH return code.
|
|
410
|
+
*/
|
|
411
|
+
code?:
|
|
412
|
+
| '901'
|
|
413
|
+
| '902'
|
|
414
|
+
| '903'
|
|
415
|
+
| '904'
|
|
416
|
+
| '905'
|
|
417
|
+
| '907'
|
|
418
|
+
| '908'
|
|
419
|
+
| '909'
|
|
420
|
+
| '910'
|
|
421
|
+
| '911'
|
|
422
|
+
| '912'
|
|
423
|
+
| '914'
|
|
424
|
+
| 'R01'
|
|
425
|
+
| 'R02'
|
|
426
|
+
| 'R03'
|
|
427
|
+
| 'R04'
|
|
428
|
+
| 'R05'
|
|
429
|
+
| 'R06'
|
|
430
|
+
| 'R07'
|
|
431
|
+
| 'R08'
|
|
432
|
+
| 'R09'
|
|
433
|
+
| 'R10'
|
|
434
|
+
| 'R11'
|
|
435
|
+
| 'R12'
|
|
436
|
+
| 'R14'
|
|
437
|
+
| 'R15'
|
|
438
|
+
| 'R16'
|
|
439
|
+
| 'R17'
|
|
440
|
+
| 'R20'
|
|
441
|
+
| 'R21'
|
|
442
|
+
| 'R22'
|
|
443
|
+
| 'R23'
|
|
444
|
+
| 'R24'
|
|
445
|
+
| 'R29'
|
|
446
|
+
| 'R31'
|
|
447
|
+
| 'R33'
|
|
448
|
+
| 'R37'
|
|
449
|
+
| 'R38'
|
|
450
|
+
| 'R39'
|
|
451
|
+
| 'R51'
|
|
452
|
+
| 'R52'
|
|
453
|
+
| 'R53'
|
|
454
|
+
| 'currencycloud'
|
|
455
|
+
| null;
|
|
456
|
+
/**
|
|
457
|
+
* If the return code is `R14` or `R15` this is the date the deceased counterparty
|
|
458
|
+
* passed away.
|
|
459
|
+
*/
|
|
460
|
+
date_of_death?: string | null;
|
|
461
|
+
/**
|
|
462
|
+
* An optional description of the reason for the return. This is for internal usage
|
|
463
|
+
* and will not be transmitted to the bank.”
|
|
464
|
+
*/
|
|
465
|
+
reason?: string | null;
|
|
466
|
+
}
|
|
467
|
+
export interface ReturnListParams extends PageParams {
|
|
468
|
+
/**
|
|
469
|
+
* Specify `counterparty_id` if you wish to see returns that occurred with a
|
|
470
|
+
* specific counterparty.
|
|
471
|
+
*/
|
|
472
|
+
counterparty_id?: string;
|
|
473
|
+
/**
|
|
474
|
+
* Specify `internal_account_id` if you wish to see returns to/from a specific
|
|
475
|
+
* account.
|
|
476
|
+
*/
|
|
477
|
+
internal_account_id?: string;
|
|
478
|
+
/**
|
|
479
|
+
* The ID of a valid returnable. Must be accompanied by `returnable_type`.
|
|
480
|
+
*/
|
|
481
|
+
returnable_id?: string;
|
|
482
|
+
/**
|
|
483
|
+
* One of `payment_order`, `paper_item`, `reversal`, or `incoming_payment_detail`.
|
|
484
|
+
* Must be accompanied by `returnable_id`.
|
|
485
|
+
*/
|
|
486
|
+
returnable_type?: 'incoming_payment_detail' | 'paper_item' | 'payment_order' | 'reversal';
|
|
487
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
exports.ReturnObjectsPage = exports.Returns = void 0;
|
|
5
|
+
const resource_1 = require('../resource');
|
|
6
|
+
const core_1 = require('../core');
|
|
7
|
+
const pagination_1 = require('../pagination');
|
|
8
|
+
class Returns extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a return.
|
|
11
|
+
*/
|
|
12
|
+
create(body, options) {
|
|
13
|
+
return this.post('/api/returns', Object.assign({ body }, options));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get a single return.
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id, options) {
|
|
19
|
+
return this.get(`/api/returns/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
list(query = {}, options) {
|
|
22
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
23
|
+
return this.list({}, query);
|
|
24
|
+
}
|
|
25
|
+
return this.getAPIList('/api/returns', ReturnObjectsPage, Object.assign({ query }, options));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Returns = Returns;
|
|
29
|
+
class ReturnObjectsPage extends pagination_1.Page {}
|
|
30
|
+
exports.ReturnObjectsPage = ReturnObjectsPage;
|
|
31
|
+
//# sourceMappingURL=returns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"returns.js","sourceRoot":"","sources":["../../../resources/returns.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,yCAAyC;AACzC,iCAA0C;AAC1C,6CAAgD;AAEhD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,kBAAI,IAAI,IAAK,OAAO,EAAG,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAOD,IAAI,CACF,QAAgD,EAAE,EAClD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,iBAAiB,kBAAI,KAAK,IAAK,OAAO,EAAG,CAAC;IACnF,CAAC;CACF;AA9BD,0BA8BC;AAED,MAAa,iBAAkB,SAAQ,iBAAkB;CAAG;AAA5D,8CAA4D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-level.js","sourceRoot":"","sources":["../../../resources/top-level.ts"],"names":[],"mappings":";AAAA,qDAAqD"}
|