-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcredit-configuration.ts
99 lines (83 loc) · 2.54 KB
/
credit-configuration.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
// 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';
export class CreditConfiguration extends APIResource {
/**
* Get an Account's credit configuration
*/
retrieve(
financialAccountToken: string,
options?: Core.RequestOptions,
): Core.APIPromise<FinancialAccountCreditConfig> {
return this._client.get(`/v1/financial_accounts/${financialAccountToken}/credit_configuration`, options);
}
/**
* Update an account's credit configuration
*/
update(
financialAccountToken: string,
body?: CreditConfigurationUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<FinancialAccountCreditConfig>;
update(
financialAccountToken: string,
options?: Core.RequestOptions,
): Core.APIPromise<FinancialAccountCreditConfig>;
update(
financialAccountToken: string,
body: CreditConfigurationUpdateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<FinancialAccountCreditConfig> {
if (isRequestOptions(body)) {
return this.update(financialAccountToken, {}, body);
}
return this._client.patch(`/v1/financial_accounts/${financialAccountToken}/credit_configuration`, {
body,
...options,
});
}
}
export interface FinancialAccountCreditConfig {
/**
* Globally unique identifier for the account
*/
account_token: string;
/**
* Reason for the financial account being marked as Charged Off
*/
charged_off_reason: 'DELINQUENT' | 'FRAUD' | null;
credit_limit: number | null;
/**
* Globally unique identifier for the credit product
*/
credit_product_token: string | null;
external_bank_account_token: string | null;
/**
* State of the financial account
*/
financial_account_state: 'PENDING' | 'CURRENT' | 'DELINQUENT' | 'CHARGED_OFF';
is_spend_blocked: boolean;
/**
* Tier assigned to the financial account
*/
tier: string | null;
}
export interface CreditConfigurationUpdateParams {
credit_limit?: number;
/**
* Globally unique identifier for the credit product
*/
credit_product_token?: string;
external_bank_account_token?: string;
/**
* Tier to assign to a financial account
*/
tier?: string;
}
export declare namespace CreditConfiguration {
export {
type FinancialAccountCreditConfig as FinancialAccountCreditConfig,
type CreditConfigurationUpdateParams as CreditConfigurationUpdateParams,
};
}