API Reference
Log In
API Reference

Payouts API Recipes

In This Section

In the Payouts API Recipes section you will find step-by-step recipes for integrating the Mass Payout and Mass Claim Payout APIs into your product. Below you will find recipes to:

  • Create a Mass Payout Request
  • Create a Mass Claim Payout Request
  • Create Payment and Upload Document For payment

Mass Payouts Recipe

StepCorresponding Code (JavaScript)
Create the Payment Request Body - Gather the Handle, Amount, POPCode, and Description for each client. Use the POPCode endpoint to view all POPCodes and their meanings.
const options = {
 method: 'GET',
 headers: {
  Accept: 'appication/json'
 }
};

fetch('https://prod.api.getborderless.com/popCodes', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));
Call the /mass-payout endpoint with the Payment Request Body - See the API guide here for details about the Mass Payouts endpoint
const options = {
 method: 'POST',
 headers: {
  Accept: 'application/json',
  'Content-Type': 'application/json',
  Authorization: 'Bearer USER'
 }
};

fetch('https://prod.api.getborderless.com/mass-payout', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));

Mass Claim Payouts Recipe

StepCorresponding Code (JavaScript)
Create the Claim Payment Request Body - Gather the Email, Amount, POPCode, and Description for each person you willing to pay. Use the POPCode endpoint to view all POPCodes and their meanings.
const options = {
 method: 'GET',
 headers: {
  Accept: 'appication/json'
 }
};

fetch('https://prod.api.getborderless.com/popCodes', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));
Call the /mass-claim-payouts endpoint with the Claim Payment Request Body - See the API guide here for details about the Mass Claim Payouts endpoint
const options = {
 method: 'POST',
 headers: {
  Accept: 'application/json',
  'Content-Type': 'application/json',
  Authorization: 'Bearer USER'
 }
};

fetch('https://prod.api.getborderless.com/mass-claim-payouts', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));

Create Payment and Upload Document Recipe

StepCorresponding Code (JavaScript)
Create the Request Body for Payment - Gather the Handle, Amount, POPCode, and Description for a client. Use the POPCode endpoint to view all POPCodes and their meanings.
const options = {
 method: 'GET',
 headers: {
  Accept: 'appication/json'
 }
};

fetch('https://prod.api.getborderless.com/popCodes', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));
Call the /payments endpoint with the Payment Request Body - See the API guide here for details about the Submit Payment endpoint.
const options = {
 method: 'POST',
 headers: {
  Accept: 'application/json',
  'Content-Type': 'application/json',
  Authorization: 'Bearer USER'
 }
};

fetch('https://prod.api.getborderless.com/payments', options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));
Call the /payments/{paymentReferenceId}/fileUpload endpoint - Collect paymentReferenceId (Successful response of /payments endpoint will return paymentReferenceId, or it can be found in your mass payout report if you executing payments via /mass-payout). Additionally, specify type of document in the url (INVOICE or SUPP_DOCUMENT), upload file and execute the request. See the API guide here for more details .
const options = {
 method: 'POST',
 headers: {
  Accept: 'application/json',
  'Content-Type': 'multipart/form-data',
  Authorization: 'Bearer USER'
 }
};

fetch('https://prod.api.getborderless.com/payments/:paymentReferenceId/fileUpload, options)
 .then(response => response.json())
 .then(response => console.log(response))
 .catch(err => console.error(err));