Transfer funds to yourself

When the same person or company is on both sides of a transfer, we call that a self-to-self transfer. Some examples of self-to-self transfers include:

  • A company transferring funds between accounts at two separate banks
  • A contractor moving money from their Moov wallet to their bank account
  • A platform adding funds from their bank account to their Moov wallet

In this guide, we’ll be covering the flow for creating a self-to-self transfer. We’ll use an example where you’re performing a transfer from your wallet to your bank account. For the purposes of this guide, we’ll assume that you’ve created a Moov account and gotten your API keys. For more detailed instructions, see our quick start guide.

1. Set up the account

Start by creating your Moov account. Request the send-funds capability for the account. You will need to submit specific data about the user to Moov for verification before the capability is enabled. See our capabilities guide for a list of required information.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
curl -X POST "https://api.moov.io/accounts" \
  -H "Authorization: Bearer {token}" \
  --data-raw '{
    "accountType": "individual",
    "profile": {
      "individual": {
        "email": "julesjacksonyoga@moov.io",
        "name": {
          "firstName": "Jules",
          "lastName": "Jackson",
        }
      },
      "capabilities": ["send-funds"],
      "foreignID": "your-correlation-id"
    }
  }'\
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
const moov = new Moov(credentialsOjbect);

const accountPayload = {
  accountType: "individual",
  profile: {
    individual: {
      email: "julesjacksonyoga@moov.io",
      name: {
        firstName: "Jules",
        lastName: "Jackson"
      }
    }
  },
  capabilities: ["send-funds"],
  foreignID: "your-correlation-id"
};

const account = await moov.accounts.create(accountPayload);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
const moov = Moov(token);

const accountPayload = {
  accountType: "individual",
  profile: {
    individual: {
      email: "julesjacksonyoga@moov.io",
      name: {
        firstName: "Jules",
        lastName: "Jackson"
      }
    }
  },
  capabilities: ["send-funds"],
  foreignID: "your-correlation-id"
};

const account = await moov.accounts.create({accountPayload});

2. Add bank account

Next, link your bank account account to your Moov account.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl -X POST "https://api.moov.io/accounts/{account_id}/bank-accounts" \
  -H "Authorization: Bearer {token}" \
  --data-raw '{
    "account": {
      "holderName": "Jules Jackson",
      "holderType": "individual",
      "accountNumber": "0004321567000",
      "bankAccountType": "checking",
      "routingNumber": "123456789"
    }
  }'\
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
const moov = new Moov(credentialsObject);

const accountID = "accountID";
const bankAccountPayload = {
  holderName: "Jules Jackson",
  holderType: "individual",
  accountNumber: "0004321567000",
  bankAccountType: "checking",
  routingNumber: "123456789"
};

const bankAccount = await moov.bankaccounts.link(accountID, bankAccountPayload);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
const moov = Moov(token);

const accountID = "accountID";
const bankAccountPayload = {
  holderName: "Jules Jackson",
  holderType: "individual",
  accountNumber: "0004321567000",
  bankAccountType: "checking",
  routingNumber: "123456789"
};

moov.accounts.bankAccounts.link({accountID, bankAccountPayload});

4. Get payment methods

First, get a list of the available payment methods from the generate transfer options POST endpoint. Specify your account ID as both the source and the destination. You will get a list that includes all the payment methods you can use to make a self-to-self transfer. The payment method for the source of the transfer will be moov-wallet, while the payment method for the destination will be ach-credit-standard or ach-credit-same-day.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
curl -X POST "https://api.moov.io/transfer-options" \
  -H "Authorization: Bearer {token}" \
  --data-raw '{
    "amount": {
      "value": 100,
      "currency": "USD"
    }
    "destination": {
      "accountID": "UUID"
    },
    "source": {
      "accountID": "UUID"
    }
  }'\
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
const moov = new Moov(credentialsObject);

const sourceAccountID = "sourceAccountID";
const destinationAccountID = "destinationAccountID";
const transferOptions = {
  amount: {
    value: 100, 
    currency: "USD"
  },
  destination: {
    accountID: destinationAccountID
  },
  source: {
    accountID: sourceAccountID
  }
}

const options = await moov.transfers.getTransferOptions(transferOptions);

5. Initiate the transfer

Once you’ve selected your payment methods, you can initiate a transfer from your bank account to your wallet, using the payment method IDs you got earlier in the transfer options request.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
curl -X POST "https://api.moov.io/transfers" \
  -H "Authorization: Bearer {token}" \
  -H "X-Idempotency-Key: [a valid v4 UUID]" \
  -H "X-Wait-For: rail-response" \
  --data-raw '{
    "source": {
      "paymentMethodID": "UUID"
    },
    "destination": {
      "paymentMethodID": "UUID"
    },
    "amount": {
      "value": 100,
      "currency": "USD"
    },
    "description": "Wallet cash out from last pay period"
  }'\
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
const moov = new Moov(credentialsObject);

const transferPayload = {
  source: {
    paymentMethodID: "source-payment-method-id",
  },
  destination: {
    paymentMethodID: "destination-payment-method-id",
  },
  amount: {
    value: 100,
    currency: "USD"
  },
  description: "Wallet cash out from last pay period"
}

const transfer = await moov.transfers.create(transferPayload);

What’s next

Feel free to explore Moov.js, our in-browser JavaScript SDK. Or, if you’re interested in other use cases, you can dive into our guides:

Summary Beta