Comment on page
API lấy giao dịch
Dùng để lấy một hoặc nhiều giao dịch ngân hàng
Một số lưu ý trước khi bắt đầu với các API liên quan tới webhook:
- 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/transactions
Lấy giao dịch 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/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/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/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();
get
https://oauth.casso.vn
/v2/transactions/:id
Lấy chi tiết một giao dịch
CURL
PHP
JAVA
curl --location --request GET 'https://oauth.casso.vn/v2/transactions/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/transactions/12",
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/transactions/12")
.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 28d ago