createTransfer

Before you can create a transfer you must create a wallet.

After using the createTransfer mutation, the next step is to use finalizeTransfer to initiate the transfer.

If wire attribute is not provided on the mutation, it will default to false. This will prioritize a local payment over a wire.

Parameters

Parameter Type Required
user_id UUID! true
entity_id UUID! true
source_amount String false
wallet_id UUID false
destination_amount String false
account_id UUID false
beneficiary_id UUID! true
purpose_of_payment String! true
reference String false
wire Boolean false
document_reference String false

Graphql

GraphQL

mutation createTransfer (
    $user_id: UUID!
    $entity_id: UUID!
    $source_amount: String
    $wallet_id: UUID
    $destination_amount: String
    $beneficiary_id: UUID!
    $purpose_of_payment: String!
    $reference: String
) {
    createTransfer (
        user_id: $user_id
        entity_id: $entity_id
        source_amount: $source_amount
        wallet_id: $wallet_id
        destination_amount: $destination_amount
        beneficiary_id: $beneficiary_id
        purpose_of_payment: $purpose_of_payment
        reference: $reference
    )
}

query

string

Defaults to {}

``200 200

object

data

object

createTransfer

string

``400 400

// mutation createTransfer

var axios = require('axios');

var data = JSON.stringify({
  query: `mutation createTransfer ($user_id: UUID!, $entity_id: UUID!, $source_amount: String, $wallet_id: UUID, $destination_amount: String, $account_id: UUID, $beneficiary_id: UUID!, $purpose_of_payment: String!, $reference: String) {
    createTransfer (user_id: $user_id, entity_id: $entity_id, source_amount: $source_amount, wallet_id: $wallet_id, destination_amount: $destination_amount, account_id: $account_id, beneficiary_id: $beneficiary_id, purpose_of_payment: $purpose_of_payment, reference: $reference)
}`,
  variables: {"user_id":"28291265-e6f7-488c-94c4-5905bbcf779a","entity_id":"a530debe-898f-447b-836c-1ba7d3001d91","source_amount":"100","wallet_id":"11b6747c-6706-4fe7-8112-10329fd07cf1","beneficiary_id":"63b6747c-6706-4fe7-8112-10329fd07cf1","purpose_of_payment":"athletic services","reference":"hit 3000"}
});

var config = {
  method: 'post',
  url: 'https://sandbox.external.routefusion.com/graphql',
  headers: {
    'Authorization': 'Bearer <your token>',
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

{ "data": { "createTransfer": "18ea46e5-2c36-4862-9eac-adc44364df7b" } }