v1

latestOpenAPI 3.1.02026-07-26165182724.7 KB
wallets

Swap Currencies

Swap currencies between accounts

post/business/swap

Request body

businessIdstring uuid required

Unique Id of the business who is sending this transactions

sourceAccountIdstring required

The Id of the account to debit

destinationAccountIdstring required

The Id of the account to credit

amountstring required

The amount denominated in the smallest divisible unit of the sending currency. For example, cents or satoshis

ipstring ipv4 required

IP address collected as the IP address from which the End User is making the swap request

memostring

Optional memo - Alphanumeric string upto 15 characters in length

simulateFailureboolean

The simulateFailure key is a boolean value that, when set to true, instructs the API to simulate a failed case. This feature is only available in a sandbox environment

fixedFeestring

Optional fixedFee in Euro cents to override the default application fee configuration. This amount can only be <= the default configured amount for this transaction type.

percentFeeBpsstring

Optional percentage fee in bps to override the default application fee configuration. This amount can only be <= the default configured amount for this transaction type.

Example request

{
  "businessId": "7ea299d5-ffa8-4782-8331-2b7d61c0c730",
  "sourceAccountId": "3ccb333381f6cc52c6c3aa09b0686d41",
  "destinationAccountId": "d8a8c7c7ceeec2c221971febd00d5685",
  "amount": "52057",
  "memo": "leverage synergistic markets"
}

Response

success

idstring required
sourceAccountIdstring required
destinationAccountIdstring required
memostring required
statusstring required
txTypestring required
datetimestring date-time required
sourceSyncedOwnerIdstring required
destinationSyncedOwnerIdstring required

Example response

{
  "id": "358f5e37-4e15-424e-9479-3037cf68989a",
  "sourceAccountId": "3ccb333381f6cc52c6c3aa09b0686d41",
  "destinationAccountId": "d8a8c7c7ceeec2c221971febd00d5685",
  "memo": "leverage synergistic markets",
  "status": "COMMITTED",
  "txType": "CURRENCY_EXCHANGE",
  "order": {
    "id": "e8a1d656-50c4-4e73-bd79-985beb181948",
    "price": "32451.66",
    "type": "buy",
    "ticker": "BTCEUR",
    "debit": {
      "currency": "EUR",
      "amountFloat": "520.57",
      "amount": "52057"
    },
    "credit": {
      "currency": "BTC",
      "amountFloat": "0.01604139",
      "amount": "1604139"
    }
  },
  "datetime": "2023-10-27T10:53:31.875Z",
  "balanceBefore": {
    "balance": "107207",
    "amount": "107207",
    "currency": "cents"
  },
  "balanceAfter": {
    "balance": "55150",
    "amount": "55150",
    "currency": "cents"
  },
  "sourceSyncedOwnerId": "7ea299d5-ffa8-4782-8331-2b7d61c0c730",
  "destinationSyncedOwnerId": "7ea299d5-ffa8-4782-8331-2b7d61c0c730",
  "feeEstimate": {
    "totalFee": "644",
    "networkFee": "0",
    "ourFee": "0",
    "theirFee": "644",
    "feeCurrency": "EUR",
    "fixedFeeDetails": {
      "amount": "11",
      "exchangeRate": "1",
      "appliedFeeCents": "11"
    },
    "percentageFeeDetails": {
      "amount": "633",
      "appliedFeeBps": "120"
    }
  }
}