/get_payment_methods
Get a paginated list of all payment methods linked to an entity.
This endpoint lists all payment methods linked to an entity: bank accounts, virtual accounts, and wallets.
Requests
header.user_handle
should have the registered handle corresponding to the valid entity.
The search_filters
object and all of its nested keys are optional. They can be used to filter the payment methods that are returned.
Results are paginated; by default, the first 20 results are returned. You can request up to 100 results per page ("per_page": 100)
Authorization / Authentication
Apps using Access Token Authorization
Use a valid access token in an Authorization: Bearer request header.
See Authenticating with an Access Token for more details.
Apps using ECDSA Authentication
Both authsignature
and usersignature
headers are required for this request. The usersignature
header should be generated with a keypair registered to the user (either registered from the /register endpoint or the /register_wallet endpoint.
See the section on ECDSA Authentication for more detail about ECDSA signature generation.
POST /0.2/get_payment_methods HTTP/1.1
sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
{
"header": {
"created": 1234567890,
"auth_handle": "handle.silamoney.eth",
"user_handle":"user.silamoney.eth",
"reference": "<your unique id>"
},
"search_filters": {
"payment_method_types": ["bank_account", "card", "ledger_account", "wallet_address"],
"page":1,
"per_page":10
}
}
***
HTTP/1.1 200 OK
{
"success": true,
"payment_methods": [
{
"payment_method_type": "ledger_account",
"ledger_account_id": "ledger_account_uuid",
"payment_instrument_id": "Sila wallet UUID",
"nickname": "My Wallet",
"frozen": false,
"default": true
},
{
"payment_method_type": "bank_account",
"bank_account_id": "db0be7e5-cd90-444c-9145-a9f64c3xxxxx",
"account_number": "*9999",
"routing_number": "044000000",
"account_name": "Chase",
"account_type": "CHECKING",
"active": true,
"account_status": "active",
"account_link_status": "instantly_verified",
"match_score": 0.95,
"entity_name": "Sally Mander",
"account_owner_name": "SALLY D MANDER",
"web_debit_verified": true
},
{
"payment_method_type": "card",
"card_id": "286f6483-fa11-4108-bdc8-db849f1c1bac",
"card_name": "debit card",
"card_last_4": 1157,
"expiration": "12/27",
"card_type": "Debit",
"card_network": "Visa",
"pull_enabled": true,
"push_enabled": null,
"push_availability": null,
"active": true,
"country": "GB",
"currency": "USD"
}
],
"pagination": {
"returned_count": 5,
"total_count": 5,
"current_page": 1,
"total_pages": 1
},
"status": "SUCCESS",
"response_time_ms": "171",
"reference": "<your unique id>"
}
const filters = {
"payment_method_types":["blockchain_address"],
"page":1,
"per_page":10,
};
//filters object is optional
// OR
const filters = {};
const res = await sila.getPaymentMethods(userHandle, userPrivateKey,filters);
// Success Response Object
// Data Response
{
"statusCode": 200,
"headers": {
"server": "nginx/1.14.0 (Ubuntu)",
"date": "Fri, 25 Mar 2022 11:45:08 GMT",
"content-type": "application/json",
"content-length": "1232",
"connection": "close",
"access-control-allow-origin": "*",
"access-control-allow-headers": "*",
"allow": "POST, OPTIONS",
"vary": "Cookie"
},
"data": {
"success": true,
"payment_methods": [
{
"payment_method_type": "blockchain_address",
"blockchain_address_id": "10ab47a6-6d59-4950-855b-727c4e23e480",
"blockchain_address": "0x76fD431757Fd98af7A55fdB8287EB2E172aa62aD",
"blockchain_network": "ETH",
"nickname": "node_wallet_1",
"frozen": false,
"default": false
},
{
"payment_method_type": "bank_account",
"bank_account_id": "ad6d3cba-b8e1-4391-a0e6-b9a3caa0227b",
"account_number": "*9012",
"routing_number": "123456780",
"account_name": "default",
"account_type": "CHECKING",
"active": true,
"account_status": "active",
"account_link_status": "unverified_manual_input",
"match_score": 0.825,
"entity_name": "Marquise Heathcote",
"account_owner_name": "Marquise Heathcote"
},
{
"payment_method_type": "virtual_account",
"virtual_account_id": "72130e62-1bd8-431d-b88d-2440a27c828a",
"virtual_account_name": "default_v_account_1",
"account_number": "************5012",
"routing_number": "084106768",
"account_type": "VIRTUAL_ACCOUNT",
"ach_credit_enabled": false,
"ach_debit_enabled": true,
"active": true,
"closed": false,
"created_epoch": 1648208707,
"closed_epoch": null
}
],
"pagination": {
"returned_count": 4,
"total_count": 4,
"current_page": 1,
"total_pages": 1
},
"status": "SUCCESS",
"reference": "1a72fa71-e237-494a-a1e6-8f1b792cd2e6",
"response_time_ms": "209"
}
}
payload = {
"user_handle": "user.silamoney.eth"
}
User.getPaymentMethods(app, payload, eth_private_key)
# Success
{
"status_code": 200,
"success": true,
"payment_methods": [
{
"payment_method_type": "blockchain_address",
"blockchain_address": "0x3999A8eb9B6CD5a3646497A354D2d9f90D42Ea8e",
"blockchain_network": "ETH",
"nickname": "My Wallet",
"frozen": false,
"default": true
},
{
"payment_method_type": "bank_account",
"account_number": "*9999",
"routing_number": "044000000",
"account_name": "Chase",
"account_type": "CHECKING",
"active": true,
"account_status": "active",
"account_link_status": "instantly_verified",
"match_score": 0.95,
"entity_name": "Sally Mander",
"account_owner_name": "SALLY D MANDER"
},
{
"payment_method_type": "virtual_account",
"virtual_account_id": "b67f2bbf-9255-4339-b6f0-2e7116b69d5b",
"virtual_account_name": "default",
"account_number": "9710001234567890",
"routing_number": "123456780",
"account_type": "VIRTUAL_ACCOUNT",
"active": true,
"closed": false,
"created_epoch": 1642625366,
"closed_epoch": "None",
"ach_debit_enabled": true,
"ach_credit_enabled": false,
}
],
"pagination": {
"returned_count": 4,
"total_count": 4,
"current_page": 1,
"total_pages": 1
}
"status": "SUCCESS",
"reference": "<your unique id>"
}
Key
PaymentMethodsSearchFilters searchFilters= new PaymentMethodsSearchFilters();
List<PaymentMethodsSearchFilters.PaymentMethodsTypesEnum> paymentMethodsTypesEnumList=new ArrayList<>();
paymentMethodsTypesEnumList.add(PaymentMethodsSearchFilters.PaymentMethodsTypesEnum.BLOCKCHAIN_ADDRESS);
paymentMethodsTypesEnumList.add(PaymentMethodsSearchFilters.PaymentMethodsTypesEnum.BANK_ACCOUNT);
paymentMethodsTypesEnumList.add(PaymentMethodsSearchFilters.PaymentMethodsTypesEnum.CARD);
searchFilters.setPaymentMethodsTypes(paymentMethodsTypesEnumList);
searchFilters.setPage(1);
searchFilters.setPerPage(20);
ApiResponse response = api.getPaymentMethods("userHandle", "userPrivateKey",searchFilters); // searchFilters is optional
// Success Response Object
System.out.println(response.getStatusCode()); // 200
GetPaymentMethodsResponse parsedResponse = (GetPaymentMethodsResponse) response.getData();
System.out.println(parsedResponse.getSuccess()); // true
System.out.println(parsedResponse.getStatus()); // SUCCESS
System.out.println(parsedResponse.getPagination().getReturnedCount());
System.out.println(parsedResponse.getPagination().getTotalCount());
System.out.println(parsedResponse.getPagination().getCurrentPage());
System.out.println(parsedResponse.getPagination().getTotalPages());
System.out.println(parsedResponse.getPaymentMethods()); // List of payment methods
System.out.println(parsedResponse.getPaymentMethods().get(0).getPaymentMethodType()); // Payment method type: blockchain_address/bank_account/card
//Payment method type is blockchain_address
System.out.println(parsedResponse.getPaymentMethods().get(0).getBlockchainAddressId()); // 0x3999A8eb9B6CD5a3646497A354D2d9f90D42Ea8e
System.out.println(parsedResponse.getPaymentMethods().get(0).getBlockChainAddress()); //
System.out.println(parsedResponse.getPaymentMethods().get(0).getBlockChainNetwork()); // ETH
System.out.println(parsedResponse.getPaymentMethods().get(0).getNickname()); // My Wallet
System.out.println(parsedResponse.getPaymentMethods().get(0).isDefaultPayment()); // true
System.out.println(parsedResponse.getPaymentMethods().get(0).isFrozen()); // false
//Payment method type is bank_account
System.out.println(parsedResponse.getPaymentMethods().get(0).getBankAccountId());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountNumber());
System.out.println(parsedResponse.getPaymentMethods().get(0).getRoutingNumber());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountName());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountType());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountStatus());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountLinkStatus());
System.out.println(parsedResponse.getPaymentMethods().get(0).getMatchScore());
System.out.println(parsedResponse.getPaymentMethods().get(0).getEntityName());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountOwnerName());
//Payment method type is virtual_account
System.out.println(parsedResponse.getPaymentMethods().get(0).getVirtualAccountId());
System.out.println(parsedResponse.getPaymentMethods().get(0).getVirtualAccountName());
System.out.println(parsedResponse.getPaymentMethods().get(0).getRoutingNumber());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountName());
System.out.println(parsedResponse.getPaymentMethods().get(0).getAccountType());
System.out.println(parsedResponse.getPaymentMethods().get(0).getCreated_epoch());
System.out.println(parsedResponse.getPaymentMethods().get(0).getClosedEpoch());
System.out.println(parsedResponse.getPaymentMethods().get(0).isClosed());
System.out.println(parsedResponse.getPaymentMethods().get(0).isAchCreditEnabled()); // true
System.out.println(parsedResponse.getPaymentMethods().get(0).isAchDebitEnabled()); // false
System.out.println(parsedResponse.getPaymentMethods().get(0).isActive());
use Silamoney\Client\Domain\SearchFilters;
// Load your information
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'some private key'; // Hex format
$filters = new SearchFilters();
// Call the api
$response = $client->getPaymentMethods($userHandle, $userPrivateKey, $filters);
// Response
echo $response->getStatusCode();
echo $response->getData()->status;
echo $response->getData()->success;
//Load your informations
var user = DefaultConfig.FirstUser;
ApiResponse<object> response = api.GetPaymentMethods(user.UserHandle, user.PrivateKey);
// Success Object Response
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Message); // Message
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Success); // true
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Reference); // ccb35eb8-xxxx-xxxx-xxxx-xxxxx
Console.WriteLine(((GetVirtualAccountsResponse)response.Data).ResponseTimeMs); // API responses time
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Pagination.ReturnedCount);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Pagination.TotalCount);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Pagination.CurrentPage);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).Pagination.TotalPages);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods); // List of payment methods
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].PaymentMethodType); // Payment method type: blockchain_address/bank_account/card
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].Active);
//Payment method type is blockchain_address
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].BlockchainAddressId); // 0x3999A8eb9B6CD5a3646497A354D2d9f90D42Ea8e
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].BlockChainAddress); //
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].BlockChainNetwork); // ETH
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].NickName); // My Wallet
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].IsDefault); // true
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].Frozen); // false
//Payment method type is bank_account
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].BankAccountId);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountNumber);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].RoutingNumber);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountName);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountType);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountStatus);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountLinkStatus);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].MatchScore);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].EntityName);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountOwnerName);
//Payment method type is virtual_account
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].VirtualAccountId);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].VirtualAccountName);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].RoutingNumber);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountName);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AccountType);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].CreatedEpoch);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].ClosedEpoch);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].Closed);
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AchCreditEnabled); // true/false
Console.WriteLine(((GetPaymentMethodsResponse)response.Data).PaymentMethods[0].AchDebitEnabled); // true/false
Key | Type | Description |
---|---|---|
header | JSON object | Required. Requires these keys in JSON format: created, auth_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object. |
search_filters | JSON object | Optional. Allows filtering results. |
search_filters. payment_method_types | Array | Optional. Choice field. Example: ["bank_account", "card", "wallet_address", "ledger_account"] |
search_filters.page | Integer | Optional. Min Length 1 Default: 1 |
search_filters. per_page | Integer | Optional. Min 1 Max 100 Default per page 20 |
Responses
Status Code | success Attribute | Description |
---|---|---|
200 | true | Response successfully rendered. |
400 | false | Bad request format - check validation_details for more information. |
403 | false | authsignature or usersignature header was absent or incorrect. |
Updated 4 days ago