$bankAccountsApi = $client->getBankAccountsApi();
BankAccountsApi
Returns a list of BankAccount objects linked to a Square account.
function listBankAccounts(?string $cursor = null, ?int $limit = null, ?string $locationId = null): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
cursor |
?string |
Query, Optional | The pagination cursor returned by a previous call to this endpoint. Use it in the next ListBankAccounts request to retrieve the next setof results. See the Pagination guide for more information. |
limit |
?int |
Query, Optional | 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. |
locationId |
?string |
Query, Optional | Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type ListBankAccountsResponse
.
$apiResponse = $bankAccountsApi->listBankAccounts();
if ($apiResponse->isSuccess()) {
$listBankAccountsResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
Returns details of a BankAccount identified by V1 bank account ID.
function getBankAccountByV1Id(string $v1BankAccountId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
v1BankAccountId |
string |
Template, Required | Connect V1 ID of the desired BankAccount . For more information, seeRetrieve a bank account by using an ID issued by V1 Bank Accounts API. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type GetBankAccountByV1IdResponse
.
$v1BankAccountId = 'v1_bank_account_id8';
$apiResponse = $bankAccountsApi->getBankAccountByV1Id($v1BankAccountId);
if ($apiResponse->isSuccess()) {
$getBankAccountByV1IdResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
Returns details of a BankAccount linked to a Square account.
function getBankAccount(string $bankAccountId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
bankAccountId |
string |
Template, Required | Square-issued ID of the desired BankAccount . |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type GetBankAccountResponse
.
$bankAccountId = 'bank_account_id0';
$apiResponse = $bankAccountsApi->getBankAccount($bankAccountId);
if ($apiResponse->isSuccess()) {
$getBankAccountResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());