Building a Bitcoin transfer request is exactly the same as a normal conversion between a traditional FX pair, but we've put a specific area together just to bring that to the attention of developers who were worried that it would be more complex than that.

Building the Bitcoin Transfer request

When building your Transfer request you can use 7 out of these 8 fields:

  • sourceAmount - only include either sourceAmount or destAmount, not both. sourceAmount is the amount removed from your main account in order to send funds to the dest. In this case you specify the amount removed from your account, and the destAmount will be determined depending on the fees and exchange rate.
  • sourceCurrency - an ISO 3166-1 alpha-3 currency code that will be deducted from your account.
  • dest - a destination for the funds. This can be an email address, phone number, blockchain address, or bank account. See the Transfer Pairs section on the left side for more information on what's required to send to a bank account.
  • destAmount - only include either sourceAmount or destAmount, not both. destAmount is the exact amount that will be deposited into the dest. If destAmount is specified in the Transfer creation request the sourceAmount will be calculated from the destAmount, the exchange rate any fees on the Transfer
  • destCurrency - an ISO 3166-1 alpha-3 currency code that matches the dest type. The destCurrency can be the same or different from the sourceCurrency. If they are different an exchange will automatically occur.
  • message - An optional log message to include with the transfer
  • callbackUrl - An optional url that Wyre will POST a status callback to (see Callbacks)
  • autoConfirm - An optional parameter to automatically confirm the transfer order. Not recommended.

Now, with all of that in mind, let's build our first transfer request. We'll send funds from our account to an email address to start. For this example let's assume we are a crypto brokerage service converting some BTC in order to payout to a USD bank account. This customer is expecting to receive 10 USD from us. An example request for this might be:

{
	"dest": "[email protected]",
	"sourceCurrency": "BTC",
	"destCurrency": "USD",
	"destAmount": 10,
	"message":"Here's your $10!",
  "autoConfirm": "false",
  "callbackUrl:" "https://requestb.in/"
}

Reviewing your Transfer

If we submit this request we'll get back a Transfer response that looks something like this:

{  
   "id":"PLV7BBP7MVJ",
   "status":"UNCONFIRMED",
   "failureReason":null,
   "language":"en",
   "createdAt":1491585756340,
   "completedAt":null,
   "depositInitiatedAt":null,
   "cancelledAt":null,
   "expiresAt":1491585816340,
   "owner": "account:i6rgs8mjdmmu7cnf7a5bgl0r0vudsfe5",
   "source": "account:i6rgs8mjdmmu7cnf7a5bgl0r0vudsfe5",
   "dest": "email:[email protected]",
   "sourceCurrency":"BTC",
   "sourceAmount":10.00,
   "destCurrency":"USD",
   "destAmount":59.62,
   "exchangeRate":5.96,
   "desc":"Unconfirmed: Exchange of 10.00 BTC to 59.62 USD",
   "message":null,
   "totalFees":0.00,
   "equivalencies":{  
      "EUR":0.00418079,
      "USD":10.00,
      "BRL":59.62
   },
   "feeEquivalencies":{  
      "BTC":0.00,
      "USD":0.00,
      "BRL":0.00
   },
   "fees":{  
      "USD":0.00,
      "BTC":0.00
   },
   "authorizingIp":"10.255.0.2",
   "paymentUrl":null,
   "exchangeOrderId":null,
   "chargeId":null,
   "depositId":null,
   "sourceTxId":null,
   "destTxId":null,
   "customId":null,
   "buy":false,
   "instantBuy":false,
   "sell":false,
   "exchange":true,
   "send":true,
   "deposit":false,
   "withdrawal":false,
   "closed":false,
   "reversingSubStatus":null,
   "reversalReason":null,
   "retrievalUrl":null,
   "quotedMargin":null,
   "pendingSubStatus":null,
   "destName":"SCHAM SCHLACTER",
   "sourceName":"Primary Account",
   "exchangeOrder":null,
   "estimatedArrival":1491585757279,
   "blockchainTx":null,
   "documents":[  

   ],
   "reversalRevenue":null,
   "reversalRevenueCurrency":null,
   "depositInfo":null,
   "chargeInfo":null
}

The above response issues an exchange rate quote for the volume of funds you wish to move. Our exchange rates API gives a good snapshot of what our exchange rates are, but the final exchange rate you'll see is dependent on the quantity of funds you're moving.

Once you've created the Transfer it will be in an UNCONFIRMED state. You will have 30 seconds to review the Transfer and confirm it before the quote expires. If the quote expires you'll have to reissue the Transfer request and confirm the new Transfer (more on that in the next section ).

When reviewing the Transfer the main things you'll want to check out are the:

  • exchangeRate - The quoted exchange rate for the Transfer
  • fees - The fees object is a currency-> amount map of any fees that are applied on the Transfer. Make sure you check here to see what fees you'll be paying on the Transfer. If you are doing an exchange Transfer and we encounter fees on either side of the conversion you may see multiple entries here. For example, if you were moving funds from a USD bank account to a BRL bank account, there would be a USD fee for the deposit into Wyre and a BRL fee for the withdrawal from Wyre
  • sourceAmount/destAmount - depending on the request you made, you'll want to double check these fields at this stage and make sure that you're either sending or receiving the amount you expected.
Language