Comment on page
API lấy thông tin tài khoản ngân hàng
Truy vấn một hoặc nhiều tài khoản ngân hàng đã kết nối và danh sách giao dịch của tài khoản đó.
Một số lưu ý trước khi bắt đầu:
- Một tài khoản Casso đã liên kết một tài khoản ngân hàng. Để test với API này có thể sử dụng tài khoản demo.
- Bạn cần có API Key hoặc Access token từ Oauth 2.0 của Casso để thiết lập ở trường Authorization HTTP Header.
get
https://oauth.casso.vn
/v2/accounts
Lấy danh sách các tài khoản ngân hàng
CURL
PHP
JAVA
curl --location --request GET 'https://oauth.casso.vn/v2/accounts \
--header 'Authorization: Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2"'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://oauth.casso.vn/v2/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2">",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://oauth.casso.vn/v2/accounts")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2">")
.build();
Response response = client.newCall(request).execute();
get
https://oauth.casso.vn
/v2/accounts/:accountId
Chi tiết tài khoản ngân hàng
CURL
PHP
JAVA
curl --location --request GET 'https://oauth.casso.vn/v2/accounts/123 \
--header 'Authorization: Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2"'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://oauth.casso.vn/v2/accounts/123",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2">",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://oauth.casso.vn/v2/accounts/123")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2">")
.build();
Response response = client.newCall(request).execute();
get
https://oauth.casso.vn
/v2/accounts/:accountId/transactions
Danh sách giao dịch của một tài khoản ngân hàng
Tham số | Mô tả | Gá trị mặc định |
fromDate | Thời gian bắt đầu bạn muốn lấy giao dịch | 7 ngày gần nhất |
toDate | Thời gian kết thúc bạn muốn lấy giao dịch | Hôm nay |
page | Số thứ tự trang | 1 |
pageSize | Số giao dịch trên một trang | 10 |
sort | Sắp xếp giao dịch, các giá trị gồm: ASC, DESC. Với ASC là tăng dần còn DESC là giảm dần. | ASC |
- Nếu tham số nào không tồn tại thì sẽ lấy giá trị mặc định.
CURL
PHP
JAVA
curl --location --request GET 'https://oauth.casso.vn/v2/accounts/123/transactions?fromDate=2021-04-01&toDate=2022-07-05&page=4&pageSize=20&sort=ASC' \
--header 'Authorization: Apikey <API Key của bạn> hoặc Bearer <access token từ OAuth2>'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://oauth.casso.vn/v2/accounts/123/transactions?fromDate=2021-04-01&page=4&pageSize=20&sort=ASC",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2">",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://oauth.casso.vn/v2/accounts/123/transactions?fromDate=2021-04-01&page=4&pageSize=20&sort=ASC")
.get()
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Apikey <"API Key của bạn"> hoặc Bearer <"access token từ OAuth2">")
.build();
Response response = client.newCall(request).execute();
Last modified 8mo ago