SquareConnect\BankAccountsApi

February 26, 2020 ยท View on GitHub

All URIs are relative to https://connect.squareup.com

MethodHTTP requestDescription
getBankAccountGET /v2/bank-accounts/{bank_account_id}GetBankAccount
getBankAccountByV1IdGET /v2/bank-accounts/by-v1-id/{v1_bank_account_id}GetBankAccountByV1Id
listBankAccountsGET /v2/bank-accountsListBankAccounts

getBankAccount

\SquareConnect\Model\GetBankAccountResponse getBankAccount($bank_account_id)

GetBankAccount

Returns details of a BankAccount linked to a Square account. For more information, see Bank Accounts API.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\BankAccountsApi();
$bank_account_id = "bank_account_id_example"; // string | Square-issued ID of the desired `BankAccount`.

try {
    $result = $apiInstance->getBankAccount($bank_account_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountsApi->getBankAccount: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
bank_account_idstringSquare-issued ID of the desired `BankAccount`.

Return type

\SquareConnect\Model\GetBankAccountResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBankAccountByV1Id

\SquareConnect\Model\GetBankAccountByV1IdResponse getBankAccountByV1Id($v1_bank_account_id)

GetBankAccountByV1Id

Returns details of a BankAccount identified by V1 bank account ID. For more information, see Retrieve a bank account by using an ID issued by V1 Bank Accounts API.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\BankAccountsApi();
$v1_bank_account_id = "v1_bank_account_id_example"; // string | Connect V1 ID of the desired `BankAccount`. For more information, see  [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api).

try {
    $result = $apiInstance->getBankAccountByV1Id($v1_bank_account_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountsApi->getBankAccountByV1Id: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
v1_bank_account_idstringConnect V1 ID of the desired `BankAccount`. For more information, see Retrieve a bank account by using an ID issued by V1 Bank Accounts API.

Return type

\SquareConnect\Model\GetBankAccountByV1IdResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBankAccounts

\SquareConnect\Model\ListBankAccountsResponse listBankAccounts(cursor,cursor, limit, $location_id)

ListBankAccounts

Returns a list of BankAccount objects linked to a Square account. For more information, see Bank Accounts API.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\BankAccountsApi();
$cursor = "cursor_example"; // string | The pagination cursor returned by a previous call to this endpoint. Use it in the next `ListBankAccounts` request to retrieve the next set  of results.  See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information.
$limit = 56; // int | Upper limit on the number of bank accounts to return in the response.  Currently, 1000 is the largest supported limit. You can specify a limit  of up to 1000 bank accounts. This is also the default limit.
$location_id = "location_id_example"; // string | Location ID. You can specify this optional filter  to retrieve only the linked bank accounts belonging to a specific location.

try {
    $result = $apiInstance->listBankAccounts($cursor, $limit, $location_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountsApi->listBankAccounts: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

NameTypeDescriptionNotes
cursorstringThe pagination cursor returned by a previous call to this endpoint. Use it in the next `ListBankAccounts` request to retrieve the next set of results. See the Pagination guide for more information.[optional]
limitintUpper limit on the number of bank accounts to return in the response. Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit.[optional]
location_idstringLocation ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location.[optional]

Return type

\SquareConnect\Model\ListBankAccountsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]