Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section provides documentation for essential API calls that retrieve lists of accounts, account balances, account beneficiaries and other details for individual accounts. By following these guidelines, you can effectively retrieve and utilize financial data to power your applications and services.

Exchange Authorization Code for API Access Token

Before calling any other APIs, you must exchange the authorization code received during the user authorization process for an access token. This access token is necessary for authenticating subsequent API requests.

API Endpoint: https://api-openbanking.leatherback.co/auth/token

Method: POST

Request Headers:

  • Content-Type: application/x-www-form-urlencoded

Request Body (form-encoded):

Code Block
grant_type=authorization_code&code=<authorization_code>&client_id=<client_id>&password=<password>&scope=account

Sample Request:

Code Block
curl -X POST "https://api.leatherback.com/api/v1/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&code=<authorization_code>&client_id=<client_id>&password=<password>&scope=account"

Response:

Code Block
{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjVEODhEQjBDMDMyMzRENjQ5NEM1NDI0ODEzRkFBQTkxIiwiY3VzdG9tZXJJZCI6IjU1ODkzNDM2LTcyY2UtNGQzYi04N2VhLTA4ZGI1YWQwNzhiYiIsImNvbnNlbnRJZCI6IjczMDkyN2U4LTY3OWMtNDlhZC05NzljLTAzMjI0YjE1MTI2MyIsIm5iZiI6MTcxOTkxNzQ2MSwiZXhwIjoxNzE5OTE3NzYxLCJpYXQiOjE3MTk5MTc0NjF9.3dPIHz9hvP4MY1u65Xb8GkkdKR6Qv0tUJZa_2tzRrWk",
    "token_type": "Bearer",
    "expires_in": 39361,
    "id_token": "oa_stg_GBjFz9x8GwZPwPpqzsQpB4nqjkCbPFFv8sQq0U4ITw0KzRzwCu",
    "access_token_id": "a8SD5zU5Dx3cXRGHz65gdyDIVeMAbUBY3ihxkjp5ZjURb6vooz"
}

Get List of Accounts

To retrieve a comprehensive list of accounts associated with a customer, you can use the following API call:

API Endpoint: https://api/v1-openbanking.leatherback.co/accounts

Method: GET

Path Parameters:

  • CustomerId: The unique identifier of the customer.

Request Headers:

  • Authorization: Bearer {accessTokenaccess_token}

  • Content-Type: application/json (if required)

Response:

Code Block
languagejson
{
    "value": {
        "pageData": {
            "pageNumber": 1,
            "pageCount": 1,
            "pageSize": 50,
            "hasNextPage": false,
            "hasPreviousPage": false,
            "firstItemOnPage": 1,
            "lastItemOnPage": 16,
            "totalItemCount": 16
        },
        "accountsrecord": [
            
            {
                "accountId": "acc123","c3c0851b-cf46-4da2-a52b-24a221b991ca",
                "accountName": "simi Gold",
                "availableBalance": "867,940.15",
                "ledgerBalance": "864,996.25",
                "freezeRemarks": null,
                "currencyCode": "GBP",
                "currencyId": "1082ECB0-AC29-4A06-B8AD-7BC866C268AD",
                "rateByPassThresholdAmount": 10000,
                "isPrimary": false,
                "status": "Active",
                "accountExitStatus": null,
                "accountTypesystemAccountType": "SavingsCustomerAccount",
      "balance": {          "accountDetails": [
                    {
                        "accountNumber": "GB11LEAT04069100007307",
                        "bankCountry": "United Kingdom of Great Britain and Northern Ireland",
                        "currencybankCountryIso": "USDGB",
                        "amountbankName": 5000.00 "ClearBank Ltd",
                        "bankAddress": },null,
                        "ownerpaymentMethodType": { "BicSwift",
                        "customerIdpaymentMethodValue": "cust456LEATGB22XXX",
                        "nametransitNumber": "John Doe "",
                        "institutionCode": ""
      }              },
                    {
                 "accountId       "accountNumber": "acc45600007307",
                        "accountTypebankCountry": "CheckingUnited Kingdom of Great Britain and Northern Ireland",
      "balance": {                  "bankCountryIso": "GB",
                        "currencybankName": "USDClearBank Ltd",
                        "amountbankAddress": 2500.00 null,
                        },"paymentMethodType": "SortCode",
               "owner": {         "paymentMethodValue": "040691",
                        "customerIdtransitNumber": "cust456",
                        "nameinstitutionCode": "John Doe"
"
                    }
                ],
                "id": "c3c0851b-cf46-4da2-a52b-24a221b991ca",
     }     }     // Additional accounts... "dateAdded": "2023-05-22T14:53:15.2313269",
                "dateModified": "2024-06-27T08:16:25.4701998"
            },
            
        ]
    },
    "isSuccess": true,
    "error": "",
    "message": null,
    "responseCode": null
}

Get a Single Account Details

To retrieve detailed information for a specific account, use the following API call:

API Endpoint: https://api/v1-openbanking.leatherback.co/accounts/{accountId}

Method: GET

Path ParameterParameters:

  • accountId: The unique identifier of the account.

Request Headers:

  • Authorization: Bearer {accessTokenaccess_token}

  • Content-Type: application/json (if required)

Response:

Code Block
{
  "isSuccess": true,
  "error": "string",
  "message": "string",
  "responseCode": "string",
  "value": {
    "accountId": "acc123",3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "accountDetails": [
      {
  "accountType      "accountNumber": "Savingsstring",
        "balancebankCountry": {"string",
        "currencybankCountryIso": "USDstring",
        "amountbankName": 5000.00
  }"string",
        "bankAddress": "string",
  "owner": {      "paymentMethodType": "string",
        "customerIdpaymentMethodValue": "cust456string",
        "nametransitNumber": "John Doe""string",
        "institutionCode": "string"
      }
    ]
  }
}

Get a Single Account Balance

To retrieve available and ledger balance information for a specific account, use the following API call:

API Endpoint: https://api-openbanking.leatherback.co/accounts/{accountId}/balances

Method: GET

Path Parameters:

  • accountId: The unique identifier of the account.

Request Headers:

  • Authorization: Bearer {access_token}

  • Content-Type: application/json

Response:

Code Block
{
  "Data": {
    "transactionsBalance": [
      {
        "AccountId": "string",
        "Amount": {
          "transactionIdAmount": "txn789string",
          "dateCurrency": "string"
        },
      "2024-06-20T12:00:00Z  "CreditDebitIndicator": "string",
        "Type": "string",
        "amountDateTime": -100.00"2024-07-02T21:28:05.010Z"
      }
    ]
  },
  "Links": {
    "descriptionSelf": "Withdrawal - ATM"
"string"
  },
  "Meta": {
    "TotalPages": 0
  }
}

Get a Single Account Beneficiaries

To retrieve beneficiaries information for a specific account, use the following API call:

API Endpoint: https://api-openbanking.leatherback.co/accounts/{accountId}/beneficiaries

Method: GET

Path Parameters:

  • accountId: The unique identifier of the account.

Request Headers:

  • Authorization: Bearer {access_token}

  • Content-Type: application/json

Response:

Code Block
{
  "Data": {
    "Account": [
      {
        "transactionIdAccountId": "txn7903fa85f64-5717-4562-b3fc-2c963f66afa6",
        "dateBeneficiaryId": "2024-06-19T15:30:00Z3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "Account": [
          {
            "SchemeName": "string",
      "amount      "Identification": 2000.00,"string",
            "descriptionName": "Deposit - Salary"string"
          }
        ]
      }
    ]
  },
  "Links": {
    "Self": "string"
  },
  "Meta": {
  // Additional transactions...
 "TotalPages": 0
 ] }
}