Create Transaction
POST createTransaction
You can create a new transaction.
HTTP Request
https://interface.flashift.app/api/dev/v1/createTransaction
Request
- Request
- Payload
- cURL
- Python
- JavaScript
Header Parameters
Name | Type | Required | Description |
---|---|---|---|
Authorization | string | Yes | Your API Key |
Accept | string | Yes | Set this to application/json |
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
provider_name | string | Yes | The name of the exchange provider. |
currency_from | string | Yes | The currency you are exchanging from (e.g., BTC). |
currency_to | string | Yes | The currency you are exchanging to (e.g., USDTERC20). |
to_address | string | Yes | The recipient's address for the target currency. |
to_extra_id | string | Optional | An additional identifier required by some currencies (e.g., destination tag for XRP). |
amount | string | Yes | The amount of the currency you are exchanging from. |
fixed | boolean | Yes | Indicates whether the exchange rate is fixed or floating. |
application/json
{
"provider_name": "Exolix",
"currency_from": "btc",
"currency_to": "usdterc20",
"to_address": "0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326",
"to_extra_id": "",
"amount": "0.1",
"fixed": false
}
Example with Extra ID
application/json
{
"provider_name": "Exolix",
"currency_from": "btc",
"currency_to": "xrp",
"to_address": "rGrvdFfjLxMb7L6s8toi5tEeEtHgP9QDMy",
"to_extra_id": "3002133",
"amount": "0.1",
"fixed": false
}
curl --location --request POST 'https://interface.flashift.app/api/dev/v1/createTransaction' \
--header 'Authorization: {{apiKey}}' \
--header 'Accept: application/json' \
--data-raw '{
"provider_name": "Exolix",
"currency_from": "btc",
"currency_to": "xrp",
"to_address": "rGrvdFfjLxMb7L6s8toi5tEeEtHgP9QDMy",
"to_extra_id": "3002133",
"amount": "0.1",
"fixed": false
}'
import requests
import json
# Define the API URL
url = 'https://interface.flashift.app/api/dev/v1/createTransaction'
# Define the headers, including the API key
headers = {
'Authorization': '{{apiKey}}',
'Content-Type': 'application/json', # Ensure the correct content type is set
'Accept': 'application/json' # Add Accept header to specify the response format
}
# Define the JSON payload
data = {
"provider_name": "Exolix",
"currency_from": "btc",
"currency_to": "xrp",
"to_address": "rGrvdFfjLxMb7L6s8toi5tEeEtHgP9QDMy",
"to_extra_id": "3002133",
"amount": "0.1",
"fixed": False
}
# Send the POST request with headers and JSON data
response = requests.post(url, headers=headers, json=data)
# Check if the request was successful
if response.status_code == 200:
# Print the JSON response
print(response.json())
else:
print(f"Failed to create transaction. Status code: {response.status_code}")
// Define the API URL
const url = 'https://interface.flashift.app/api/dev/v1/createTransaction';
// Define the headers, including the API key
const headers = new Headers({
'Authorization': '{{apiKey}}',
'Content-Type': 'application/json', // Ensure the correct content type is set
'Accept': 'application/json' // Add Accept header to specify the response format
});
// Define the JSON payload
const data = {
provider_name: "Exolix",
currency_from: "btc",
currency_to: "xrp",
to_address: "rGrvdFfjLxMb7L6s8toi5tEeEtHgP9QDMy",
to_extra_id: "3002133",
amount: "0.1",
fixed: false
};
// Send the POST request with headers and JSON data
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(data)
})
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error(`Failed to create transaction. Status code: ${response.status}`);
}
})
.then(data => {
// Print the JSON response
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
Response
- Example
- Success
- Errors
Sample Response
application/json
{
"status": "OK",
"exchange_id": "Exolix_floating_XXXXXXX"
}
Response Parameters
Name | Type | Description |
---|---|---|
status | string | The status of the transaction (e.g., "OK" if successful) |
exchange_id | string | The unique identifier for the created exchange transaction |
Error codes
Code | Description |
---|---|
429 | This means you've already reached the API limit. If you need an increased rate limit, please contact [email protected], or you can wait until the limit is reset. |
500 | There is an error on the server side. |