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

  <th>
    Corresponding Code (JavaScript)
  </th>
</tr>
Step
**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.
  </td>

  <td>
    <pre>const options = \{<br /> method: 'GET',<br /> headers: \{<br />  Accept: 'appication/json'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/popCodes'](https://prod.api.getborderless.com/popCodes'), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

<tr>
  <td>
    **Call the /mass-payout endpoint with the Payment Request Body -**

     See the API guide 

    [here](https://boderlessapi.readme.io/reference/post_mass-payout)

     for details about the Mass Payouts endpoint
  </td>

  <td>
    <pre>const options = \{<br /> method: 'POST',<br /> headers: \{<br />  Accept: 'application/json',<br />  'Content-Type': 'application/json',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/mass-payout'](https://prod.api.getborderless.com/mass-payout'), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

Mass Claim Payouts Recipe

  <th>
    Corresponding Code (JavaScript)
  </th>
</tr>
Step
**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.
  </td>

  <td>
    <pre>const options = \{<br /> method: 'GET',<br /> headers: \{<br />  Accept: 'appication/json'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/popCodes'](https://prod.api.getborderless.com/popCodes'), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

<tr>
  <td>
    **Call the /mass-claim-payouts endpoint with the Claim Payment Request Body -**

     See the API guide 

    [here](https://boderlessapi.readme.io/reference/post_mass-claim-payouts)

     for details about the Mass Claim Payouts endpoint
  </td>

  <td>
    <pre>const options = \{<br /> method: 'POST',<br /> headers: \{<br />  Accept: 'application/json',<br />  'Content-Type': 'application/json',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/mass-claim-payouts'](https://prod.api.getborderless.com/mass-claim-payouts'), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

Create Payment and Upload Document Recipe

  <th>
    Corresponding Code (JavaScript)
  </th>
</tr>
Step
**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.
  </td>

  <td>
    <pre>const options = \{<br /> method: 'GET',<br /> headers: \{<br />  Accept: 'appication/json'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/popCodes'](https://prod.api.getborderless.com/popCodes'), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

<tr>
  <td>
    **Call the /payments endpoint with the Payment Request Body -**

     See the API guide 

    [here](https://borderlessapi-partner.readme.io/reference/post_payments)

     for details about the Submit Payment endpoint.
  </td>

  <td>
    <pre>const options = \{<br /> method: 'POST',<br /> headers: \{<br />  Accept: 'application/json',<br />  'Content-Type': 'application/json',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/payments'](https://prod.api.getborderless.com/payments'), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

<tr>
  <td>
    **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](https://borderlessapi-partner.readme.io/reference/post_payments-paymentreferenceid-fileupload)

     for more details .
  </td>

  <td>
    <pre>const options = \{<br /> method: 'POST',<br /> headers: \{<br />  Accept: 'application/json',<br />  'Content-Type': 'multipart/form-data',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('[https://prod.api.getborderless.com/payments/:paymentReferenceId/fileUpload](https://prod.api.getborderless.com/payments/\{paymentReferenceId}/fileUpload), options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>