Создание сделки на прием рубля (Продажа USDT)
Copy curl -- location 'https://api.exgobit.net/trade/createOffer/' \
-- header 'x-api-key: YOUR_API_KEY' \
-- header 'Content-Type: application/json' \
-- data '{
"amountFiat": "1500",
"fiatInfo": {
"providerCode": "",
"fiatCode": "RUB",
"cardNumber": "4276000000000000",
"cardHolder": "Test Test",
"phoneNumber": ""
},
"tokenCode": "USDT",
"type": 1
}'
Copy $request -> setRequestUrl ( 'https://api.exgobit.net/trade/createOffer/' ) ;
$request -> setRequestMethod ( 'POST' ) ;
$body = new http \ Message \ Body ;
$body -> append ( '{
"amountFiat": "1500",
"fiatInfo": {
"providerCode": "",
"fiatCode": "RUB",
"cardNumber": "4276000000000000",
"cardHolder": "Test Test"
},
"tokenCode": "USDT",
"type": 1
}' ) ;
$request -> setBody ( $body ) ;
$request -> setOptions ( array () ) ;
$request -> setHeaders ( array (
'x-api-key' => 'YOUR_API_KEY' ,
'Content-Type' => 'application/json'
) ) ;
$client -> enqueue ( $request ) -> send () ;
$response = $client -> getResponse () ;
echo $response -> getBody () ;
Copy {
"success" : true ,
"message" : "" ,
"addedOffers" : [
{
"status" : 1 ,
"id" : "c125ff95-7d7a-4c59-8fb5-255447df706d" ,
"message" : "Your offer successfully created." ,
"fiatInfo" : {
"id" : "" ,
"TraderCardId" : "00000000-0000-0000-0000-000000000000" ,
"providerCode" : "sber" ,
"fiatCode" : "RUB" ,
"cardNumber" : "4276000000000000" ,
"cardHolder" : "Test Test" ,
"fiatRate" : 91.2951125
} ,
"amountFiat" : "1500" ,
"humanId" : 4619 ,
"isGroup" : false
}
]
}
Если сумма сделки более 80000 руб, она будет поделена на несколько более маленьких. В данном случае придет массив в addedOffers, объеденены данные сделки будут с помощью humanId. Пример:
Copy {
"success" : true ,
"message" : "" ,
"addedOffers" : [
{
"status" : 1 ,
"id" : "69a2caf0-43b3-4ddb-ae45-ac8f087db2df" ,
"message" : "Your offer successfully created." ,
"fiatInfo" : {
"id" : "" ,
"TraderCardId" : "00000000-0000-0000-0000-000000000000" ,
"providerCode" : "sber" ,
"fiatCode" : "RUB" ,
"cardNumber" : "4276000000000000" ,
"cardHolder" : "Test test" ,
"fiatRate" : 91.40260025
} ,
"amountFiat" : "62000" ,
"humanId" : 4620 ,
"isGroup" : true
} ,
{
"status" : 1 ,
"id" : "f5deb07a-35c1-4a6d-b79a-7f14e7ef0f19" ,
"message" : "Your offer successfully created." ,
"fiatInfo" : {
"id" : "" ,
"TraderCardId" : "00000000-0000-0000-0000-000000000000" ,
"providerCode" : "sber" ,
"fiatCode" : "RUB" ,
"cardNumber" : "4276000000000000" ,
"cardHolder" : "Test test" ,
"fiatRate" : 91.40260025
} ,
"amountFiat" : "49000" ,
"humanId" : 4620 ,
"isGroup" : true
} ,
{
"status" : 1 ,
"id" : "2a8569ca-c58d-4978-9d3a-f5ec277aa7f9" ,
"message" : "Your offer successfully created." ,
"fiatInfo" : {
"id" : "" ,
"TraderCardId" : "00000000-0000-0000-0000-000000000000" ,
"providerCode" : "sber" ,
"fiatCode" : "RUB" ,
"cardNumber" : "4276000000000000" ,
"cardHolder" : "Test test" ,
"fiatRate" : 91.40260025
} ,
"amountFiat" : "30000" ,
"humanId" : 4620 ,
"isGroup" : true
} ,
{
"status" : 1 ,
"id" : "53ef24d0-19dc-4702-ab67-942c99ce0b51" ,
"message" : "Your offer successfully created." ,
"fiatInfo" : {
"id" : "" ,
"TraderCardId" : "00000000-0000-0000-0000-000000000000" ,
"providerCode" : "sber" ,
"fiatCode" : "RUB" ,
"cardNumber" : "4276000000000000" ,
"cardHolder" : "Test test" ,
"fiatRate" : 91.40260025
} ,
"amountFiat" : "9000" ,
"humanId" : 4620 ,
"isGroup" : true
}
]
}