Информация о счете
Чтобы получить информацию о статусе счетов, отправьте POST запрос на следующий URL:
Информация о счетах
POST
https://api.cryptocloud.plus/v2/invoice/merchant/info
Запрос для получения информации о счетах по уникальным идентификаторам.
Максимальное количество идентификаторов в одном запросе — 100.
Request Body
Name
Type
Description
uuids*
array
Список идентификаторов счетов (INV-XXXXXXXX или XXXXXXXX)
{
"status": "success",
"result": [
{
"uuid": "INV-XXXXXXXX",
"address": "",
"expiry_date": "2023-01-01 12:00:00.000000",
"side_commission": "client",
"side_commission_cc": "client",
"amount": 100.2,
"amount_usd": 100.2,
"received": 100.2,
"received_usd": 100.2,
"fee": 1.4,
"fee_usd": 1.4,
"service_fee": 0,
"service_fee_usd": 1.9,
"status": "overpaid",
"order_id": "1111",
"currency": {
"id": 4,
"code": "USDT",
"fullcode": "USDT_TRC20",
"network": {
"code": "TRC20",
"id": 4,
"icon": "https://cdn.cryptocloud.plus/currency/crypto/TRX.svg",
"fullname": "Tron"
},
"name": "Tether",
"is_email_required": false,
"stablecoin": true,
"icon_base": "https://cdn.cryptocloud.plus/currency/icons/main/usdt.svg",
"icon_network": "https://cdn.cryptocloud.plus/icons-currency/USDT-TRC20.svg",
"icon_qr": "https://cdn.cryptocloud.plus/currency/icons/stroke/usdt.svg",
"order": 1
},
"project": {
"id": 1,
"name": "MyStore",
"fail": "https://test.com?order_id=1111&invoice_uuid=INV-XXXXXXXX",
"success": "https://test.com?order_id=1111&invoice_uuid=INV-XXXXXXXX",
"logo": null
},
"test_mode": false
},
{
"uuid": "INV-XXXXXXXX",
"address": "",
"expiry_date": "2023-01-01 12:00:00.000000",
"side_commission": "client",
"side_commission_cc": "client",
"amount": 100.0,
"amount_usd": 100.0,
"received": 0,
"received_usd": 0,
"fee": 1.4,
"fee_usd": 1.4,
"service_fee": 1.9,
"service_fee_usd": 1.9,
"status": "created",
"order_id": "1111",
"currency": {
"id": 4,
"code": "USDT",
"fullcode": "USDT_TRC20",
"network": {
"code": "TRC20",
"id": 4,
"icon": "https://cdn.cryptocloud.plus/currency/crypto/TRX.svg",
"fullname": "Tron"
},
"name": "Tether",
"is_email_required": false,
"stablecoin": true,
"icon_base": "https://cdn.cryptocloud.plus/currency/icons/main/usdt.svg",
"icon_network": "https://cdn.cryptocloud.plus/icons-currency/USDT-TRC20.svg",
"icon_qr": "https://cdn.cryptocloud.plus/currency/icons/stroke/usdt.svg",
"order": 1
},
"project": {
"id": 1,
"name": "MyStore",
"fail": "https://test.com?order_id=1111&invoice_uuid=INV-XXXXXXXX",
"success": "https://test.com?order_id=1111&invoice_uuid=INV-XXXXXXXX",
"logo": null
},
"test_mode": false
}
]
}
{
"status": "error",
"result": {
"validate_error": "Max 100 uuids"
}
}
{
"detail": "Credentials were not provided"
}
{
"detail": "Signature verification failed"
}
Примеры запросов
Эти примеры показывают, как можно выполнить запрос для получения информации о счете по его INV номеру. Обратите внимание, что необходимо предоставить ваш API ключ в заголовке Authorization
для успешной авторизации запроса.
curl -X POST https://api.cryptocloud.plus/v2/invoice/merchant/info \
-H "Authorization: Token <API KEY>" \
-H "Content-Type: application/json" \
-d '{"uuids":["INV-XXXXXXXX","INV-YYYYYYYY"]}'
import requests
url = "https://api.cryptocloud.plus/v2/invoice/merchant/info"
headers = {
"Authorization": "Token <API KEY>"
}
data = {
"uuids": ["INV-XXXXXXXX", "INV-YYYYYYYY"]
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Success:", response.json())
else:
print("Fail:", response.status_code, response.text)
fetch('https://api.cryptocloud.plus/v2/invoice/merchant/info', {
method: 'POST',
headers: {
'Authorization': 'Token <API KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
uuids: ['INV-XXXXXXXX', 'INV-YYYYYYYY']
})
})
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error('Fail: ' + response.status + ' ' + response.statusText);
}
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cryptocloud.plus/v2/invoice/merchant/info");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
"uuids" => array("INV-XXXXXXXX", "INV-YYYYYYYY")
)));
$headers = array(
"Authorization: Token <API KEY>",
"Content-Type: application/json"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($statusCode == 200) {
echo "Success: " . $response;
} else {
echo "Fail: " . $statusCode . " " . $response;
}
}
curl_close($ch);
?>
Last updated