External Contacts Recipes

Introduction

In this section you will find step-by-step recipes for integrating the External Contacts API into your product. Below you will find recipes to:

  • Add an External Contact
  • Retrieve Contact Information
  • Update Contact Information

Add External Contacts Recipe

  <th>
    Corresponding Code (JavaScript)
  </th>
</tr>
  <td>
    <pre>const options = {<br /> method: 'GET',<br /> headers: {<br />  Accept: 'application/json',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('https://prod.api.getborderless.com/externalContact/requiredInformation', options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));<br /><br />fetch('https://prod.api.getborderless.com/zoneCodes', options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

<tr>
  <td>
    * \*Create the Request Body and utilize the /externalContacts endpoint -\*\* Create the Request Body and utilize the /externalContacts 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/externalContact', options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>
Step
* \*Determine Required Information For the Contact -\*\* Use the /externalContact/requiredInformation and /zonecodes endpoint to determine required information for the external contact based on their country and accountType.

Retrieve Contact Information Recipe

  <th>
    Corresponding Code (JavaScript)
  </th>
</tr>
  <td>
    <pre>const options = {<br /> method: 'GET',<br /> headers: {<br />  Accept: 'application/json',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('https://prod.api.getborderless.com/externalContact/status'  
      
    , options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err))</pre>
  </td>
</tr>

<tr>
  <td>
    * \*Get Contact Information-\*\* Use the /contacts/contactInformation endpoint to receive information for the  contact. Here you can see if a contact is External or Internal, and if it is a Personal or Business account.
  </td>

  <td>
    <pre>const options = {<br /> method: 'GET',<br /> headers: {<br />  Accept: 'application/json',<br />  Authorization: 'Bearer USER'<br /> }<br />};<br /><br />fetch('https://prod.api.getborderless.com/contacts/contactInformation'  
      
    , options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>
Step
* \*Check for status updates-\*\* If the /externalContacts endpoint returns a "PENDING" status, use the /externalContact/status endpoint to check for when the status becomes approved.

Update Contacts Recipe

  <th>
    Corresponding Code (JavaScript)
  </th>
</tr>
  <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('&lt;https://prod.api.getborderless.com/externalContact&gt;  
      
    ', options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>

<tr>
  <td>
    * \*Update Contact Information -\*\* Update Contact Information with the /contacts/updateContactInformation endpoint. The information you can update varies on account type which you can retrieve from the /contactInformation endpoint. Please refer to the page [here](ref:post_contacts-updatecontactinformation-1)
  </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('&lt;https://prod.api.getborderless.com/externalContact&gt;  
      
    ', options)<br /> .then(response => response.json())<br /> .then(response => console.log(response))<br /> .catch(err => console.error(err));</pre>
  </td>
</tr>
Step
* \*Update Contact's Banking Information -\*\* If you need to make changes to your external Contact's banking information you can use the /externalContacts/updateBankingInformation endpoint.