Skip to content

Commit aedbe8d

Browse files
authored
Added ability to filter counterparties by routing number and account number (#468)
* feat: added ability to filter counterparties by routing number and account number
1 parent cf4c79b commit aedbe8d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

resources/counterparty.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ export class Counterparties extends BaseResource {
2222

2323
public async list(params?: CounterpartyListParams): Promise<UnitResponse<AchCounterparty[]>> {
2424
const parameters = {
25-
"page[limit]": (params?.limit ? params?.limit : 100),
26-
"page[offset]": (params?.offset ? params?.offset : 0),
27-
...(params?.customerId && { "filter[customerId]": params?.customerId }),
25+
"page[limit]": (params?.limit ? params.limit : 100),
26+
"page[offset]": (params?.offset ? params.offset : 0),
27+
...(params?.customerId && { "filter[customerId]": params.customerId }),
2828
...(params?.tags && { "filter[tags]": this.customStringify(params.tags, ":") }),
29+
...(params?.routingNumber && { "filter[routingNumber]": params.routingNumber }),
30+
...(params?.accountNumber && { "filter[accountNumber]": params.accountNumber }),
2931
}
3032

3133
return this.httpGet<UnitResponse<AchCounterparty[]>>("", { params: parameters })
@@ -56,4 +58,14 @@ export interface CounterpartyListParams extends BaseListParams {
5658
* Optional. Filter Counterparties by Tags.
5759
*/
5860
tags?: Tags
61+
62+
/**
63+
* Optional. Filter Counterparties by the specified routing number.
64+
*/
65+
routingNumber?: string
66+
67+
/**
68+
* Optional. Filter Counterparties by the specified account number.
69+
*/
70+
accountNumber?: string
5971
}

tests/counterparties.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function createCounterpartyForTest(id: string) {
1212
"attributes": {
1313
"name": "Joe Doe",
1414
"routingNumber": "123456789",
15-
"accountNumber": "123",
15+
"accountNumber": "123400023",
1616
"accountType": "Checking",
1717
"type": "Person"
1818
},

0 commit comments

Comments
 (0)