-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathline-items.ts
200 lines (176 loc) · 5.65 KB
/
line-items.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../../resource';
import { isRequestOptions } from '../../../core';
import * as Core from '../../../core';
import { CursorPage, type CursorPageParams } from '../../../pagination';
export class LineItems extends APIResource {
/**
* List the line items for a given statement within a given financial account.
*/
list(
financialAccountToken: string,
statementToken: string,
query?: LineItemListParams,
options?: Core.RequestOptions,
): Core.PagePromise<StatementLineItemsDataCursorPage, StatementLineItems.Data>;
list(
financialAccountToken: string,
statementToken: string,
options?: Core.RequestOptions,
): Core.PagePromise<StatementLineItemsDataCursorPage, StatementLineItems.Data>;
list(
financialAccountToken: string,
statementToken: string,
query: LineItemListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<StatementLineItemsDataCursorPage, StatementLineItems.Data> {
if (isRequestOptions(query)) {
return this.list(financialAccountToken, statementToken, {}, query);
}
return this._client.getAPIList(
`/v1/financial_accounts/${financialAccountToken}/statements/${statementToken}/line_items`,
StatementLineItemsDataCursorPage,
{ query, ...options },
);
}
}
export class StatementLineItemsDataCursorPage extends CursorPage<StatementLineItems.Data> {}
// Here for back compatibility
export const LineItemListResponsesCursorPage = StatementLineItemsDataCursorPage;
export interface StatementLineItems {
data: Array<StatementLineItems.Data>;
has_more: boolean;
}
export namespace StatementLineItems {
export interface Data {
/**
* Globally unique identifier for a Statement Line Item
*/
token: string;
/**
* Transaction amount in cents
*/
amount: number;
category:
| 'ACH'
| 'BALANCE_OR_FUNDING'
| 'CARD'
| 'EXTERNAL_ACH'
| 'EXTERNAL_CHECK'
| 'EXTERNAL_TRANSFER'
| 'EXTERNAL_WIRE'
| 'MANAGEMENT_ADJUSTMENT'
| 'MANAGEMENT_DISPUTE'
| 'MANAGEMENT_FEE'
| 'MANAGEMENT_REWARD';
/**
* Timestamp of when the line item was generated
*/
created: string;
/**
* 3-digit alphabetic ISO 4217 code for the settling currency of the transaction
*/
currency: string;
/**
* Date that the transaction effected the account balance
*/
effective_date: string;
event_type:
| 'ACH_ORIGINATION_CANCELLED'
| 'ACH_ORIGINATION_INITIATED'
| 'ACH_ORIGINATION_PROCESSED'
| 'ACH_ORIGINATION_RELEASED'
| 'ACH_ORIGINATION_REVIEWED'
| 'ACH_ORIGINATION_SETTLED'
| 'ACH_RECEIPT_PROCESSED'
| 'ACH_RECEIPT_SETTLED'
| 'ACH_RETURN_INITIATED'
| 'ACH_RETURN_PROCESSED'
| 'ACH_RETURN_SETTLED'
| 'AUTHORIZATION'
| 'AUTHORIZATION_ADVICE'
| 'AUTHORIZATION_EXPIRY'
| 'AUTHORIZATION_REVERSAL'
| 'BALANCE_INQUIRY'
| 'BILLING_ERROR'
| 'BILLING_ERROR_REVERSAL'
| 'CARD_TO_CARD'
| 'CASH_BACK'
| 'CASH_BACK_REVERSAL'
| 'CLEARING'
| 'CORRECTION_CREDIT'
| 'CORRECTION_DEBIT'
| 'CREDIT_AUTHORIZATION'
| 'CREDIT_AUTHORIZATION_ADVICE'
| 'CURRENCY_CONVERSION'
| 'CURRENCY_CONVERSION_REVERSAL'
| 'DISPUTE_WON'
| 'EXTERNAL_ACH_CANCELED'
| 'EXTERNAL_ACH_INITIATED'
| 'EXTERNAL_ACH_RELEASED'
| 'EXTERNAL_ACH_REVERSED'
| 'EXTERNAL_ACH_SETTLED'
| 'EXTERNAL_CHECK_CANCELED'
| 'EXTERNAL_CHECK_INITIATED'
| 'EXTERNAL_CHECK_RELEASED'
| 'EXTERNAL_CHECK_REVERSED'
| 'EXTERNAL_CHECK_SETTLED'
| 'EXTERNAL_TRANSFER_CANCELED'
| 'EXTERNAL_TRANSFER_INITIATED'
| 'EXTERNAL_TRANSFER_RELEASED'
| 'EXTERNAL_TRANSFER_REVERSED'
| 'EXTERNAL_TRANSFER_SETTLED'
| 'EXTERNAL_WIRE_CANCELED'
| 'EXTERNAL_WIRE_INITIATED'
| 'EXTERNAL_WIRE_RELEASED'
| 'EXTERNAL_WIRE_REVERSED'
| 'EXTERNAL_WIRE_SETTLED'
| 'FINANCIAL_AUTHORIZATION'
| 'FINANCIAL_CREDIT_AUTHORIZATION'
| 'INTEREST'
| 'INTEREST_REVERSAL'
| 'INTERNAL_ADJUSTMENT'
| 'LATE_PAYMENT'
| 'LATE_PAYMENT_REVERSAL'
| 'PROVISIONAL_CREDIT'
| 'PROVISIONAL_CREDIT_REVERSAL'
| 'RETURN'
| 'RETURN_REVERSAL'
| 'TRANSFER'
| 'TRANSFER_INSUFFICIENT_FUNDS'
| 'RETURNED_PAYMENT'
| 'RETURNED_PAYMENT_REVERSAL';
/**
* Globally unique identifier for a financial account
*/
financial_account_token: string;
/**
* Globally unique identifier for a financial transaction event
*/
financial_transaction_event_token: string;
/**
* Globally unique identifier for a financial transaction
*/
financial_transaction_token: string;
/**
* Globally unique identifier for a card
*/
card_token?: string;
descriptor?: string;
}
}
export interface LineItemListResponse extends StatementLineItems.Data {}
export interface LineItemListParams extends CursorPageParams {}
LineItems.StatementLineItemsDataCursorPage = StatementLineItemsDataCursorPage;
// Here for back compatibility
LineItems.LineItemListResponsesCursorPage = LineItemListResponsesCursorPage;
export declare namespace LineItems {
export {
type StatementLineItems as StatementLineItems,
StatementLineItemsDataCursorPage as StatementLineItemsDataCursorPage,
type LineItemListParams as LineItemListParams,
// Here for back compatibility
type LineItemListResponse as LineItemListResponse,
LineItemListResponsesCursorPage as LineItemListResponsesCursorPage,
};
}