createTrade

Create new trade and returns trade info

POST /trades/createTrade

Headers

NameValue

Content-Type

application/json

Y_API_KEY

Public API Key

Signature

HMAC SHA256 of Body

Body

NameTypeDescription

send_name

string

Currency being sent

get_name

string

Currency being received

send_network

string

Network of currency being sent

get_network

string

Network of currency being received

send_value or get_value

number

Amount of the exchange you will receive or pay

get_creds

string

Сredentials

uniq_id optional

strung

Unique id of trade

Bank for receiving via SBP

exch_type

string

commission

float

additional commission in percent, which is considered your profit (default 0.5)

If you pass send_value and get_value parameters at once, the amount payable will be automatically calculated so that you get an amount from get_value.

"exch_type": "yellow" #rate will fix for 10 minutes
"exch_type": "green" #the rate is fixed at the moment payment is received

Response

{
	"send_name": "USDT",
	"send_network": "TRC20",
	"get_network": "ERC20",
	"uniq_id": "nf4i3rh394h",
	"": 1,
	"": "WalletForPay",
	"": "someHash",
	"": "someHash",
	"get_creds": "WalletForRecive",
	"network_commission": 0,
	"date": 1720120863,
	"": 1720142463,
	"": "112",
	"": "100",
	"exch_type": "yellow",
}

Example

const fetch = require('node-fetch');

let url = 'https://api.yellowchanger.com/trades/createTrade';

let options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Y_API_KEY: 'Your API Key',
    Signature: '0002b135569a4a29b7e7bf9489114eca8fa31e7f61a9e8e26b89bb7dfd4dcf5c'
  },
  body: '{"send_name":"USDT","get_name":"USDT","send_value":100,"send_network":"TRC20","get_network":"ERC20", "uniq_id":"nf4i3rh394h", "get_creds":"address, card or number"}'
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Last updated