Skip to content
IN PROGRESS

This site is under active development. The sandbox is coming soon.

This is an independent, unofficial personal learning project. It does not represent any bank, financial institution, or regulator.

Authentication & authorization

Every API request must carry an access token. Tokens are obtained through the OAuth 2.0 authorization code flow, and public clients must use PKCE.

  1. The application redirects the user to the authorization endpoint with client_id, redirect_uri, scope, and state.
  2. The user authenticates on the bank’s page and confirms the requested scope.
  3. The bank redirects back to redirect_uri with an authorization code.
  4. The application exchanges the authorization code for an access token on its server.
App ──authorization request──▶ Authorization server ──login/consent──▶ User
App ◀──authorization code──── Authorization server
App ──token exchange──▶ Token endpoint ──▶ access_token + refresh_token

Access tokens are valid for one hour by default. After they expire, use the refresh_token to obtain a new token without prompting the user again.

Terminal window
curl -X POST https://api.openbanking.org.cn/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token" \
-d "refresh_token=$REFRESH_TOKEN" \
-d "client_id=$CLIENT_ID"
Scope Description
accounts Read basic account information
balances Read account balances
transactions Read transaction details
payments Initiate payment instructions

Users can revoke authorization at any time from their banking app. Your application should listen for revocation events and delete locally stored tokens.

Terminal window
curl -X POST https://api.openbanking.org.cn/oauth/revoke \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "token=$ACCESS_TOKEN" \
-d "client_id=$CLIENT_ID"