Transfer funds between wallets

Overview

Once funds have been deposited into a vault, they can be moved between vaults as required.

1. Get the ID of the source and destination vaults

Retrieve a vault for the sender and recipient of the payment by a call to GET /api/Customers/{id}/wallets

[
  {
    "links": {},
    "id": "string",
    "holderId": "string",
    "number": "string",
    "name": "string",
    "status": "Open",
    "statusReason": "string",
    "balance": 0,
    "opened": "2017-06-08T12:39:57.856Z",
    "currencyCode": "string"
  }
]

Using the ID from the above request construct a new JSON object

2. Construct a new request

To create a transfer between vaults the following data is required

Field NameDescription
sourceAccountIdThe id of the vault from which funds will be taken
destinationAccountIdThe id of the vault from which funds will be taken
descriptionThe year that the card will expire
AmountThe amount to be transferred

This data should be formatted as a JSON object as shown below.

{
  "sourceAccountId": "string",
  "destinationAccountId": "string",
  "description": "string",
  "amount": 0
}

3. Send your request

Once you have created the above object you can send it as the body of a post request to the /api/Transactions end point

var data = JSON.stringify(Mdeol);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://example.com/api/transactions");

xhr.send(data);

If the request is successful the response body will contain the following information

{
  "links": {},
  "id": "string",
  "description": "string",
  "amount": 0,
  "timestamp": "2017-06-08T12:39:58.101Z",
  "creditAccount": {
    "accountType": "string",
    "links": {},
    "id": "string",
    "holderId": "string",
    "number": "string",
    "name": "string",
    "status": "Open",
    "statusReason": "string",
    "balance": 0,
    "opened": "2017-06-08T12:39:58.101Z",
    "currencyCode": "string",
    "holder": {}
  },
  "debitAccount": {
    "accountType": "string",
    "links": {},
    "id": "string",
    "holderId": "string",
    "number": "string",
    "name": "string",
    "status": "Open",
    "statusReason": "string",
    "balance": 0,
    "opened": "2017-06-08T12:39:58.101Z",
    "currencyCode": "string",
    "holder": {}
  },
  "status": "Pending"
}