API Reference
Wallets
Initialize Swap: USD to BTC [POST]

Initialize Swap: USD to BTC

https://sandboxapi.bitnob.co/api/v1/wallets/initialize-swap-for-bitcoin (opens in a new tab)


Body Parameters

ParametertypeRequired
amountint32

Request

Wallets/Initialize Swap: USD to BTC[POST]
curl --request POST \
   --url https://sandboxapi.bitnob.co/api/v1/wallets/initialize-swap-for-bitcoin \
   --header 'Authorization: Bearer API-KEY' \
   --header 'accept: application/json' \
   --header 'content-type: application/json' \
   --data '{"amount":0}'

</Tabs.Tab>

<Tabs.Tab>
```javascript copy filename="Wallets/Initialize Swap: USD to BTC[POST]"
const axios = require('axios');

const options = {
method: 'POST',
url: 'https://sandboxapi.bitnob.co/api/v1/wallets/initialize-swap-for-bitcoin',
headers: {
accept: 'application/json',
'content-type': 'application/json',
Authorization: 'Bearer API-KEY'
},
data: {amount: 0}
};

axios
.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});

Responses

🟢 200 - Result example
{
"status": true,
"message": "Quote retrived successfully",
"data": {
  "quote": {
    "expiration": "2024-03-05T10:05:32.156Z",
    "expirationInSec": "210",
    "amount": 1,
    "volume": 0.00001502,
    "price": 66594.928,
    "__v": 0,
    "description": "quote for buying $1 of BTC",
    "id": "65e6ed9ae6e92367539f666a"
  },
  "quoteId": "65e6ed9ae6e92367539f666a"
}
}
 
Last updated on