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.
Authorization flow
Section titled “Authorization flow”- The application redirects the user to the authorization endpoint with
client_id,redirect_uri,scope, andstate. - The user authenticates on the bank’s page and confirms the requested scope.
- The bank redirects back to
redirect_uriwith an authorization code. - The application exchanges the authorization code for an access token on its server.
App ──authorization request──▶ Authorization server ──login/consent──▶ UserApp ◀──authorization code──── Authorization serverApp ──token exchange──▶ Token endpoint ──▶ access_token + refresh_tokenRefresh tokens
Section titled “Refresh tokens”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.
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"Scopes
Section titled “Scopes”| Scope | Description |
|---|---|
accounts |
Read basic account information |
balances |
Read account balances |
transactions |
Read transaction details |
payments |
Initiate payment instructions |
Revoke authorization
Section titled “Revoke authorization”Users can revoke authorization at any time from their banking app. Your application should listen for revocation events and delete locally stored tokens.
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"