-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbalances.ts
119 lines (102 loc) · 3.15 KB
/
balances.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
// 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 { SinglePage } from '../../pagination';
export class Balances extends APIResource {
/**
* Get the balances for a given card.
*/
list(
cardToken: string,
query?: BalanceListParams,
options?: Core.RequestOptions,
): Core.PagePromise<BalanceListResponsesSinglePage, BalanceListResponse>;
list(
cardToken: string,
options?: Core.RequestOptions,
): Core.PagePromise<BalanceListResponsesSinglePage, BalanceListResponse>;
list(
cardToken: string,
query: BalanceListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<BalanceListResponsesSinglePage, BalanceListResponse> {
if (isRequestOptions(query)) {
return this.list(cardToken, {}, query);
}
return this._client.getAPIList(`/v1/cards/${cardToken}/balances`, BalanceListResponsesSinglePage, {
query,
...options,
});
}
}
export class BalanceListResponsesSinglePage extends SinglePage<BalanceListResponse> {}
/**
* Balance of a Financial Account
*/
export interface BalanceListResponse {
/**
* Globally unique identifier for the financial account that holds this balance.
*/
token: string;
/**
* Funds available for spend in the currency's smallest unit (e.g., cents for USD)
*/
available_amount: number;
/**
* Date and time for when the balance was first created.
*/
created: string;
/**
* 3-digit alphabetic ISO 4217 code for the local currency of the balance.
*/
currency: string;
/**
* Globally unique identifier for the last financial transaction event that
* impacted this balance.
*/
last_transaction_event_token: string;
/**
* Globally unique identifier for the last financial transaction that impacted this
* balance.
*/
last_transaction_token: string;
/**
* Funds not available for spend due to card authorizations or pending ACH release.
* Shown in the currency's smallest unit (e.g., cents for USD).
*/
pending_amount: number;
/**
* The sum of available and pending balance in the currency's smallest unit (e.g.,
* cents for USD).
*/
total_amount: number;
/**
* Type of financial account.
*/
type: 'ISSUING' | 'OPERATING' | 'RESERVE';
/**
* Date and time for when the balance was last updated.
*/
updated: string;
}
export interface BalanceListParams {
/**
* UTC date of the balance to retrieve. Defaults to latest available balance
*/
balance_date?: string;
/**
* Balance after a given financial event occured. For example, passing the
* event_token of a $5 CARD_CLEARING financial event will return a balance
* decreased by $5
*/
last_transaction_event_token?: string;
}
Balances.BalanceListResponsesSinglePage = BalanceListResponsesSinglePage;
export declare namespace Balances {
export {
type BalanceListResponse as BalanceListResponse,
BalanceListResponsesSinglePage as BalanceListResponsesSinglePage,
type BalanceListParams as BalanceListParams,
};
}