"description":"Enable if you want the result to include the 'assetBalances' field. This will make the call slower or could cause the call to fail if the asset balances cannot be loaded (i.e. due to a bad API key).",
"schema":{
"type":"boolean",
"default":false
}
}
],
"responses":{
"200":{
"description":"List of custodian accounts for the store.",
"description":"Enable if you want the result to include the 'assetBalances' field. This will make the call slower or could cause the call to fail if the asset balances cannot be loaded (i.e. due to a bad API key).",
"schema":{
"type":"boolean",
"default":false
}
}
],
"responses":{
"200":{
"description":"List of custodian accounts for the store.",
"description":"Trade one asset for another using a market order (=instant purchase with instant result or failure). A suitable asset pair will automatically be selected. If no asset pair is available, the call will fail.",
"parameters":[
{
"name":"storeId",
"in":"path",
"required":true,
"description":"The Store ID",
"schema":{
"type":"string"
}
},
{
"name":"accountId",
"in":"path",
"required":true,
"description":"The Custodian Account ID.",
"schema":{
"type":"string"
}
}
],
"requestBody":{
"x-name":"request",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/TradeRequestData"
}
}
}
},
"responses":{
"200":{
"description":"Information about the trade that was executed",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/TradeResultData"
}
}
}
},
"404":{
"description":"No tradable asset pair found for this trade."
},
"403":{
"description":"If you are authenticated but forbidden to create trades"
"description":"The unique code of the customer's account with this custodian. The format depends on the custodian."
},
"storeId":{
"type":"string",
"description":"The store ID."
},
"custodianCode":{
"type":"string",
"description":"The code for the custodian."
},
"name":{
"type":"string",
"description":"The name of the custodian account."
},
"assetBalances":{
"type":"array",
"nullable":true,
"description":"A real-time loaded list of all assets (fiat and crypto) on this custodian and the quantity held in the account. Assets with qty 0 can be omitted.",
"items":{
"$ref":"#/components/schemas/AssetBalanceData"
}
},
"config":{
"type":"object",
"nullable":true,
"description":"The configuration of this custodian account. Specific contents depend on the custodian and your access permissions."
}
},
"example":{
"accountId":"xxxxxxxxxxxxxxx",
"storeId":"xxxxxxxxxxxxxx",
"custodianCode":"kraken",
"name":"My Kraken Account",
"assetBalances":[
{
"asset":"BTC",
"qty":1.23456
},
{
"asset":"USD",
"qty":123456.78
}
],
"config":{
"WithdrawToAddressNamePerPaymentMethod":{
"BTC-OnChain":"My Ledger Nano"
},
"ApiKey":"xxx",
"PrivateKey":"xxx"
}
}
},
"CreateCustodianAccountRequest":{
"type":"object",
"additionalProperties":false,
"properties":{
"id":{
"type":"string",
"description":"The unique code of the customer's account with this custodian. The format depends on the custodian."
},
"storeId":{
"type":"string",
"description":"The store ID."
},
"custodianCode":{
"type":"string",
"description":"The code for the custodian."
},
"name":{
"type":"string",
"description":"The name of the custodian account."
},
"config":{
"type":"object",
"nullable":true,
"description":"The configuration of this custodian account. Specific contents depend on the custodian and your access permissions."
}
},
"example":{
"accountId":"xxxxxxxxxxxxxxx",
"storeId":"xxxxxxxxxxxxxx",
"custodianCode":"kraken",
"name":"My Kraken Account",
"config":{
"WithdrawToAddressNamePerPaymentMethod":{
"BTC-OnChain":"My Ledger Nano"
},
"ApiKey":"xxx",
"PrivateKey":"xxx"
}
}
},
"QuoteResultData":{
"type":"object",
"properties":{
"fromAsset":{
"type":"string",
"description":"The asset to trade.",
"nullable":false
},
"toAsset":{
"type":"string",
"description":"The asset you want.",
"nullable":false
},
"bid":{
"type":"number",
"description":"The bid price.",
"nullable":false
},
"ask":{
"type":"number",
"description":"The ask price",
"nullable":false
}
},
"example":{
"fromAsset":"USD",
"toAsset":"BTC",
"bid":30000.12,
"ask":30002.24
}
},
"TradeRequestData":{
"type":"object",
"properties":{
"fromAsset":{
"type":"string",
"description":"The asset to trade.",
"nullable":false
},
"toAsset":{
"type":"string",
"description":"The asset you want.",
"nullable":false
},
"qty":{
"oneOf":[
{
"type":"number",
"description":"The qty of fromAsset to convert into toAsset."
},
{
"type":"string",
"description":"The percent of fromAsset to convert into toAsset. The value must end with \"%\" to be considered a percentage."
}
],
"nullable":false
}
},
"example":{
"fromAsset":"USD",
"toAsset":"BTC",
"qty":"50%"
}
},
"TradeResultData":{
"type":"object",
"properties":{
"fromAsset":{
"type":"string",
"description":"The asset to trade."
},
"toAsset":{
"type":"string",
"description":"The asset you want."
},
"ledgerEntries":{
"type":"array",
"description":"The asset entries that were changed during the trade. This is an array of at least 2 items with the asset sold and the asset gained. It may also include ledger entries for the costs of the trade and possibly exchange tokens used.",
"items":{
"$ref":"#/components/schemas/LedgerEntryData"
}
},
"tradeId":{
"type":"string",
"description":"The unique ID of the trade used by the exchange. This ID can be used to get the details of this trade at a later time.",
"nullable":true
},
"accountId":{
"type":"string",
"description":"The unique ID of the custodian account used.",
"nullable":false
},
"custodianCode":{
"type":"string",
"description":"The code of the custodian used.",
"nullable":false
}
},
"example":{
"fromAsset":"USD",
"toAsset":"BTC",
"ledgerEntries":[
{
"asset":"BTC",
"qty":1.23456,
"type":"Trade"
},
{
"asset":"USD",
"qty":-61728,
"type":"Trade"
},
{
"asset":"BTC",
"qty":-0.00123456,
"type":"Fee"
},
{
"asset":"KFEE",
"qty":-123.456,
"type":"Fee"
}
],
"tradeId":"XXXX-XXXX-XXXX-XXXX",
"accountId":"xxxxxxxxxxxxxx",
"custodianCode":"kraken"
}
},
"WithdrawalRequestData":{
"type":"object",
"properties":{
"paymentMethod":{
"type":"string",
"description":"The payment method (cryptocode + network) of the withdrawal.",
"nullable":false
},
"qty":{
"type":"number",
"description":"The qty to withdraw.",
"nullable":false
}
},
"example":{
"paymentMethod":"BTC-OnChain",
"qty":0.123456
}
},
"WithdrawalResultData":{
"type":"object",
"properties":{
"asset":{
"type":"string",
"description":"The asset that is being withdrawn."
},
"paymentMethod":{
"type":"string",
"description":"The payment method that is used (crypto code + network)."
},
"ledgerEntries":{
"type":"array",
"description":"The asset entries that were changed during the withdrawal. The first item is always the withdrawal itself. It could also includes ledger entries for the costs and may include credits or exchange tokens to give a discount.",
"items":{
"$ref":"#/components/schemas/LedgerEntryData"
}
},
"withdrawalId":{
"type":"string",
"description":"The unique ID of the withdrawal used by the exchange.",
"nullable":true
},
"accountId":{
"type":"string",
"description":"The unique ID of the custodian account used.",
"nullable":false
},
"custodianCode":{
"type":"string",
"description":"The code of the custodian used.",
"nullable":false
},
"status":{
"type":"string",
"description":"The status of the withdrawal: 'Queued', 'Complete', 'Failed' or 'Unknown'.",
"nullable":false
},
"transactionId":{
"type":"string",
"description":"The transaction ID on the blockchain once the withdrawal has been executed.",
"nullable":true
},
"targetAddress":{
"type":"string",
"description":"The address where the funds were sent to once the withdrawal has been executed.",