Add a new bank account for a user ( SUNSETTING )
curl --request POST \
--url https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plaid": {
"access_token": "access-token",
"account_id": "account-id"
},
"custom": {
"account_number": "12345678901234567",
"routing_number": 123456789,
"account_name": "John Doe",
"account_type": "checking",
"validate_account_routing": true
},
"account_details": {},
"billing_merchant_user_uuid": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"billing_processor_mid": "1213121313"
}
'import requests
url = "https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts"
payload = {
"plaid": {
"access_token": "access-token",
"account_id": "account-id"
},
"custom": {
"account_number": "12345678901234567",
"routing_number": 123456789,
"account_name": "John Doe",
"account_type": "checking",
"validate_account_routing": True
},
"account_details": {},
"billing_merchant_user_uuid": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"billing_processor_mid": "1213121313"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plaid: {access_token: 'access-token', account_id: 'account-id'},
custom: {
account_number: '12345678901234567',
routing_number: 123456789,
account_name: 'John Doe',
account_type: 'checking',
validate_account_routing: true
},
account_details: {},
billing_merchant_user_uuid: 'a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6',
billing_processor_mid: '1213121313'
})
};
fetch('https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'plaid' => [
'access_token' => 'access-token',
'account_id' => 'account-id'
],
'custom' => [
'account_number' => '12345678901234567',
'routing_number' => 123456789,
'account_name' => 'John Doe',
'account_type' => 'checking',
'validate_account_routing' => true
],
'account_details' => [
],
'billing_merchant_user_uuid' => 'a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6',
'billing_processor_mid' => '1213121313'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts"
payload := strings.NewReader("{\n \"plaid\": {\n \"access_token\": \"access-token\",\n \"account_id\": \"account-id\"\n },\n \"custom\": {\n \"account_number\": \"12345678901234567\",\n \"routing_number\": 123456789,\n \"account_name\": \"John Doe\",\n \"account_type\": \"checking\",\n \"validate_account_routing\": true\n },\n \"account_details\": {},\n \"billing_merchant_user_uuid\": \"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6\",\n \"billing_processor_mid\": \"1213121313\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plaid\": {\n \"access_token\": \"access-token\",\n \"account_id\": \"account-id\"\n },\n \"custom\": {\n \"account_number\": \"12345678901234567\",\n \"routing_number\": 123456789,\n \"account_name\": \"John Doe\",\n \"account_type\": \"checking\",\n \"validate_account_routing\": true\n },\n \"account_details\": {},\n \"billing_merchant_user_uuid\": \"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6\",\n \"billing_processor_mid\": \"1213121313\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plaid\": {\n \"access_token\": \"access-token\",\n \"account_id\": \"account-id\"\n },\n \"custom\": {\n \"account_number\": \"12345678901234567\",\n \"routing_number\": 123456789,\n \"account_name\": \"John Doe\",\n \"account_type\": \"checking\",\n \"validate_account_routing\": true\n },\n \"account_details\": {},\n \"billing_merchant_user_uuid\": \"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6\",\n \"billing_processor_mid\": \"1213121313\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Bank account added successfully",
"data": {
"uuid": "12345678-1234-1234-1234-123456789012",
"user_uuid": "12345678-1234-1234-1234-123456789012",
"account_number": "12345678901234567",
"routing_number": "123456789",
"account_name": "John Doe",
"account_type": "checking",
"aggregator_type": "manual",
"created_at": "2021-09-01 00:00:00",
"is_default": true
},
"errors": null,
"error_code": null
}{
"status": false,
"message": "Invalid Token",
"data": null,
"errors": null,
"error_code": null
}{
"status": false,
"message": "User delete in progress",
"data": null,
"errors": null,
"error_code": null
}{
"status": false,
"message": "User not found",
"data": null,
"statusCode": 404,
"errorCode": {
"type": "client_error",
"subType": "uuid_not_found"
}
}Bank Accounts
Add a new bank account for a user ( SUNSETTING )
This Endpoint is Sunsetting and you should use the stable endpoint. Sunsetting APIs that are still supported but scheduled for deprecation.
POST
/
3p
/
api
/
v2
/
users
/
{uuid}
/
bank-accounts
Add a new bank account for a user ( SUNSETTING )
curl --request POST \
--url https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plaid": {
"access_token": "access-token",
"account_id": "account-id"
},
"custom": {
"account_number": "12345678901234567",
"routing_number": 123456789,
"account_name": "John Doe",
"account_type": "checking",
"validate_account_routing": true
},
"account_details": {},
"billing_merchant_user_uuid": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"billing_processor_mid": "1213121313"
}
'import requests
url = "https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts"
payload = {
"plaid": {
"access_token": "access-token",
"account_id": "account-id"
},
"custom": {
"account_number": "12345678901234567",
"routing_number": 123456789,
"account_name": "John Doe",
"account_type": "checking",
"validate_account_routing": True
},
"account_details": {},
"billing_merchant_user_uuid": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"billing_processor_mid": "1213121313"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
plaid: {access_token: 'access-token', account_id: 'account-id'},
custom: {
account_number: '12345678901234567',
routing_number: 123456789,
account_name: 'John Doe',
account_type: 'checking',
validate_account_routing: true
},
account_details: {},
billing_merchant_user_uuid: 'a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6',
billing_processor_mid: '1213121313'
})
};
fetch('https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'plaid' => [
'access_token' => 'access-token',
'account_id' => 'account-id'
],
'custom' => [
'account_number' => '12345678901234567',
'routing_number' => 123456789,
'account_name' => 'John Doe',
'account_type' => 'checking',
'validate_account_routing' => true
],
'account_details' => [
],
'billing_merchant_user_uuid' => 'a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6',
'billing_processor_mid' => '1213121313'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts"
payload := strings.NewReader("{\n \"plaid\": {\n \"access_token\": \"access-token\",\n \"account_id\": \"account-id\"\n },\n \"custom\": {\n \"account_number\": \"12345678901234567\",\n \"routing_number\": 123456789,\n \"account_name\": \"John Doe\",\n \"account_type\": \"checking\",\n \"validate_account_routing\": true\n },\n \"account_details\": {},\n \"billing_merchant_user_uuid\": \"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6\",\n \"billing_processor_mid\": \"1213121313\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plaid\": {\n \"access_token\": \"access-token\",\n \"account_id\": \"account-id\"\n },\n \"custom\": {\n \"account_number\": \"12345678901234567\",\n \"routing_number\": 123456789,\n \"account_name\": \"John Doe\",\n \"account_type\": \"checking\",\n \"validate_account_routing\": true\n },\n \"account_details\": {},\n \"billing_merchant_user_uuid\": \"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6\",\n \"billing_processor_mid\": \"1213121313\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.grailpay.com/3p/api/v2/users/{uuid}/bank-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"plaid\": {\n \"access_token\": \"access-token\",\n \"account_id\": \"account-id\"\n },\n \"custom\": {\n \"account_number\": \"12345678901234567\",\n \"routing_number\": 123456789,\n \"account_name\": \"John Doe\",\n \"account_type\": \"checking\",\n \"validate_account_routing\": true\n },\n \"account_details\": {},\n \"billing_merchant_user_uuid\": \"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6\",\n \"billing_processor_mid\": \"1213121313\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Bank account added successfully",
"data": {
"uuid": "12345678-1234-1234-1234-123456789012",
"user_uuid": "12345678-1234-1234-1234-123456789012",
"account_number": "12345678901234567",
"routing_number": "123456789",
"account_name": "John Doe",
"account_type": "checking",
"aggregator_type": "manual",
"created_at": "2021-09-01 00:00:00",
"is_default": true
},
"errors": null,
"error_code": null
}{
"status": false,
"message": "Invalid Token",
"data": null,
"errors": null,
"error_code": null
}{
"status": false,
"message": "User delete in progress",
"data": null,
"errors": null,
"error_code": null
}{
"status": false,
"message": "User not found",
"data": null,
"statusCode": 404,
"errorCode": {
"type": "client_error",
"subType": "uuid_not_found"
}
}Authorizations
Token-based authentication using Authorization: Bearer <YOUR_API_KEY> provided by the GrailPay Support Team.
Path Parameters
UUID of the user
Body
application/json
⌘I
