Account Balance
curl --request GET \ --url https://api.ztlpay.io/api/v2/accounts/example/balance \ --header 'Authorization: Bearer <token>' \ --header 'PSU-IP-Address: 192.158.1.38' \ --header 'PSU-User-Agent: Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/63.0' \ --header 'consent-id: 3a797348-ef0c-4f52-b821-fdfcdb98c4d9'Retrieve the current available and booked balance for the account specified.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The ID of the account, as retrieved from the list of accounts. The account ID is sometimes the same as the account bban, but this is not always the case. Also, the account ID may change each time a consent is created/refreshed.
Header Parameters
Section titled “Header Parameters”Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9A valid consentId
Example
192.158.1.38AAA IP Address of the end-user initiating the payment. DO NOT use any other IP address than what you can collect from the current user session that uses your system (don’t use something stored in your DB). This information is used by the banks to manage traffic and handle security.
The forwarded Agent header field of the HTTP request between PSU and TPP.
Example
Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/63.0Responses
Section titled “Responses”Successfully retrieved balance
object
Unique Identifier for Account
object
object
The booked balance on the account
The currency of the booked balance
object
The available balance on the account
The currency of the available balance
Example
{ "id": "11ab5740-f8f5-1234-abcd-b90e4253b7b8", "balance": { "booked": { "amount": 150.51, "currency": "NOK" }, "available": { "amount": 100.42, "currency": "NOK" } }}Bad Request
object
INVALID_CONSENTConsent is invalidINVALID_ACCOUNTAccount is either missing or invalidACCESS_DENIEDPSU is not allowed to access resource
Unique RequestId, please provide this Id in case of support requests
The underlying reason for the error
Example
{ "failure": "INVALID_CONSENT", "ztlRequestId": "3a797348-ef0c-4f52-b821-fdfcdb98c4d9", "message": "Invalid account"}Headers
Section titled “Headers”Unique RequestId, please provide this Id in case of support requests
Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9Forbidden
object
INACTIVE_SUBSCRIPTIONThe company does not have an active subscription to ZTL’s services
Unique RequestId, please provide this Id in case of support requests
The underlying reason for the error
Example
{ "failure": "INACTIVE_SUBSCRIPTION", "ztlRequestId": "3a797348-ef0c-4f52-b821-fdfcdb98c4d9"}Headers
Section titled “Headers”Unique RequestId, please provide this Id in case of support requests
Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9Not found
object
Unique RequestId, please provide this Id in case of support requests
The underlying reason for the error
Example
{ "ztlRequestId": "3a797348-ef0c-4f52-b821-fdfcdb98c4d9", "message": "Invalid account"}Headers
Section titled “Headers”Unique RequestId, please provide this Id in case of support requests
Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9Conflict
object
Unique RequestId, please provide this Id in case of support requests
The underlying reason for the error
Example
{ "ztlRequestId": "3a797348-ef0c-4f52-b821-fdfcdb98c4d9", "message": "Invalid account"}Headers
Section titled “Headers”Unique RequestId, please provide this Id in case of support requests
Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9Internal server error
object
Unique RequestId, please provide this Id in case of support requests
The underlying reason for the error
Example
{ "ztlRequestId": "3a797348-ef0c-4f52-b821-fdfcdb98c4d9", "message": "Invalid account"}Headers
Section titled “Headers”Unique RequestId, please provide this Id in case of support requests
Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9Service unavailable
object
Unique RequestId, please provide this Id in case of support requests
The underlying reason for the error
Example
{ "ztlRequestId": "3a797348-ef0c-4f52-b821-fdfcdb98c4d9", "message": "Invalid account"}Headers
Section titled “Headers”Unique RequestId, please provide this Id in case of support requests
Example
3a797348-ef0c-4f52-b821-fdfcdb98c4d9