Invoice Creation
In order to create an invoice, you need to send a POST request.
POST https://api.cryptocloud.plus/v1/invoice/create
Headers
Name
Type
Description
Authorization*
string
Token <API KEY>
Request Body
Name
Type
Description
shop_id*
string
Unique store ID from your personal account
amount*
decimal
Payment amount in USD
currency
string
Available currencies for conversion: USD, RUB, EUR, GBP, UAH
order_id
string
Your internal order identifier
string
User email
{
"status": "success",
"pay_url": "https://pay.cryptocloud.plus/DZLF4212",
"currency": "BTC",
"invoice_id": "DZLF4212"
}Примеры запросов
These examples show how to submit an invoice creation request using Python and JavaScript. Note that you need to provide your API key in the Authorization header to authorize the request successfully.
import requests
import json
url = "https://api.cryptocloud.plus/v1/invoice/create"
headers = {
"Authorization": "Token <API KEY>",
"Content-Type": "application/json"
}
data = {
"amount": 100.0,
"currency": "USD",
"description": "Pay"
}
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)const url = 'https://api.cryptocloud.plus/v1/invoice/create';
const headers = new Headers({
'Authorization': 'Token <API KEY>',
'Content-Type': 'application/json'
});
const data = {
amount: 100.0,
currency: 'USD',
description: 'Pay'
};
fetch(url, {
method: 'POST',
headers,
body: JSON.stringify(data)
})
.then(response => {
if (response.ok) {
return response.json();
} else {
return Promise.reject('Error');
}
})
.then(data => {
console.log('Success:', data);
})
.catch(error => {
console.error('Fail:', error);
});Last updated
Was this helpful?