Wire API (US only)
Wire API provides all the functionality required to manage beneficiaries and initiate payments on your user's behalf.
The Payment APIs are:
- CreateWireTransfer - The easiest and most efficient way to facilitate payments.
- [Not required when using CreateWireTransfer] Get Wire beneficiaries - Retrieve beneficiaries from the bank account.
- [Not required when using CreateWireTransfer] Create Wire Beneficiary - Create a beneficiary into the bank account.
- [Not required when using CreateWireTransfer] CreateWireTransferToExistingBeneficiary - Initiate a transfer to an existing wire beneficiary only.
createWireTransfer [Recommended]
createWireTransfer
automatically takes care of all requirements for adding a beneficiary as well as initiating a transfer. We recommend using createWireTransfer
to initiate a payment.
you can send money from
an account to
an account with a specific amount
.All 3 variables are optional.
Parameters
Note
Behavior of the SDK depends on the parameters that will be set.
Parameter | Description |
---|---|
toBeneficiary | If you are accepting a transfer into your own company's account, you don't need to set the parameter. You can simply add one in your dashboard under your app. The toBeneficiary will automatically be set to that account. |
fromAccount | Account from where the amount must be transferred. If you don't set a from account, SDK will simply display a popup screen for your user to pick the account from our UI. If you do provide a from object, this screen won't be displayed. |
amount | Amount to be transferred. If you don't set an amount SDK will display a screen with a numpad screen for your user to enter the amount in. |
remark | A message associated with the transfer. |
Example - When fromAccount
Is Not Specified
DapiLinesAddress address = new DapiLinesAddress(
"Line1",
"Line2",
"Line3"
);
DapiWireBeneficiary wireBeneficiary = new DapiWireBeneficiary(
"TestAccount",
"John",
"Doe",
"JohnDoe",
address,
"Conway",
"Arkansas",
"US",
"72302",
"retail",
"checking",
"953345913",
"1234567654321"
);
await connection.CreateWireTransfer(wireBeneficiary, null, 100);
The SDK shows UI for the user to select an account to send money from
Example - When amount
Is Not Specified
DapiLinesAddress address = new DapiLinesAddress(
"Line1",
"Line2",
"Line3"
);
DapiWireBeneficiary wireBeneficiary = new DapiWireBeneficiary(
"TestAccount",
"John",
"Doe",
"JohnDoe",
address,
"Conway",
"Arkansas",
"US",
"72302",
"retail",
"checking",
"953345913",
"1234567654321"
);
await connection.CreateWireTransfer(wireBeneficiary, connection.Accounts.First());
The SDK shows UI for the user to enter the amount to send
Example - When amount
and fromAccount
Are Not Specified
DapiLinesAddress address = new DapiLinesAddress(
"Line1",
"Line2",
"Line3"
);
DapiWireBeneficiary wireBeneficiary = new DapiWireBeneficiary(
"TestAccount",
"John",
"Doe",
"JohnDoe",
address,
"Conway",
"Arkansas",
"US",
"72302",
"retail",
"checking",
"953345913",
"1234567654321"
);
await connection.CreateWireTransfer(wireBeneficiary);
The SDK shows UI for the user to select an account to send money from then navigate to the amount screen to enter the amount to send
CreateWireTransferToExistingBeneficiary
Note
If you use
createWireTransferToExistingBeneficiary
you have to implement bank processing logic and validations on your end. You will require the use of the following APIs to process a transaction:
- Get Account
- Create Wire Beneficiary
- Get Wire Beneficiaries
createWireTransfer
abstracts all these requirements. There is no need to implement bank processing logic or validations. Dapi recommends usingcreateWireTransfer
to initiate a payment.
A method for sending money to an existing wire beneficiary.
Parameters
Parameter | Description |
---|---|
fromAccount | Account from where the amount must be transferred. |
toBeneficiaryID | The id of the beneficiary to which the money must be transferred. Obtain by connection.getBeneficiaries() |
amount | Amount to be transferred |
remark | A message associated with the transfer. |
Example
await connection.CreateWireTransferToExistingBeneficiaryFromAccount(
beneficiaries.Data[0].Id,
account,
99.0,
"remark"
);
Beneficiary Not Activated error on Sandbox
This error occurs If you make a transfer on Sandbox to wrong or random beneficiary details, instead you should make the beneficiary details to be of another sandbox user.
To get the beneficiary details of a sandbox user you can do the following:
1- Open your app on the dashboard and navigate to the Sandbox tab. You'll see the Sandbox Users table.
2- Click an Account from the Accounts column.
3- A dialog shows up containing beneficiary details.
CreateWireBeneficiary
A method for adding a new wire beneficiary
Parameters
Parameter | Description |
---|---|
beneficiary | Information of the wire beneficiary to add. |
Example
DapiLinesAddress address = new DapiLinesAddress(
"Line1",
"Line2",
"Line3"
);
DapiWireBeneficiary wireBeneficiary = new DapiWireBeneficiary(
"TestAccount",
"John",
"Doe",
"JohnDoe",
address,
"Conway",
"Arkansas",
"US",
"72302",
"retail",
"checking",
"953345913",
"1234567654321"
);
await connection.CreateWireBeneficiary(wireBeneficiary);
GetWireBeneficiaries
A method for obtaining registered wire beneficiaries
Parameters
Method does not receive any parameter.
Example
await connection.GetWireBeneficiaries();
Updated 12 months ago