Casso Developer
English (v2 new)
English (v2 new)
  • General
  • Connect to Casso via Webhook
    • Manual Webhook Setup
    • Xử lý sự kiện Webhook
  • Sử dụng API Casso
    • Chứng thực API
      • Tạo API Key thủ công
      • Tích hợp OAuth2
    • Danh sách API
      • API lấy thông tin user
      • API thiết lập webhook
      • API lấy giao dịch
      • API check giao dịch mới
  • Tài nguyên khác
    • Tích hợp xác nhận thanh toán
    • Change log
Powered by GitBook
On this page
  • Trước khi bắt đầu
  • Lấy thông tin user

Was this helpful?

  1. Sử dụng API Casso
  2. Danh sách API

API lấy thông tin user

Dùng để lấy thông tin người dùng như: thông tin tài khoản, thông tin doanh nghiệp, danh sách các ngân hàng liên kết.

PreviousDanh sách APINextAPI thiết lập webhook

Last updated 3 years ago

Was this helpful?

Trước khi bắt đầu

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 đã 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ó hoặc để thiết lập ở trường Authorization HTTP Header.

Lấy thông tin user

GET https://oauth.casso.vn/v2/userInfo

Lấy chi tiết thông tin tài khoản như: email, thông tin doanh nghiệp và thông tin tài khoản ngân hàng liên kết.

Headers

Name
Type
Description

Authorization

string

Bearer <"access token từ Oauth2"> hoặc Apikey <"API key của bạn">

{
    "error": 0,
    "message": "success",
    "data": {
        "user": {
            "id": 1553,
            "email": "haonh@magik.vn"
        },
        "business": {
            "id": 1540,
            "name": "Hữu Hảo"
        },
        "bankAccs": [
            {
                "id": 69,
                "bank": {
                    "bin": 970416,
                    "codeName": "acb_digi"
                },
                "bankAccountName": null,
                "bankSubAccId": "17271687",
                "connectStatus": 1,
                "planStatus": 1
            },
            {
                "id": 63,
                "bank": {
                    "bin": 970454,
                    "codeName": "timoplus"
                },
                "bankAccountName": null,
                "bankSubAccId": "8007041023848",
                "connectStatus": 1,
                "planStatus": 0
            }
        ]
    }
}
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}

Ví dụ:

curl --location --request GET 'https://oauth.casso.vn/v2/userInfo \
--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/userInfo",
  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/userInfo")
  .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();

Mẹo: Bạn có thể sử dụng thông tin phản hồi của API này trong trường bankAccs để có thể tạo cho mình các mã tương ứng với các thông tin phản hồi này.

Casso
API Key
Access token từ Oauth 2.0 của Casso
VietQR code