Quick start guide for Transfers To Eversend Wallet!

👋 New to Eversend? Get access to Eversend.

📋 Steps to get started with Transfers to Eversend Wallet

This guide assumes you already have an Eversend account and access to our Dashboard.

  1. 🔑 Authentication
  2. ✔️ Check If Eversend Account Exists
  3. 👨‍💻 Create An Eversend Wallet Transfer Quotation
  4. 👨‍💻 Make An Eversend Wallet Transfer Using The Quotation Token

1. 🔑 Authentication

Please follow this link to Authenticate [Authenticate] (https://eversend.readme.io/reference/authentication-1).
Get the authentication token as it will be used for subsequent requests and will be passed to the header.

2. ✔️ Check If Eversend Account Exists

Before initiating an Eversend Wallet transfer, you need to check if the user account exists in Eversend.
To check if an account exists, we need to may a post request, see sample request below:

const fetch = require('node-fetch');

const url = 'https://api.eversend.co/v1/beneficiaries/accounts/eversend';
const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: 'Bearer 0ef0181a4a7de517647c73ea6d847a071c1b3643'
  },
  body: JSON.stringify({phone: "+2347038088903"})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Response sample:

{
  "code": 200,
  "data": {
    "accountExists": true
  },
  "success": true
}

if accountExists is true, it means that the account exists, you can proceed to step 3.
Follow this link to test: [Check If Eversend Account Exists] (https://eversend.readme.io/reference/check-eversend-account)

3. 👨‍💻 Create An Eversend Wallet Transfer Quotation

To create an Eversend Wallet Transfer Quotation, we need to specify some fields in a post request, see the sample request below:

const fetch = require('node-fetch');

const url = 'https://api.eversend.co/v1/payouts/quotation/eversend';
const payload = {
  sourceWallet: 'UGX',
  amount: 1000,
  amountType: 'SOURCE',
  phone: '+2348038385263',
  identifier: 'phone'
};
const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: 'Bearer 0ef0181a4a7de517647c73ea6d847a071c1b3643'
  },
  body: JSON.stringify(payload)
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

NB: on the payload, you can use either: email, phone or tag to specify the Eversend user identifier. e.g.
const data = {
sourceWallet: 'UGX',
amount: 1000,
amountType: 'SOURCE',
identifier: 'phone',
phone: '+2348038385263',
} or
const data = {
sourceWallet: 'UGX',
amount: 1000,
amountType: 'SOURCE',
identifier: 'email',
email: '[email protected]',
} or
const data = {
sourceWallet: 'UGX',
amount: 1000,
amountType: 'SOURCE',
identifier: 'tag',
tag: 'satowind',
}

Response sample:

{
  "code": 200,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJxdW90YXRpb24iOnsic291cmNlQ291bnRyeSI6Ik5HIiwic291cmNlQ3VycmVuY3kiOiJVR1giLCJzb3VyY2VBbW91bnQiOiIxMDAwIiwiZGVzdGluYXRpb25Db3VudHJ5IjoiTkciLCJkZXN0aW5hdGlvbkN1cnJlbmN5IjoiTkdOIiwiZGVzdGluYXRpb25BbW91bnQiOiIxOTEuODMiLCJleGNoYW5nZVJhdGUiOiIwLjE5MTgyOTQ4NTE3ODU1IiwidG90YWxGZWVzIjoiMCIsInRvdGFsQW1vdW50IjoiMTAwMC4wMCIsInR5cGUiOiJldmVyc2VuZCIsImFtb3VudFR5cGUiOiJTT1VSQ0UiLCJhbW91bnQiOjEwMDAsIm1lcmNoYW50Ijp7InJlc3VsdCI6InN1Y2Nlc3NmdWwiLCJtZXJjaGFudEV4aXN0cyI6dHJ1ZSwiY291bnRyeSI6Ik5HIiwiZGVmYXVsdFdhbGxldCI6Ik5HTiIsImlzTWVyY2hhbnQiOnRydWUsImZpcnN0TmFtZSI6IkVtbWFudWVsIiwibGFzdE5hbWUiOiJJa2VubmEiLCJlbWFpbCI6ImVtbWFudWVsQGV2ZXJzZW5kLmNvIiwicGhvbmVOdW1iZXIiOnsicHJlZml4IjoiKzIzNCIsIm51bWJlciI6IjcwMzgwODg5MDMifSwidGFnIjoiIiwiYXZhdGFyVVJMIjoiIiwic3RhdHVzIjoiIn19LCJpYXQiOjE2Nzg3OTc3ODIsImV4cCI6MTY3ODc5OTU4Mn0.97iw-ZQE_JZsE2ubVTkL7rP_yU-T0_6NnsZBzRLL-Fs",
    "quotation": {
      "sourceCountry": "NG",
      "sourceCurrency": "UGX",
      "sourceAmount": "1000",
      "destinationCountry": "NG",
      "destinationCurrency": "NGN",
      "destinationAmount": "191.83",
      "exchangeRate": "0.19182948517855",
      "totalFees": "0",
      "totalAmount": "1000.00",
      "type": "eversend",
      "amountType": "SOURCE",
      "amount": 1000,
      "beneficiary": {
        "accountExists": true,
        "firstName": "Emmanuel",
        "lastName": "Ikenna",
        "email": "[email protected]",
        "country": "NG",
        "defaultWallet": "NGN",
        "status": "valid",
        "phone": "+2347038088903"
      }
    }
  },
  "success": true
}

Follow this link to see more information: [Eversend Payout Quotation] (https://eversend.readme.io/reference/create-payout-quotation-eversend)

4. 👨‍💻 Make An Eversend Wallet Transfer Using The Quotation Token

After generating a token from the quotation endpoint, we will create a transaction using the token. See example request below:

const fetch = require('node-fetch');

const url = 'https://api.eversend.co/v1/payouts/eversend';
const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: 'Bearer 0ef0181a4a7de517647c73ea6d847a071c1b3643'
  },
  body: JSON.stringify({token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJxdW90YXRpb24iOnsic291cmNlQ291bnRyeSI6IlVHIiwic291cmNlQ3VycmVuY3kiOiJVR1giLCJzb3VyY2VBbW91bnQiOiIxMDAwIiwiZGVzdGluYXRpb25Db3VudHJ5IjoiVUciLCJkZXN0aW5hdGlvbkN1cnJlbmN5IjoiVUdYIiwiZGVzdGluYXRpb25BbW91bnQiOiIxMDAwIiwiZXhjaGFuZ2VSYXRlIjoiMSIsInRvdGFsRmVlcyI6IjEwMDAiLCJ0b3RhbEFtb3VudCI6IjIwMDAuMDAiLCJ0eXBlIjoibW9tbyIsImFtb3VudFR5cGUiOiJTT1VSQ0UiLCJhbW91bnQiOjEwMDB9LCJpYXQiOjE2Nzg3MTczNDUsImV4cCI6MTY3ODcxOTE0NX0.aTCKX1TP5lYjmXhSnUjSxELaqKZtFWNOL7fpo6kVq0I'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Response Sample:

{
   "code":200,
   "success":true
}

Follow this link to see more information: [Eversend Payout Transaction] (https://eversend.readme.io/reference/create-payout-transaction-eversend)