To check that you have correctly coded your integration to our API specifications, complete our test cases for each API resource. Each API resource has a unique test endpoint and a unique set of test cases.
If your tests are successful:
We send you an email to inform you that you can now send requests to the live endpoint.
If your tests are unsuccessful:
Contact the project owner or email us for help at integrationsupport@payroc.com.
Test environment
Run the following tests using our test environment with the credentials that we provided you.
Test environment base URI: https://api.uat.payroc.com/v1
Testing Funding Recipients
Use our /funding-recipients endpoint to create and manage third-party recipients that receive funds from your transactions. To verify that your integration works with this endpoint, run the following tests:
Test 1: Create a Funding Recipient
You can create a Funding Recipient independently of any existing MIDs on your account.
- Use our
/funding-recipientsendpoint to create a new Funding Recipient.
Request
POST https://api.payroc.com/v1/funding-recipients
Create funding recipient
curl -X POST https://api.payroc.com/v1/funding-recipients \
-H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"recipientType": "privateCorporation",
"taxId": "12-3456789",
"doingBusinessAs": "Pizza Doe",
"address": {
"address1": "1 Example Ave.",
"address2": "Example Address Line 2",
"address3": "Example Address Line 3",
"city": "Chicago",
"country": "US",
"postalCode": "60056",
"state": "Illinois"
},
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"owners": [
{
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1964-03-22",
"address": {
"address1": "1 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "000-00-4320"
}
],
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"relationship": {
"isControlProng": true,
"equityPercentage": 48.5,
"title": "CFO",
"isAuthorizedSignatory": false
},
"middleName": "Helen"
}
],
"fundingAccounts": [
{
"type": "checking",
"use": "credit",
"nameOnAccount": "Jane Doe",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "123456789",
"accountNumber": "1234567890"
}
}
]
}
],
"metadata": {
"yourCustomField": "abc123"
}
}'
Create funding recipient
import requests
url = "https://api.payroc.com/v1/funding-recipients"
payload = {
"recipientType": "privateCorporation",
"taxId": "12-3456789",
"doingBusinessAs": "Pizza Doe",
"address": {
"address1": "1 Example Ave.",
"address2": "Example Address Line 2",
"address3": "Example Address Line 3",
"city": "Chicago",
"country": "US",
"postalCode": "60056",
"state": "Illinois"
},
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"owners": [
{
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1964-03-22",
"address": {
"address1": "1 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "000-00-4320"
}
],
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"relationship": {
"isControlProng": True,
"equityPercentage": 48.5,
"title": "CFO",
"isAuthorizedSignatory": False
},
"middleName": "Helen"
}
],
"fundingAccounts": [
{
"type": "checking",
"use": "credit",
"nameOnAccount": "Jane Doe",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "123456789",
"accountNumber": "1234567890"
}
}
]
}
],
"metadata": { "yourCustomField": "abc123" }
}
headers = {
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Create funding recipient
const url = 'https://api.payroc.com/v1/funding-recipients';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '8e03978e-40d5-43e8-bc93-6894a57f9324',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: '{"recipientType":"privateCorporation","taxId":"12-3456789","doingBusinessAs":"Pizza Doe","address":{"address1":"1 Example Ave.","address2":"Example Address Line 2","address3":"Example Address Line 3","city":"Chicago","country":"US","postalCode":"60056","state":"Illinois"},"contactMethods":[{"type":"email","value":"jane.doe@example.com"},{"type":"phone","value":"2025550164"}],"owners":[{"firstName":"Jane","lastName":"Doe","dateOfBirth":"1964-03-22","address":{"address1":"1 Example Ave.","city":"Chicago","state":"Illinois","country":"US","postalCode":"60056"},"identifiers":[{"type":"nationalId","value":"000-00-4320"}],"contactMethods":[{"type":"email","value":"jane.doe@example.com"},{"type":"phone","value":"2025550164"}],"relationship":{"isControlProng":true,"equityPercentage":48.5,"title":"CFO","isAuthorizedSignatory":false},"middleName":"Helen"}],"fundingAccounts":[{"type":"checking","use":"credit","nameOnAccount":"Jane Doe","paymentMethods":[{"type":"ach","value":{"routingNumber":"123456789","accountNumber":"1234567890"}}]}],"metadata":{"yourCustomField":"abc123"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Create funding recipient
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-recipients"
payload := strings.NewReader("{\n \"recipientType\": \"privateCorporation\",\n \"taxId\": \"12-3456789\",\n \"doingBusinessAs\": \"Pizza Doe\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"address2\": \"Example Address Line 2\",\n \"address3\": \"Example Address Line 3\",\n \"city\": \"Chicago\",\n \"country\": \"US\",\n \"postalCode\": \"60056\",\n \"state\": \"Illinois\"\n },\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"owners\": [\n {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1964-03-22\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-4320\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": true,\n \"equityPercentage\": 48.5,\n \"title\": \"CFO\",\n \"isAuthorizedSignatory\": false\n },\n \"middleName\": \"Helen\"\n }\n ],\n \"fundingAccounts\": [\n {\n \"type\": \"checking\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Jane Doe\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123456789\",\n \"accountNumber\": \"1234567890\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
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(res)
fmt.Println(string(body))
}
Create funding recipient
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-recipients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '8e03978e-40d5-43e8-bc93-6894a57f9324'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipientType\": \"privateCorporation\",\n \"taxId\": \"12-3456789\",\n \"doingBusinessAs\": \"Pizza Doe\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"address2\": \"Example Address Line 2\",\n \"address3\": \"Example Address Line 3\",\n \"city\": \"Chicago\",\n \"country\": \"US\",\n \"postalCode\": \"60056\",\n \"state\": \"Illinois\"\n },\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"owners\": [\n {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1964-03-22\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-4320\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": true,\n \"equityPercentage\": 48.5,\n \"title\": \"CFO\",\n \"isAuthorizedSignatory\": false\n },\n \"middleName\": \"Helen\"\n }\n ],\n \"fundingAccounts\": [\n {\n \"type\": \"checking\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Jane Doe\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123456789\",\n \"accountNumber\": \"1234567890\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}"
response = http.request(request)
puts response.read_body
Create funding recipient
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api.payroc.com/v1/funding-recipients")
.header("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipientType\": \"privateCorporation\",\n \"taxId\": \"12-3456789\",\n \"doingBusinessAs\": \"Pizza Doe\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"address2\": \"Example Address Line 2\",\n \"address3\": \"Example Address Line 3\",\n \"city\": \"Chicago\",\n \"country\": \"US\",\n \"postalCode\": \"60056\",\n \"state\": \"Illinois\"\n },\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"owners\": [\n {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1964-03-22\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-4320\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": true,\n \"equityPercentage\": 48.5,\n \"title\": \"CFO\",\n \"isAuthorizedSignatory\": false\n },\n \"middleName\": \"Helen\"\n }\n ],\n \"fundingAccounts\": [\n {\n \"type\": \"checking\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Jane Doe\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123456789\",\n \"accountNumber\": \"1234567890\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}")
.asString();
Create funding recipient
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.payroc.com/v1/funding-recipients', [
'body' => '{
"recipientType": "privateCorporation",
"taxId": "12-3456789",
"doingBusinessAs": "Pizza Doe",
"address": {
"address1": "1 Example Ave.",
"address2": "Example Address Line 2",
"address3": "Example Address Line 3",
"city": "Chicago",
"country": "US",
"postalCode": "60056",
"state": "Illinois"
},
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"owners": [
{
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1964-03-22",
"address": {
"address1": "1 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "000-00-4320"
}
],
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"relationship": {
"isControlProng": true,
"equityPercentage": 48.5,
"title": "CFO",
"isAuthorizedSignatory": false
},
"middleName": "Helen"
}
],
"fundingAccounts": [
{
"type": "checking",
"use": "credit",
"nameOnAccount": "Jane Doe",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "123456789",
"accountNumber": "1234567890"
}
}
]
}
],
"metadata": {
"yourCustomField": "abc123"
}
}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
],
]);
echo $response->getBody();
Create funding recipient
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-recipients");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"recipientType\": \"privateCorporation\",\n \"taxId\": \"12-3456789\",\n \"doingBusinessAs\": \"Pizza Doe\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"address2\": \"Example Address Line 2\",\n \"address3\": \"Example Address Line 3\",\n \"city\": \"Chicago\",\n \"country\": \"US\",\n \"postalCode\": \"60056\",\n \"state\": \"Illinois\"\n },\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"owners\": [\n {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1964-03-22\",\n \"address\": {\n \"address1\": \"1 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-4320\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"jane.doe@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550164\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": true,\n \"equityPercentage\": 48.5,\n \"title\": \"CFO\",\n \"isAuthorizedSignatory\": false\n },\n \"middleName\": \"Helen\"\n }\n ],\n \"fundingAccounts\": [\n {\n \"type\": \"checking\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Jane Doe\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123456789\",\n \"accountNumber\": \"1234567890\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Create funding recipient
import Foundation
let headers = [
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
let parameters = [
"recipientType": "privateCorporation",
"taxId": "12-3456789",
"doingBusinessAs": "Pizza Doe",
"address": [
"address1": "1 Example Ave.",
"address2": "Example Address Line 2",
"address3": "Example Address Line 3",
"city": "Chicago",
"country": "US",
"postalCode": "60056",
"state": "Illinois"
],
"contactMethods": [
[
"type": "email",
"value": "jane.doe@example.com"
],
[
"type": "phone",
"value": "2025550164"
]
],
"owners": [
[
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1964-03-22",
"address": [
"address1": "1 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
],
"identifiers": [
[
"type": "nationalId",
"value": "000-00-4320"
]
],
"contactMethods": [
[
"type": "email",
"value": "jane.doe@example.com"
],
[
"type": "phone",
"value": "2025550164"
]
],
"relationship": [
"isControlProng": true,
"equityPercentage": 48.5,
"title": "CFO",
"isAuthorizedSignatory": false
],
"middleName": "Helen"
]
],
"fundingAccounts": [
[
"type": "checking",
"use": "credit",
"nameOnAccount": "Jane Doe",
"paymentMethods": [
[
"type": "ach",
"value": [
"routingNumber": "123456789",
"accountNumber": "1234567890"
]
]
]
]
],
"metadata": ["yourCustomField": "abc123"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-recipients")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Response (201)
{
"recipientType": "privateCorporation",
"taxId": "12-3456789",
"doingBusinessAs": "Pizza Doe",
"address": {
"address1": "1 Example Ave.",
"address2": "Example Address Line 2",
"address3": "Example Address Line 3",
"city": "Chicago",
"country": "US",
"postalCode": "60056",
"state": "Illinois"
},
"contactMethods": [
{
"type": "email",
"value": "jane.doe@example.com"
},
{
"type": "phone",
"value": "2025550164"
}
],
"owners": [
{
"ownerId": 4564,
"link": {
"rel": "owner",
"href": "https://api.payroc.com/v1/owners/4564",
"method": "get"
}
}
],
"fundingAccounts": [
{
"fundingAccountId": 123,
"status": "pending",
"link": {
"rel": "fundingAccount",
"href": "https://api.payroc.com/v1/funding-accounts/123",
"method": "get"
}
}
],
"recipientId": 234,
"status": "pending",
"createdDate": "2024-07-02T15:30:00+00:00",
"lastModifiedDate": "2024-07-02T15:30:00+00:00",
"metadata": {
"yourCustomField": "abc123"
}
}
Test 2: Add a Funding Account to a Recipient
You can use our /funding-recipients endpoint to manage Funding Accounts associated with a Recipient.
- Use our
/funding-recipientsendpoint to add a new Funding Account to an existing Recipient.
Request
POST https://api.payroc.com/v1/funding-recipients/{recipientId}/funding-accounts
Create funding account
curl -X POST https://api.payroc.com/v1/funding-recipients/234/funding-accounts \
-H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"type": "savings",
"use": "credit",
"nameOnAccount": "Fred Nerk",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "123123123",
"accountNumber": "987654321"
}
}
],
"metadata": {
"responsiblePerson": "Jane Doe"
}
}'
Create funding account
import requests
url = "https://api.payroc.com/v1/funding-recipients/234/funding-accounts"
payload = {
"type": "savings",
"use": "credit",
"nameOnAccount": "Fred Nerk",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "123123123",
"accountNumber": "987654321"
}
}
],
"metadata": { "responsiblePerson": "Jane Doe" }
}
headers = {
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Create funding account
const url = 'https://api.payroc.com/v1/funding-recipients/234/funding-accounts';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '8e03978e-40d5-43e8-bc93-6894a57f9324',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: '{"type":"savings","use":"credit","nameOnAccount":"Fred Nerk","paymentMethods":[{"type":"ach","value":{"routingNumber":"123123123","accountNumber":"987654321"}}],"metadata":{"responsiblePerson":"Jane Doe"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Create funding account
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-recipients/234/funding-accounts"
payload := strings.NewReader("{\n \"type\": \"savings\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Fred Nerk\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123123123\",\n \"accountNumber\": \"987654321\"\n }\n }\n ],\n \"metadata\": {\n \"responsiblePerson\": \"Jane Doe\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
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(res)
fmt.Println(string(body))
}
Create funding account
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-recipients/234/funding-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '8e03978e-40d5-43e8-bc93-6894a57f9324'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"savings\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Fred Nerk\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123123123\",\n \"accountNumber\": \"987654321\"\n }\n }\n ],\n \"metadata\": {\n \"responsiblePerson\": \"Jane Doe\"\n }\n}"
response = http.request(request)
puts response.read_body
Create funding account
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api.payroc.com/v1/funding-recipients/234/funding-accounts")
.header("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"savings\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Fred Nerk\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123123123\",\n \"accountNumber\": \"987654321\"\n }\n }\n ],\n \"metadata\": {\n \"responsiblePerson\": \"Jane Doe\"\n }\n}")
.asString();
Create funding account
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.payroc.com/v1/funding-recipients/234/funding-accounts', [
'body' => '{
"type": "savings",
"use": "credit",
"nameOnAccount": "Fred Nerk",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "123123123",
"accountNumber": "987654321"
}
}
],
"metadata": {
"responsiblePerson": "Jane Doe"
}
}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
],
]);
echo $response->getBody();
Create funding account
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-recipients/234/funding-accounts");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"type\": \"savings\",\n \"use\": \"credit\",\n \"nameOnAccount\": \"Fred Nerk\",\n \"paymentMethods\": [\n {\n \"type\": \"ach\",\n \"value\": {\n \"routingNumber\": \"123123123\",\n \"accountNumber\": \"987654321\"\n }\n }\n ],\n \"metadata\": {\n \"responsiblePerson\": \"Jane Doe\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Create funding account
import Foundation
let headers = [
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
let parameters = [
"type": "savings",
"use": "credit",
"nameOnAccount": "Fred Nerk",
"paymentMethods": [
[
"type": "ach",
"value": [
"routingNumber": "123123123",
"accountNumber": "987654321"
]
]
],
"metadata": ["responsiblePerson": "Jane Doe"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-recipients/234/funding-accounts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Response (201)
{
"type": "savings",
"use": "credit",
"nameOnAccount": "Fred Nerk",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "*****3123",
"accountNumber": "******4321"
}
}
],
"fundingAccountId": 123,
"createdDate": "2024-07-02T15:30:00+00:00",
"lastModifiedDate": "2024-07-02T15:30:00+00:00",
"status": "pending",
"metadata": {
"responsiblePerson": "Jane Doe"
},
"links": [
{
"rel": "parent",
"method": "get",
"href": "https://api.payroc.com/v1/funding-recipients/234"
}
]
}
Test 3: Add a new Owner to a Recipient
You can use our /funding-recipients endpoint to create and manage Owner objects associated with the Funding Recipient.
- Use our
/funding-recipientsendpoint to create a new Owner.
Request
POST https://api.payroc.com/v1/funding-recipients/{recipientId}/owners
Create funding recipient owner
curl -X POST https://api.payroc.com/v1/funding-recipients/234/owners \
-H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"firstName": "Fred",
"lastName": "Nerk",
"dateOfBirth": "1980-01-19",
"address": {
"address1": "2 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "000-00-9876"
}
],
"contactMethods": [
{
"type": "email",
"value": "fred.nerk@example.com"
},
{
"type": "phone",
"value": "2025550110"
}
],
"relationship": {
"isControlProng": false,
"equityPercentage": 51.5,
"title": "CEO",
"isAuthorizedSignatory": true
},
"middleName": "Jim"
}'
Create funding recipient owner
import requests
url = "https://api.payroc.com/v1/funding-recipients/234/owners"
payload = {
"firstName": "Fred",
"lastName": "Nerk",
"dateOfBirth": "1980-01-19",
"address": {
"address1": "2 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "000-00-9876"
}
],
"contactMethods": [
{
"type": "email",
"value": "fred.nerk@example.com"
},
{
"type": "phone",
"value": "2025550110"
}
],
"relationship": {
"isControlProng": False,
"equityPercentage": 51.5,
"title": "CEO",
"isAuthorizedSignatory": True
},
"middleName": "Jim"
}
headers = {
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Create funding recipient owner
const url = 'https://api.payroc.com/v1/funding-recipients/234/owners';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '8e03978e-40d5-43e8-bc93-6894a57f9324',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: '{"firstName":"Fred","lastName":"Nerk","dateOfBirth":"1980-01-19","address":{"address1":"2 Example Ave.","city":"Chicago","state":"Illinois","country":"US","postalCode":"60056"},"identifiers":[{"type":"nationalId","value":"000-00-9876"}],"contactMethods":[{"type":"email","value":"fred.nerk@example.com"},{"type":"phone","value":"2025550110"}],"relationship":{"isControlProng":false,"equityPercentage":51.5,"title":"CEO","isAuthorizedSignatory":true},"middleName":"Jim"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Create funding recipient owner
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-recipients/234/owners"
payload := strings.NewReader("{\n \"firstName\": \"Fred\",\n \"lastName\": \"Nerk\",\n \"dateOfBirth\": \"1980-01-19\",\n \"address\": {\n \"address1\": \"2 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-9876\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"fred.nerk@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550110\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": false,\n \"equityPercentage\": 51.5,\n \"title\": \"CEO\",\n \"isAuthorizedSignatory\": true\n },\n \"middleName\": \"Jim\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
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(res)
fmt.Println(string(body))
}
Create funding recipient owner
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-recipients/234/owners")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '8e03978e-40d5-43e8-bc93-6894a57f9324'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"Fred\",\n \"lastName\": \"Nerk\",\n \"dateOfBirth\": \"1980-01-19\",\n \"address\": {\n \"address1\": \"2 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-9876\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"fred.nerk@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550110\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": false,\n \"equityPercentage\": 51.5,\n \"title\": \"CEO\",\n \"isAuthorizedSignatory\": true\n },\n \"middleName\": \"Jim\"\n}"
response = http.request(request)
puts response.read_body
Create funding recipient owner
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api.payroc.com/v1/funding-recipients/234/owners")
.header("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Fred\",\n \"lastName\": \"Nerk\",\n \"dateOfBirth\": \"1980-01-19\",\n \"address\": {\n \"address1\": \"2 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-9876\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"fred.nerk@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550110\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": false,\n \"equityPercentage\": 51.5,\n \"title\": \"CEO\",\n \"isAuthorizedSignatory\": true\n },\n \"middleName\": \"Jim\"\n}")
.asString();
Create funding recipient owner
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.payroc.com/v1/funding-recipients/234/owners', [
'body' => '{
"firstName": "Fred",
"lastName": "Nerk",
"dateOfBirth": "1980-01-19",
"address": {
"address1": "2 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "000-00-9876"
}
],
"contactMethods": [
{
"type": "email",
"value": "fred.nerk@example.com"
},
{
"type": "phone",
"value": "2025550110"
}
],
"relationship": {
"isControlProng": false,
"equityPercentage": 51.5,
"title": "CEO",
"isAuthorizedSignatory": true
},
"middleName": "Jim"
}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
],
]);
echo $response->getBody();
Create funding recipient owner
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-recipients/234/owners");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"firstName\": \"Fred\",\n \"lastName\": \"Nerk\",\n \"dateOfBirth\": \"1980-01-19\",\n \"address\": {\n \"address1\": \"2 Example Ave.\",\n \"city\": \"Chicago\",\n \"state\": \"Illinois\",\n \"country\": \"US\",\n \"postalCode\": \"60056\"\n },\n \"identifiers\": [\n {\n \"type\": \"nationalId\",\n \"value\": \"000-00-9876\"\n }\n ],\n \"contactMethods\": [\n {\n \"type\": \"email\",\n \"value\": \"fred.nerk@example.com\"\n },\n {\n \"type\": \"phone\",\n \"value\": \"2025550110\"\n }\n ],\n \"relationship\": {\n \"isControlProng\": false,\n \"equityPercentage\": 51.5,\n \"title\": \"CEO\",\n \"isAuthorizedSignatory\": true\n },\n \"middleName\": \"Jim\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Create funding recipient owner
import Foundation
let headers = [
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
let parameters = [
"firstName": "Fred",
"lastName": "Nerk",
"dateOfBirth": "1980-01-19",
"address": [
"address1": "2 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
],
"identifiers": [
[
"type": "nationalId",
"value": "000-00-9876"
]
],
"contactMethods": [
[
"type": "email",
"value": "fred.nerk@example.com"
],
[
"type": "phone",
"value": "2025550110"
]
],
"relationship": [
"isControlProng": false,
"equityPercentage": 51.5,
"title": "CEO",
"isAuthorizedSignatory": true
],
"middleName": "Jim"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-recipients/234/owners")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Response (201)
{
"firstName": "Fred",
"lastName": "Nerk",
"dateOfBirth": "1980-01-19",
"address": {
"address1": "2 Example Ave.",
"city": "Chicago",
"state": "Illinois",
"country": "US",
"postalCode": "60056"
},
"identifiers": [
{
"type": "nationalId",
"value": "xxxxx9876"
}
],
"contactMethods": [
{
"type": "email",
"value": "fred.nerk@example.com"
},
{
"type": "phone",
"value": "2025550110"
}
],
"relationship": {
"isControlProng": false,
"equityPercentage": 51.5,
"title": "CEO",
"isAuthorizedSignatory": true
},
"ownerId": 12346,
"middleName": "Jim"
}
Test 4: Retrieve the Funding Accounts for a Recipient
To create accurate Funding Instructions, it's important to make sure that you can retrieve a list of Funding Accounts for any Funding Recipients that you create.
- Use our
/funding-accountsendpoint to retrieve a list of Funding Accounts for a Funding Recipient.
Request
GET https://api.payroc.com/v1/funding-recipients/{recipientId}/funding-accounts
List of funding accounts
curl https://api.payroc.com/v1/funding-recipients/234/funding-accounts \
-H "Authorization: Bearer <token>"
List of funding accounts
import requests
url = "https://api.payroc.com/v1/funding-recipients/234/funding-accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())
List of funding accounts
const url = 'https://api.payroc.com/v1/funding-recipients/234/funding-accounts';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
List of funding accounts
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-recipients/234/funding-accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
List of funding accounts
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-recipients/234/funding-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
List of funding accounts
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.get("https://api.payroc.com/v1/funding-recipients/234/funding-accounts")
.header("Authorization", "Bearer <token>")
.asString();
List of funding accounts
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.payroc.com/v1/funding-recipients/234/funding-accounts', [
'headers' => [
'Authorization' => 'Bearer <token>',
],
]);
echo $response->getBody();
List of funding accounts
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-recipients/234/funding-accounts");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
List of funding accounts
import Foundation
let headers = ["Authorization": "Bearer <token>"]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-recipients/234/funding-accounts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Response (200)
[
{
"type": "checking",
"use": "credit",
"nameOnAccount": "Jane Doe",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "*****6789",
"accountNumber": "******7890"
}
}
],
"fundingAccountId": 123,
"createdDate": "2024-07-02T15:30:00+00:00",
"lastModifiedDate": "2024-07-02T15:30:00+00:00",
"status": "approved",
"metadata": {
"yourCustomField": "abc123"
},
"links": [
{
"rel": "parent",
"method": "get",
"href": "https://api.payroc.com/v1/funding-recipients/234"
}
]
},
{
"type": "checking",
"use": "debit",
"nameOnAccount": "Jane Doe",
"paymentMethods": [
{
"type": "ach",
"value": {
"routingNumber": "*****8725",
"accountNumber": "******3491"
}
}
],
"fundingAccountId": 124,
"createdDate": "2024-07-02T15:30:00+00:00",
"lastModifiedDate": "2024-07-02T15:30:00+00:00",
"status": "pending",
"metadata": {
"yourCustomField": "abc123"
},
"links": [
{
"rel": "parent",
"method": "get",
"href": "https://api.payroc.com/v1/funding-recipients/235"
}
]
}
]
Testing Funding Instructions
You can use our /funding-instructions endpoint to tell us how to split your available funds across multiple Funding Accounts. For example, Funding Accounts that belong to your sales office, your merchants, or any Funding Recipients. To verify that your integration works with this endpoint, run the following tests:
Test 5: Create a new Funding Instruction
A Funding Instruction tells us how to split funds across multiple accounts.
- Use our
/funding-accountsendpoint to retrieve a list of Funding Accounts. - Use our
/funding-instructionsendpoint to create a new Funding Instruction.
Request
POST https://api.payroc.com/v1/funding-instructions
Funding instruction
curl -X POST https://api.payroc.com/v1/funding-instructions \
-H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"merchants": [
{
"merchantId": "4525644354",
"recipients": [
{
"fundingAccountId": 123,
"paymentMethod": "ACH",
"amount": {
"value": 120000,
"currency": "USD"
},
"metadata": {
"yourCustomField": "abc123"
}
}
]
}
],
"metadata": {
"yourCustomField": "abc123"
}
}'
Funding instruction
import requests
url = "https://api.payroc.com/v1/funding-instructions"
payload = {
"merchants": [
{
"merchantId": "4525644354",
"recipients": [
{
"fundingAccountId": 123,
"paymentMethod": "ACH",
"amount": {
"value": 120000,
"currency": "USD"
},
"metadata": { "yourCustomField": "abc123" }
}
]
}
],
"metadata": { "yourCustomField": "abc123" }
}
headers = {
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Funding instruction
const url = 'https://api.payroc.com/v1/funding-instructions';
const options = {
method: 'POST',
headers: {
'Idempotency-Key': '8e03978e-40d5-43e8-bc93-6894a57f9324',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: '{"merchants":[{"merchantId":"4525644354","recipients":[{"fundingAccountId":123,"paymentMethod":"ACH","amount":{"value":120000,"currency":"USD"},"metadata":{"yourCustomField":"abc123"}}]}],"metadata":{"yourCustomField":"abc123"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Funding instruction
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-instructions"
payload := strings.NewReader("{\n \"merchants\": [\n {\n \"merchantId\": \"4525644354\",\n \"recipients\": [\n {\n \"fundingAccountId\": 123,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 120000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
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(res)
fmt.Println(string(body))
}
Funding instruction
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-instructions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '8e03978e-40d5-43e8-bc93-6894a57f9324'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchants\": [\n {\n \"merchantId\": \"4525644354\",\n \"recipients\": [\n {\n \"fundingAccountId\": 123,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 120000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}"
response = http.request(request)
puts response.read_body
Funding instruction
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api.payroc.com/v1/funding-instructions")
.header("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchants\": [\n {\n \"merchantId\": \"4525644354\",\n \"recipients\": [\n {\n \"fundingAccountId\": 123,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 120000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}")
.asString();
Funding instruction
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.payroc.com/v1/funding-instructions', [
'body' => '{
"merchants": [
{
"merchantId": "4525644354",
"recipients": [
{
"fundingAccountId": 123,
"paymentMethod": "ACH",
"amount": {
"value": 120000,
"currency": "USD"
},
"metadata": {
"yourCustomField": "abc123"
}
}
]
}
],
"metadata": {
"yourCustomField": "abc123"
}
}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
],
]);
echo $response->getBody();
Funding instruction
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-instructions");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"merchants\": [\n {\n \"merchantId\": \"4525644354\",\n \"recipients\": [\n {\n \"fundingAccountId\": 123,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 120000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"yourCustomField\": \"abc123\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Funding instruction
import Foundation
let headers = [
"Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
let parameters = [
"merchants": [
[
"merchantId": "4525644354",
"recipients": [
[
"fundingAccountId": 123,
"paymentMethod": "ACH",
"amount": [
"value": 120000,
"currency": "USD"
],
"metadata": ["yourCustomField": "abc123"]
]
]
]
],
"metadata": ["yourCustomField": "abc123"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-instructions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Response (201)
{
"instructionId": 64643131,
"createdDate": "2024-07-02T15:30:00Z",
"lastModifiedDate": "2024-07-02T15:30:00Z",
"status": "accepted",
"merchants": [
{
"merchantId": "4525644354",
"recipients": [
{
"fundingAccountId": 123,
"paymentMethod": "ACH",
"amount": {
"value": 120000,
"currency": "USD"
},
"status": "accepted",
"metadata": {
"yourCustomField": "abc123"
},
"link": {
"rel": "fundingAccount",
"method": "get",
"href": "https://api.payroc.com/v1/funding-accounts/123"
}
}
],
"link": {
"rel": "merchant",
"method": "get",
"href": "https://api.payroc.com/v1/processing-accounts/4525644354"
}
}
],
"metadata": {
"yourCustomField": "abc123"
}
}
Test 6: Update a Funding Instruction
While a Funding Instruction has a status of accepted, you can continue to edit and update the instruction. To update a Funding Instruction, you must send a PUT request to the correct Funding Instruction id.
- Use our
/funding-instructions/{instructionId}endpoint to update a Funding Instruction.
Request
PUT https://api.payroc.com/v1/funding-instructions/{instructionId}
Update funding instruction
curl -X PUT https://api.payroc.com/v1/funding-instructions/64643131 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"merchants": [
{
"merchantId": "9876543219",
"recipients": [
{
"fundingAccountId": 124,
"paymentMethod": "ACH",
"amount": {
"value": 69950,
"currency": "USD"
},
"metadata": {
"supplier": "IT Support Services"
}
}
]
}
],
"metadata": {
"instructionCreatedBy": "Jane Doe"
}
}'
Update funding instruction
import requests
url = "https://api.payroc.com/v1/funding-instructions/64643131"
payload = {
"merchants": [
{
"merchantId": "9876543219",
"recipients": [
{
"fundingAccountId": 124,
"paymentMethod": "ACH",
"amount": {
"value": 69950,
"currency": "USD"
},
"metadata": { "supplier": "IT Support Services" }
}
]
}
],
"metadata": { "instructionCreatedBy": "Jane Doe" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
Update funding instruction
const url = 'https://api.payroc.com/v1/funding-instructions/64643131';
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: '{"merchants":[{"merchantId":"9876543219","recipients":[{"fundingAccountId":124,"paymentMethod":"ACH","amount":{"value":69950,"currency":"USD"},"metadata":{"supplier":"IT Support Services"}}]}],"metadata":{"instructionCreatedBy":"Jane Doe"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Update funding instruction
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-instructions/64643131"
payload := strings.NewReader("{\n \"merchants\": [\n {\n \"merchantId\": \"9876543219\",\n \"recipients\": [\n {\n \"fundingAccountId\": 124,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 69950,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"supplier\": \"IT Support Services\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"instructionCreatedBy\": \"Jane Doe\"\n }\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
Update funding instruction
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-instructions/64643131")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchants\": [\n {\n \"merchantId\": \"9876543219\",\n \"recipients\": [\n {\n \"fundingAccountId\": 124,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 69950,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"supplier\": \"IT Support Services\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"instructionCreatedBy\": \"Jane Doe\"\n }\n}"
response = http.request(request)
puts response.read_body
Update funding instruction
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.put("https://api.payroc.com/v1/funding-instructions/64643131")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchants\": [\n {\n \"merchantId\": \"9876543219\",\n \"recipients\": [\n {\n \"fundingAccountId\": 124,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 69950,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"supplier\": \"IT Support Services\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"instructionCreatedBy\": \"Jane Doe\"\n }\n}")
.asString();
Update funding instruction
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.payroc.com/v1/funding-instructions/64643131', [
'body' => '{
"merchants": [
{
"merchantId": "9876543219",
"recipients": [
{
"fundingAccountId": 124,
"paymentMethod": "ACH",
"amount": {
"value": 69950,
"currency": "USD"
},
"metadata": {
"supplier": "IT Support Services"
}
}
]
}
],
"metadata": {
"instructionCreatedBy": "Jane Doe"
}
}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
Update funding instruction
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-instructions/64643131");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"merchants\": [\n {\n \"merchantId\": \"9876543219\",\n \"recipients\": [\n {\n \"fundingAccountId\": 124,\n \"paymentMethod\": \"ACH\",\n \"amount\": {\n \"value\": 69950,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"supplier\": \"IT Support Services\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"instructionCreatedBy\": \"Jane Doe\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Update funding instruction
import Foundation
let headers = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
let parameters = [
"merchants": [
[
"merchantId": "9876543219",
"recipients": [
[
"fundingAccountId": 124,
"paymentMethod": "ACH",
"amount": [
"value": 69950,
"currency": "USD"
],
"metadata": ["supplier": "IT Support Services"]
]
]
]
],
"metadata": ["instructionCreatedBy": "Jane Doe"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-instructions/64643131")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Test 7: List Funding Activity
You can use our /funding-activity endpoint to retrieve a list of all funding activity so far.
- Use our
/funding-activityendpoint to retrieve a list of all funding activity.
Request
GET https://api.payroc.com/v1/funding-activity
Paginated activity records
curl -G https://api.payroc.com/v1/funding-activity \
-H "Authorization: Bearer <token>" \
-d after=8516 \
-d before=2571 \
-d dateFrom=2024-07-02 \
-d dateTo=2024-07-03 \
-d limit=25 \
-d merchantId=4525644354
Paginated activity records
import requests
url = "https://api.payroc.com/v1/funding-activity"
querystring = {"after":"8516","before":"2571","dateFrom":"2024-07-02","dateTo":"2024-07-03","limit":"25","merchantId":"4525644354"}
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
Paginated activity records
const url = 'https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Paginated activity records
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Paginated activity records
require 'uri'
require 'net/http'
url = URI("https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Paginated activity records
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.get("https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354")
.header("Authorization", "Bearer <token>")
.asString();
Paginated activity records
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354', [
'headers' => [
'Authorization' => 'Bearer <token>',
],
]);
echo $response->getBody();
Paginated activity records
using RestSharp;
var client = new RestClient("https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
Paginated activity records
import Foundation
let headers = ["Authorization": "Bearer <token>"]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/funding-activity?after=8516&before=2571&dateFrom=2024-07-02&dateTo=2024-07-03&limit=25&merchantId=4525644354")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Successful response:
Response (200)
{
"data": [
{
"id": 11,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Pizza Doe",
"description": "sales",
"amount": 4999,
"type": "credit",
"currency": "USD"
},
{
"id": 12,
"date": "2024-07-02T19:32:00.000Z",
"merchant": "Pizza Doe",
"description": "sales",
"amount": 3999,
"type": "credit",
"currency": "USD"
},
{
"id": 13,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Pizza Doe",
"description": "sales",
"amount": 3299,
"type": "credit",
"currency": "USD"
},
{
"id": 14,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Pizza Doe",
"description": "Interchange Fees",
"amount": 50,
"type": "debit",
"currency": "USD",
"recipient": "Payroc"
},
{
"id": 15,
"date": "2024-07-02T09:10:00.000Z",
"merchant": "Pizza Doe",
"description": "sales",
"amount": 4999,
"type": "credit",
"currency": "USD"
},
{
"id": 16,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Doe Hot Dogs",
"description": "Adjustment",
"amount": 750,
"type": "credit",
"currency": "USD"
},
{
"id": 17,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Doe Hot Dogs",
"description": "Interchange Fees",
"amount": 5,
"type": "debit",
"currency": "USD",
"recipient": "Payroc"
},
{
"id": 18,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Pizza Doe",
"description": "Charge back",
"amount": 1000,
"type": "debit",
"currency": "USD",
"recipient": "Payroc"
},
{
"id": 19,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Pizza Doe",
"description": "sales",
"amount": 5999,
"type": "credit",
"currency": "USD"
},
{
"id": 20,
"date": "2024-07-02T17:00:00.000Z",
"merchant": "Pizza Doe",
"description": "payment",
"amount": 1000,
"type": "debit",
"currency": "USD",
"recipient": "Pizza Doe"
}
],
"limit": 10,
"count": 10,
"hasMore": true,
"links": [
{
"rel": "previous",
"method": "get",
"href": "https://api.payroc.com/v1/funding-activity?before=11&limit=10&datefrom=2024-07-01&dateto=2024-07-03"
},
{
"rel": "next",
"method": "get",
"href": "https://api.payroc.com/v1/funding-activity?after=20&limit=10&datefrom=2024-07-01&dateto=2024-07-03"
}
]
}
Results
After you complete your tests, send your results to integrationsupport@payroc.com. A member of our team will contact you to confirm certification or to provide support.
Need more help?
We are here to help! If you need help with your integration, contact us at integrationsupport@payroc.com or through our Developer Community.