If you’re looking for a way to facilitate a payment between two accounts on your platform (what we describe as an account-to-account transfer), this guide will cover the flow for your use case. Some examples of account-to-account transfers include:
A marketplace enabling businesses to pay their vendors
A service platform allowing customers to pay their service providers
A SaaS company helping contractors to pay subcontractors
An HR tool with a feature where companies can pay their employees
For the purposes of this guide, we’ll assume you are a developer building a fitness marketplace with the following key players:
Fitness platform that connects gyms with fitness instructors (account facilitating the transfer)
Gym (account sending money, otherwise known as the source account)
Fitness instructor (account receiving money, otherwise known as the destination account)
In this use case, the fitness platform is not directly involved in the transaction. Their role is to help the gym pay a fitness instructor they’ve hired and booked through the platform.
If you are using a server-side integration, you can skip this step.
Assuming you’ve already completed a basic setup of your own account, you’ll need to generate an access token. You will include a new access token as the Moov Drop onboarding.token whenever you onboard a customer.
1
2
3
4
curl -X POST "https://api.moov.io/oauth2/token"\
-u "PUBLIC_KEY:PRIVATE_KEY"\
--data-urlencode "grant_type=client_credentials"\
--data-urlencode "scope=/accounts.write"\
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import{Moov,SCOPES}from'@moovio/node';constmoov=newMoov({accountID:"YOUR_MOOV_ACCOUNT_ID",publicKey:"PUBLIC_KEY",secretKey:"PRIVATE_KEY",domain:"YOUR_DOMAIN"});constscopes=[SCOPES.ACCOUNTS_CREATE];try{const{token}=awaitmoov.generateToken(scopes);// Do something with token
}catch(err){// Handle any errors
}
With Moov, all transfers represent the movement of money from a source to a destination. You will start by creating the source account and linking a bank account as the funding source. If you are looking to link a card rather than a bank account, see our guide on accepting card payments.
Start by creating a Moov account for the gym. Then, request the send-funds capability for the gym’s account. The capabilities GETendpoint will specify what information Moov needs about the gym as a company before we enable the requested capability. Read our capabilities guide for more information.
constmoov=Moov(token);constaccountPayload={accountType:"business",profile:{business:{legalBusinessName:"Whole Body Fitness LLC",businessType:"llc"}},capabilities:["send-funds"],foreignId:"your-correlation-id"};constaccount=awaitmoov.accounts.create({accountPayload});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
constmoov=newMoov(credentialsObject);constaccountPayload={accountType:"business",profile:{business:{legalBusinessName:"Whole Body Fitness LLC",businessType:"llc"}},capabilities:["send-funds"],foreignId:"your-correlation-id"};constaccount=awaitmoov.accounts.create(accountPayload);
Since the source account is a business requesting the send-funds capability, you will be required to submit certain pieces of information to Moov before we enable the capability. To get a list of everything you need to submit about the gym as a company, use the the capabilities GETendpoint. Read our capabilities guide for more information.
1
2
curl -X GET "https://api.moov.io/accounts/{accountID}/capabilities/"\
-H "Authorization: Bearer {token}"\
If you haven’t already added business representatives for the source account, you will need to do so as a required verification step. You can use the add representatives POSTendpoint. Read our guide on business representatives for more information.
constmoov=newMoov(credentialsObject);constaccountID="accountID";constrepresentativePayload={name:{firstName:"Amanda",lastName:"Yang"},address:{addressLine1:"12 Main Street",city:"Cabot Cove",stateOrProvince:"ME",postalCode:"04103",country:"US"},birthDate:{day:10,month:11,year:1985},email:"amanda@classbooker.dev",governmentID:{ssn:{full:"111111111",lastFour:"1111"}},responsibilities:{isController:false,isOwner:true,ownershipPercentage:38,jobTitle:"CEO"}};constaccount=awaitmoov.representatives.create(accountID,representativePayload);
constmoov=Moov(token);constaccountID="accountID";constrepresentativePayload={name:{firstName:"Amanda",lastName:"Yang"},address:{addressLine1:"12 Main Street",city:"Cabot Cove",stateOrProvince:"ME",postalCode:"04103",country:"US"},birthDate:{day:10,month:11,year:1985},email:"amanda@classbooker.dev",governmentID:{ssn:{full:"111111111",lastFour:"1111"}},responsibilities:{isController:false,isOwner:true,ownershipPercentage:38,jobTitle:"CEO"}};constaccount=awaitmoov.representatives.create(accountID,representativePayload);
Next, you will set up the Moov account for the fitness instructor. This will be the destination account, since the fitness
instructor is the one who will be receiving the funds.
Add a bank account for the fitness instructor. In our scenario, the fitness instructor’s bank account will only be used to receive funds, so micro-deposit verification is not required.
First, get a list of the available payment methods for both accounts through the retrieve transfer options POSTendpoint. The response includes all the payment methods the gym and fitness instructor can use based on their linked bank accounts and the amount of the transfer. If the gym is funding the payment with a linked bank account, you’ll always use a payment method type ach-debit-fund. The gym could also pay from their Moov wallet. Select the payment method you’d like to use for the transfer.