EN
English
  • Getting Started
    • Documentation Overview
    • How the Integration Works
    • Integration Testing
    • How to Get API Keys
    • SDK for Work with API
    • Integration of Icons and Buttons
    • Cryptocurrency payment instruction
    • Support and FAQ
  • API REFERENCE V2
    • Request Authorization
    • Invoice Creation
    • Invoice Cancellation
    • Invoice List
    • Invoice Information
    • Balance
    • Statistics
    • Static Wallet
    • Funds Withdrawal
    • Automatic POSTBACK
  • API REFERENCE V1 (OLD)
    • Request Authorization
    • Invoice Creation
    • Invoice Status Check
    • Automatic POSTBACK
  • CMS Plugins
    • List of CMS Plugins
      • WooCommerce
      • OpenCart
      • Shopify
      • Tilda
      • GetCourse
      • XenForo 2
      • PrestaShop
      • Drupal
      • WHMCS
  • Buttons and forms
    • HTML-widget
      • HTML-form
      • HTML-button
  • CryptoCloud Website
  • Help Center
  • Brand Guide
Powered by GitBook
On this page
  • Invoice creation
  • Parameters description
  • Additional parameters description
  • Response parameters description
  • Request examples

Was this helpful?

  1. API REFERENCE V2

Invoice Creation

Detailed description of the request to create an invoice.

In order to create an invoice, you need to send a POST request.

Invoice creation

POST https://api.cryptocloud.plus/v2/invoice/create

Query Parameters

Name
Type
Description

locale

string

?locale=en, ?locale=ru

Headers

Name
Type
Description

Authorization*

string

Token <API KEY>

Request Body

Name
Type
Description

shop_id*

string

Unique identifier of the store from personal account

amount*

decimal

Payment amount in USD

currency

string

Available currencies for conversion: USD, UZS, KGS, KZT, AMD, AZN, BYN, AUD, 'TRY', AED, CAD, CNY, HKD, IDR, INR, INR, JPY, PHP, SGD, THB, VND, MYR, RUB, UAH, EUR, GBP. The default currency is USD

add_fields

dict

Additional parameters

order_id

string

Arbitrary invoice number in the external system.

email

string

Email address of the customer

{
    "status": "success",
    "result": {
        "uuid": "INV-XXXXXXXX",
        "created": "2023-01-01 12:00:00.000000",
        "address": "",
        "expiry_date": "2023-01-02 12:00:00.000000",
        "side_commission": "client",
        "side_commission_cc": "client",
        "amount": 100.0,
        "amount_usd": 100.0,
        "amount_in_fiat": 100.0,
        "fee": 1.4,
        "fee_usd": 1.4,
        "service_fee": 1.9,
        "service_fee_usd": 1.9,
        "type_payments": "crypto",
        "fiat_currency": "USD",
        "status": "created",
        "is_email_required": false,
        "link": "https://pay.cryptocloud.plus/XXXXXXXX",
        "invoice_id": null,    
        "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": "TestShop",
            "fail": "https://TestShop.com/fail",
            "success": "https://TestShop.com/success",
            "logo": "None"
        },
        "test_mode": false
    }
}

If no mandatory parameters are passed

{
    "status": "error",
    "result": {
        "amount": "amount not passed.",
        "shop_id": "shop_id not passed."
    }
}

Error with incorrect invoice amount

{
    "status": "error",
    "result": {
        "amount": "Invalid value amount."
    }
}

Ошибка при указании неподдерживаемой валюты

{
    "status": "error",
    "result": {
        "currency": "Invalid account currency specified. Available currencies 'USD', 'UZS', 'KGS', 'KZT', 'AMD', 'AZN', 'BYN', 'AUD', 'TRY', 'AED', 'CAD', 'CNY', 'HKD', 'IDR', 'INR', 'JPY', 'PHP', 'SGD', 'THB', 'VND', 'MYR', 'RUB', 'UAH', 'EUR', 'GBP'."
    }
}

Parameters description

Parameter name
Data type
Value
Example

shop_id

String

xBAivfPIbskwuEWj

amount

Float, String

100.5, "100.5"

currency

String

'USD', 'UZS', 'KGS', 'KZT', 'AMD', 'AZN', 'BYN', 'AUD', 'TRY', 'AED', 'CAD', 'CNY', 'HKD', 'IDR', 'INR', 'JPY', 'PHP', 'SGD', 'THB', 'VND', 'MYR', 'RUB', 'UAH', 'EUR', 'GBP'

USD

add_fields

Dict

Additional invoice creation parameters. Detailed description below.

Additional parameters description

Parameter name
Data type
Value
Example
Description

time_to_pay

Dict

{ "hours": 24, "minutes": 0 }

Invoice due time

email_to_send

String

email@gmail.com

If you specify an email in the parameter, the invoice will be automatically sent to this email.

available_currencies

List[String]

BTC, LTC, TRX, USDT_TRC20, USDD_TRC20 , ETH, USDT_ERC20, USDC_ERC20, TUSD_ERC20, SHIB_ERC20, ETH_ARB, USDT_ARB, USDC_ARB, ETH_OPT, USDT_OPT, USDC_OPT, ETH_BASE, USDC_BASE, BNB, USDT_BSC, USDC_BSC, TUSD_BSC, TON, USDT_TON, SOL, USDT_SOL, USDC_SOL

[ "USDT_TRC20", "ETH", "BTC" ]

Payment currencies

cryptocurrency

String

BTC, LTC, TRX, USDT_TRC20, USDD_TRC20 , ETH, USDT_ERC20, USDC_ERC20, TUSD_ERC20, SHIB_ERC20, ETH_ARB, USDT_ARB, USDC_ARB, ETH_OPT, USDT_OPT, USDC_OPT, ETH_BASE, USDC_BASE, BNB, USDT_BSC, USDC_BSC, TUSD_BSC, TON, USDT_TON, SOL, USDT_SOL, USDC_SOL

ETH

Select the payment currency for the user. The details will be displayed on the payment page when specifying the currency. The address will be given in response to the request.

period

String

month, week, day

week

Period for invoice resubmission (only if email for automatic invoice sending is filled in).


Response parameters description

A successful request receives a response with success status and object result.

  • uuid — unique identifier of the invoice with the INV prefix.

  • created — time of invoice creation in UTC +0 in the format YYYYY-MM-DD HH:MI:SS.FFFFFF.

  • address — payment address. It will be pre-filled only in case of selecting cryptocurrency for payment. To select the currency for the client, it is necessary to specify the currency available in the project in add_fields.cryptocurrency.

  • expiry_date — expiration date of the invoice in UTC +0 in the format YYYY-MM-DD HH:MI:SS.FFFFFFFF. After the expiry date invoice will be transferred to the status canceled, if no payment has been received.

  • amount — invoice amount.

  • amount_usd — invoice amount in USD.

  • amount_in_fiat — invoice amount in creation currency (depends on currency parameter).

  • fee — invoice transfer commission.

  • fee_usd — invoice transfer commission in USD.

  • service_fee — service commission.

  • service_fee_usd — service commission in USD.

  • fiat_currency — code of fiat currency in which the invoice was created.

  • status — invoice status. When sending a request for invoice creation, it is always created. There are also paid, partial, overpaid and canceled statuses.

  • is_email_required — parameter for mandatory email filling in the invoice.

  • link — link to the invoice page.

  • currency — object of the selected cryptocurrency in the invoice. It also contains the object network — information about the selected currency network.

  • project — information about the project.

  • test_mode — test invoice sign.

Request examples

These examples show how you can submit a request to create an invoice. Note that you need to provide your API key in the Authorization header to successfully authorize the request.

curl -X POST \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"amount": 100, "shop_id": "xBAivfPIbskwuEWj", "currency": "USD"}' \
     "https://api.cryptocloud.plus/v2/invoice/create"
import requests
import json

url = "https://api.cryptocloud.plus/v2/invoice/create"
headers = {
    "Authorization": "Token <API KEY>",
    "Content-Type": "application/json"
}

data = {
    "amount": 100,
    "shop_id": "xBAivfPIbskwuEWj",
    "currency": "USD"
}

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.js:
const url = 'https://api.cryptocloud.plus/v2/invoice/create';
const headers = new Headers({
    'Authorization': 'Token <API KEY>',
    'Content-Type': 'application/json'
});
const data = {
    amount: 100,
    shop_id: 'xBAivfPIbskwuEWj',
    currency: 'USD'
};

fetch(url, {
    method: 'POST',
    headers,
    body: JSON.stringify(data)
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        return Promise.reject('Creation Error');
    }
})
.then(data => {
    console.log('Success:', data);
})
.catch(error => {
    console.error('Fail:', error);
});
Ajax.js:
$.ajax({
    url: 'https://api.cryptocloud.plus/v2/invoice/create',
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    data: JSON.stringify({
        amount: 100,
        shop_id: 'xBAivfPIbskwuEWj',
        currency: 'USD'
    }),
    success: function(data) {
        console.log('Success:', data);
    },
    error: function(error) {
        console.error('Fail:', error);
    }
});
Axios.js:
const axios = require('axios');

const url = 'https://api.cryptocloud.plus/v2/invoice/create';
const headers = {
    'Authorization': 'Token <API KEY>',
    'Content-Type': 'application/json'
};
const data = {
    amount: 100,
    shop_id: 'xBAivfPIbskwuEWj',
    currency: 'USD'
};

axios.post(url, data, { headers })
    .then(response => {
        console.log('Success:', response.data);
    })
    .catch(error => {
        console.error('Fail:', error);
    });
cURL:
<?php
$url = "https://api.cryptocloud.plus/v2/invoice/create";
$headers = array(
    "Authorization: Token <API KEY>",
    "Content-Type: application/json"
);

$data = array(
    "amount" => 100,
    "shop_id" => "xBAivfPIbskwuEWj",
    "currency" => "USD"
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if($http_code == 200){
    echo "Success: " . $response;
} else {
    echo "Fail: " . $http_code . " " . $response;
}

curl_close($ch);
?>
File_get_contents:
<?php
$url = "https://api.cryptocloud.plus/v2/invoice/create";
$headers = array(
    "http" => array(
        "header" => "Authorization: Token <API KEY>\r\n" .
                    "Content-Type: application/json\r\n",
        "method" => "POST",
        "content" => json_encode(array(
            "amount" => 100,
            "shop_id" => "xBAivfPIbskwuEWj",
            "currency" => "USD"
        )),
    ),
);

$context  = stream_context_create($headers);
$response = file_get_contents($url, false, $context);
$http_code = $http_response_header[0];

if(strpos($http_code, "200")){
    echo "Success: " . $response;
} else {
    echo "Fail: " . $http_code . " " . $response;
}
?>
PreviousRequest AuthorizationNextInvoice Cancellation

Last updated 4 hours ago

Was this helpful?

side_commission — payment side.

side_commission_ss — payment side.

transfer fee
service fee