Create an Order
Create an exchange order for specific exchange direction. You can specify how much you need to send or receive via deposit_amount or withdrawal_amount parameters.
URL: https://www.alfa.cash/api/create.json
Method: POST
Data required:
{
"gate_deposit": "Example: 'bitcoin'. Gate column from Direction of the exchange",
"gate_withdrawal": "Example: 'litecoin'. Gate column from Direction of the exchange",
"pair": "[DEPRECATED] Example: 'BTC_LTC'. Direction of the exchange, defined in the form [source_currency_code]_[destination_currency_code].",
"deposit_amount": "(Optional) example: '4.953', fixed deposit amount you'd like to send for an exchange.",
"withdrawal_amount": "(Optional) example: '6.431', fixed withdrawal amount you'd like to get after an exchange is made.",
"email": "Example: '[email protected]'",
"options": "Example: {'address': '1FgThhtLdSM1i78vXHGovA3WxzbTWA2mse'}, this array of parameters depends on source_currency_code.",
"r_uid": "(Optional) example: '2f777791', Affiliate Program ID.",
"promo_code": "(Optional) example: 'ALFACODE'."
}
Success Output example:
{
"secret_key": "Example: '11fb9a42045b0bf35ef40b8e96e45ebe', your order unique secret key which is used to track your order's status.",
"deposit": "(JSON Object) depending on deposit coin, there will be deposit address, array structure is the same as options.",
"deposit_amount": "Amount you'd need to send to complete an exchange.",
"withdrawal_amount": "Amount you'd receive upon completing exchange",
"order_id": "Unique order id in our system"
}
Error Output example:
{"error": "Missing required argument pair"}
cURL (example):
curl -X POST https://www.alfa.cash/api/create.json \ -H "Content-Type:application/json" \ --data '{"gate_deposit":"bitcoin","gate_withdrawal":"litecoin","deposit_amount":"1.4561","email":"[email protected]","options":{"address":"mnD8wHZKfdSwoKyW4H44spK2MqGAEXNbG9"}}'Response (example):
{ "secret_key": "fdce47f91e4b28c50e9f08beb4e43dee", "deposit": {"address":"n1S9pzENwn3QQgHcCE3afyxVrL57798eA2"}, "deposit_amount": 0.00827399, "withdrawal_amount": 0.87673802, "order_id": "581572" }
Get Current Exchange Rate
This method returns the current exchange rate between the currencies specified in the pair at the moment. Exchange rate can quickly change depending on the market.
URL: https://www.alfa.cash/api/rate.json
Method: POST
Data required:
{
"gate_deposit": "Example: 'bitcoin'. Gate column from Direction of the exchange",
"gate_withdrawal": "Example: 'litecoin'. Gate column from Direction of the exchange",
"pair": "[DEPRECATED] Example: 'BTC_LTC', direction of the exchange, defined in the form [source_currency_code]_[destination_currency_code].",
"deposit_amount": "(Optional) example: '4.952', fixed deposit amount you'd like to send for an exchange.",
"withdrawal_amount": "(Optional) example: '6.431', fixed withdrawal amount you'd like to get after an exchange is made.",
"promo_code_discount": "(Optional) example: '10', discount percent returned from promo code validation."
}
Success Output example:
{"gate_deposit": "bitcoin", "gate_withdrawal": "litecoin", "pair": "BTC_LTC", "rate": 1.213456}
Error Output example:
{"error": "Invalid pair"}
cURL (example):
curl -X POST https://www.alfa.cash/api/rate.json \ -H "Content-Type:application/json" \ --data '{"gate_deposit": "bitcoin", "gate_withdrawal": "litecoin"}'Response (example):
{"gate_deposit": "bitcoin", "gate_withdrawal": "litecoin", "pair": "BTC_LTC", "rate": "108.82046494"}
Validate Address
Verify specific currency address/account with additional parameters like destination_tag, message or payment_id.
URL: https://www.alfa.cash/api/validateaddress.json
Method: POST
Data required:
{
"gate_withdrawal": "Gate", // example: "bitcoin", Direction of the exchange
"currency": "[DEPRECATED] Currency", // example: "BTC", Currency Codes
"options": "Example: {'address': '1FgThhtLdSM1i78vXHGovA3WxzbTWA2mse'} This array of parameters depends on source_currency_code" // array of params
}
Success Output example:
{"valid": "true"}
Error Output example:
{"error": "Invalid payment_id"}
cURL (example):
curl -X POST https://www.alfa.cash/api/validateaddress.json \ > -H "Content-Type:application/json" \ > --data '{"gate_withdrawal":"stellar","options":{"account":"GAKUWGKLFUDBCS2JHZUTRUPXL5Q7C3KC2XXEGLK2J6JBILD2HYBYD55H","memo":"b5db89975bc958fa"}}'Response (example):
{"valid": true}
Promo Code Validation
Validates Promo Code for specific exchange direction (pair).
URL: https://www.alfa.cash/api/promo_code.json
Method: POST
Data required:
{
"code": "Example: 'ALFACODE'",
"gate_deposit": "Example: 'bitcoin'. Gate column from Direction of the exchange",
"gate_withdrawal": "Example: 'litecoin'. Gate column from Direction of the exchange",
"pair": "[DEPRECATED] Example: 'BTC_LTC', direction of the exchange, defined in the form [source_currency_code]_[destination_currency_code].",
}
Success Output example:
{"discount": "10"}
Error Output example:
{"error": "Invalid Promo Code"}
cURL (example):
curl -X POST https://www.alfa.cash/api/promo_code.json \ -H "Content-Type:application/json" \ --data '{"code":"ALFACODE","gate_deposit": "bitcoin", "gate_withdrawal": "litecoin"}'Response (example):
{"discount": "10"}