After successfully linking an account, you can retrieve its information using the following endpoints:
-
Get account details:
GET /api/v2/accounts/{id}/
-
Get account balances:
GET /api/v2/accounts/{id}/balances/
-
Get account details:
GET /api/v2/accounts/{id}/details/
-
Get account transactions:
GET /api/v2/accounts/{id}/transactions/
However, to ensure a smooth process and avoid any potential issues or errors, it is advisable to perform additional checks before retrieving the account's information. These checks should be performed either before the initial request for account information after the user has linked their account or after the user has been redirected back to your service following the authentication flow.
Here is a recommended checklist that you can implement into your application:
- Make a request to the requisition endpoint:
curl -X GET "https://bankaccountdata.gocardless.com/api/v2/requisitions/REQUISITION_ID/" \
-H "accept: application/json" \
-H "Authorization: Bearer ACCESS_TOKEN"
-
Inspect the response and ensure that:
- The requisition's status is "LN"
- The response contains one or multiple account IDs in the "accounts" array
-
Make a request to the account's endpoint:
curl -X GET "https://bankaccountdata.gocardless.com/api/v2/accounts/ACCOUNT_ID/" \
-H "accept: application/json" \
-H "Authorization: Bearer ACCESS_TOKEN"
- Verify the response and ensure that the account's status is "READY".
If the requisition's status is "LN" and the account's status is "READY", you can confidently proceed to request the account's details, balances, and transactions.
Implementing these checks will help prevent any potential issues and ensure a successful retrieval of the account's information.
Comments
0 comments
Please sign in to leave a comment.