fakebank-api

Accounts

getAccountBalance

Get the balance for the specified account


/accounts/{accountId}/balance

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080//accounts/{accountId}/balance"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccountsApi;

import java.io.File;
import java.util.*;

public class AccountsApiExample {

    public static void main(String[] args) {
        
        AccountsApi apiInstance = new AccountsApi();
        Long accountId = 789; // Long | 
        try {
            AccountBalance result = apiInstance.getAccountBalance(accountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountsApi#getAccountBalance");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AccountsApi;

public class AccountsApiExample {

    public static void main(String[] args) {
        AccountsApi apiInstance = new AccountsApi();
        Long accountId = 789; // Long | 
        try {
            AccountBalance result = apiInstance.getAccountBalance(accountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountsApi#getAccountBalance");
            e.printStackTrace();
        }
    }
}
Long *accountId = 789; // 

AccountsApi *apiInstance = [[AccountsApi alloc] init];

// Get the balance for the specified account
[apiInstance getAccountBalanceWith:accountId
              completionHandler: ^(AccountBalance output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FakebankApi = require('fakebank_api');

var api = new FakebankApi.AccountsApi()
var accountId = 789; // {{Long}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAccountBalance(accountId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAccountBalanceExample
    {
        public void main()
        {

            var apiInstance = new AccountsApi();
            var accountId = 789;  // Long | 

            try
            {
                // Get the balance for the specified account
                AccountBalance result = apiInstance.getAccountBalance(accountId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountsApi.getAccountBalance: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAccountsApi();
$accountId = 789; // Long | 

try {
    $result = $api_instance->getAccountBalance($accountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountsApi->getAccountBalance: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AccountsApi;

my $api_instance = WWW::SwaggerClient::AccountsApi->new();
my $accountId = 789; # Long | 

eval { 
    my $result = $api_instance->getAccountBalance(accountId => $accountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountsApi->getAccountBalance: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AccountsApi()
accountId = 789 # Long | 

try: 
    # Get the balance for the specified account
    api_response = api_instance.get_account_balance(accountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountsApi->getAccountBalance: %s\n" % e)

Parameters

Path parameters
Name Description
accountId*
Long (int64)
Required

Responses

Status: 200 - successful operation

Status: 404 - account not found


getAccountDetails

Get the details for the specified account


/accounts/{accountId}/details

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"http://localhost:8080//accounts/{accountId}/details"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccountsApi;

import java.io.File;
import java.util.*;

public class AccountsApiExample {

    public static void main(String[] args) {
        
        AccountsApi apiInstance = new AccountsApi();
        Long accountId = 789; // Long | 
        try {
            AccountDetails result = apiInstance.getAccountDetails(accountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountsApi#getAccountDetails");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AccountsApi;

public class AccountsApiExample {

    public static void main(String[] args) {
        AccountsApi apiInstance = new AccountsApi();
        Long accountId = 789; // Long | 
        try {
            AccountDetails result = apiInstance.getAccountDetails(accountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountsApi#getAccountDetails");
            e.printStackTrace();
        }
    }
}
Long *accountId = 789; // 

AccountsApi *apiInstance = [[AccountsApi alloc] init];

// Get the details for the specified account
[apiInstance getAccountDetailsWith:accountId
              completionHandler: ^(AccountDetails output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FakebankApi = require('fakebank_api');

var api = new FakebankApi.AccountsApi()
var accountId = 789; // {{Long}} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAccountDetails(accountId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getAccountDetailsExample
    {
        public void main()
        {

            var apiInstance = new AccountsApi();
            var accountId = 789;  // Long | 

            try
            {
                // Get the details for the specified account
                AccountDetails result = apiInstance.getAccountDetails(accountId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountsApi.getAccountDetails: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiAccountsApi();
$accountId = 789; // Long | 

try {
    $result = $api_instance->getAccountDetails($accountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountsApi->getAccountDetails: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AccountsApi;

my $api_instance = WWW::SwaggerClient::AccountsApi->new();
my $accountId = 789; # Long | 

eval { 
    my $result = $api_instance->getAccountDetails(accountId => $accountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountsApi->getAccountDetails: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AccountsApi()
accountId = 789 # Long | 

try: 
    # Get the details for the specified account
    api_response = api_instance.get_account_details(accountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountsApi->getAccountDetails: %s\n" % e)

Parameters

Path parameters
Name Description
accountId*
Long (int64)
Required

Responses

Status: 200 - successful operation

Status: 404 - account not found


Payments

initiatePayment

Transfer the specified amount from the debtor account to the creditor account


/payments

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://localhost:8080//payments"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PaymentsApi;

import java.io.File;
import java.util.*;

public class PaymentsApiExample {

    public static void main(String[] args) {
        
        PaymentsApi apiInstance = new PaymentsApi();
        PaymentRequest body = ; // PaymentRequest | Optional description in *Markdown*
        try {
            apiInstance.initiatePayment(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling PaymentsApi#initiatePayment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PaymentsApi;

public class PaymentsApiExample {

    public static void main(String[] args) {
        PaymentsApi apiInstance = new PaymentsApi();
        PaymentRequest body = ; // PaymentRequest | Optional description in *Markdown*
        try {
            apiInstance.initiatePayment(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling PaymentsApi#initiatePayment");
            e.printStackTrace();
        }
    }
}
PaymentRequest *body = ; // Optional description in *Markdown*

PaymentsApi *apiInstance = [[PaymentsApi alloc] init];

// Transfer the specified amount from the debtor account to the creditor account

[apiInstance initiatePaymentWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var FakebankApi = require('fakebank_api');

var api = new FakebankApi.PaymentsApi()
var body = ; // {{PaymentRequest}} Optional description in *Markdown*

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.initiatePayment(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class initiatePaymentExample
    {
        public void main()
        {

            var apiInstance = new PaymentsApi();
            var body = new PaymentRequest(); // PaymentRequest | Optional description in *Markdown*

            try
            {
                // Transfer the specified amount from the debtor account to the creditor account

                apiInstance.initiatePayment(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PaymentsApi.initiatePayment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiPaymentsApi();
$body = ; // PaymentRequest | Optional description in *Markdown*

try {
    $api_instance->initiatePayment($body);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->initiatePayment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PaymentsApi;

my $api_instance = WWW::SwaggerClient::PaymentsApi->new();
my $body = WWW::SwaggerClient::Object::PaymentRequest->new(); # PaymentRequest | Optional description in *Markdown*

eval { 
    $api_instance->initiatePayment(body => $body);
};
if ($@) {
    warn "Exception when calling PaymentsApi->initiatePayment: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.PaymentsApi()
body =  # PaymentRequest | Optional description in *Markdown*

try: 
    # Transfer the specified amount from the debtor account to the creditor account

    api_instance.initiate_payment(body)
except ApiException as e:
    print("Exception when calling PaymentsApi->initiatePayment: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - successful operation

Status: 400 - invalid request

Status: 404 - account not found