### Bash Response Example Source: https://docs.cryptocloud.plus/en/api-reference-v2/postback This is an example of a successful response from the CryptoCloud Plus API, detailing invoice information, payment status, and transaction details. ```bash { "status": "success", "invoice_id": "XXXXXXXX", "amount_crypto": 100, "currency": "USDT_TRC20", "order_id": "order_id", "token": b"token", "invoice_info": { "uuid": "INV-XXXXXXXX", "created": "2024-08-22 11:49:59.756692", "address": "address", "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 }, "date_finished": "2024-08-22 11:51:53.753528", "expiry_date": "2024-08-23 11:49:59.746385", "side_commission": "client", "type_payments": "crypto", "amount": 100, "amount_": 100, "status": "overpaid", "invoice_status": "success", "is_email_required": false, "project": { "id": 0, "name": "My Project", "fail": "", "success": "", "logo": "" }, "tx_list": [ "" ], "amount_in_crypto": null, "amount_in_fiat": 0.0, "amount_usd": 100.0, "amount_to_pay": 102.0, "amount_to_pay_usd": 102.0, "amount_paid": 102.0, "amount_paid_usd": 102.0, "fee": 1.4, "fee_usd": 1.4, "service_fee": 0.8048, "service_fee_usd": 0.8, "received": 99.7952, "received_usd": 99.8, "to_surcharge": 0.0, "to_surcharge_usd": 0.0, "total_rub": 0, "step": 3, "test_mode": false, "type": "up", "aml_enabled": false, "aml_side": "merchant", "aml_checks": [], "links_invoice": null } } ``` -------------------------------- ### Get Static Wallets List Response Examples Source: https://docs.cryptocloud.plus/en/api-reference-v2/static-wallet Examples of successful (200 OK) and error (400 Bad Request) responses when retrieving a list of static wallets. The success response includes wallet details, while the error response indicates a validation issue. ```json { "status": "success", "result": { "staticWallets": [ { "currency": { "id": 4, "code": "USDT_TRC20", "short_code": "USDT", "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, "obj_network": { "code": "TRC20", "id": 4, "icon": "https://cdn.cryptocloud.plus/currency/crypto/TRX.svg", "fullname": "Tron" }, "enable": true }, "active": true, "address": "StaticAdresse", "uuid": "3K0NFXT9E1X3VOY07VY1LRV8XGMLQNQX" } ], "all_count": 1 } } ``` ```json { "status": "error", "result": { "validation_error": "Cannot resolve keyword 'not_existing_field' into field. Choices are: active, address, created, currency, currency_id, id, identify, project, project_id, user, user_id, uuid" } } ``` -------------------------------- ### Create Static Wallet Request Examples Source: https://docs.cryptocloud.plus/en/api-reference-v2/static-wallet Examples demonstrating how to submit a request to create a static wallet using cURL, Python, JavaScript, and PHP. Requires an API key in the Authorization header and specific JSON payload. ```bash curl -X POST https://api.cryptocloud.plus/v2/invoice/static/create \ -H 'Authorization: Token ' \ -H 'Content-Type: application/json' \ -d '{"shop_id": "", "currency": "BTC", "identify": "F4jSjfpwf4t"}' ``` ```python import requests url = "https://api.cryptocloud.plus/v2/invoice/static/create" headers = { 'Authorization': "Token " } body = { "shop_id": "", "currency": "BTC", "identify": "F4jSjfpwf4t", } response = requests.post(url, headers=headers, json=body) if response.status_code == 200: print("Success:", response.json()) else: print("Fail:", response.status_code, response.text) ``` ```javascript const url = "https://api.cryptocloud.plus/v2/invoice/static/create"; const headers = { 'Authorization': 'Token ', 'Content-Type': 'application/json' }; const body = { "shop_id": "", "currency": "BTC", "identify": "F4jSjfpwf4t" }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(body) }) .then(response => { if (response.ok) { return response.json(); } else { throw new Error(`Failed to fetch: ${response.statusText}`); } }) .then(data => console.log("Success:", data)) .catch(error => console.log("Fail:", error)); ``` ```php ', 'Content-Type: application/json' ]; $body = [ "shop_id" => "", "currency" => "BTC", "identify" => "F4jSjfpwf4t" ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); $response = curl_exec($ch); if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200) { echo "Success: " . $response; } else { echo "Fail: " . curl_getinfo($ch, CURLINFO_HTTP_CODE) . " " . $response; } curl_close($ch); ?> ``` -------------------------------- ### Create Invoice API Request Examples Source: https://docs.cryptocloud.plus/en/api-reference-v2/authorization Provides examples of making a POST request to the /v2/invoice/create endpoint with the Authorization header in various programming languages. These examples show how to set up the request, send it, and handle the response, including success and error scenarios. ```bash curl -X POST https://api.cryptocloud.plus/v2/invoice/create \ -header "Authorization: Token eyJ0eXAi1iJKV1QiLCJhbGci1iJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH" ``` ```python import requests url = "https://api.cryptocloud.plus/v2/invoice/create" headers = { "Authorization": "Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH" } response = requests.post(url, headers=headers) if response.status_code == 200: print("Success:", response.json()) else: print("Fail:", response.status_code, response.text) ``` ```javascript const url = 'https://api.cryptocloud.plus/v2/invoice/create'; const headers = new Headers({ 'Authorization': 'Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH' }); fetch(url, { method: 'POST', headers }) .then(response => { if (response.ok) { return response.json(); } else { return Promise.reject('Auth error'); } }) .then(data => { console.log('Success:', data); }) .catch(error => { console.error('Fail:', error); }); ``` ```php ``` -------------------------------- ### Create Invoice using JavaScript Source: https://docs.cryptocloud.plus/en/api-reference-v2/create-invoice JavaScript examples for creating an invoice using different methods: Fetch API, Ajax, and Axios. All methods send a POST request with JSON data and require an API key for authentication. ```javascript const url = 'https://api.cryptocloud.plus/v2/invoice/create'; const headers = new Headers({ 'Authorization': 'Token ', '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); }); ``` ```javascript $.ajax({ url: 'https://api.cryptocloud.plus/v2/invoice/create', method: 'POST', headers: { 'Authorization': 'Token ', '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); } }); ``` ```javascript const axios = require('axios'); const url = 'https://api.cryptocloud.plus/v2/invoice/create'; const headers = { 'Authorization': 'Token ', '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); }); ``` -------------------------------- ### Create Invoice using PHP Source: https://docs.cryptocloud.plus/en/api-reference-v2/create-invoice PHP examples for creating an invoice using cURL and file_get_contents. Both methods send a POST request with JSON data and require an API key for authentication. Response handling for success and failure is included. ```php ", "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); ?> ``` ```php array( "header" => "Authorization: Token \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; } ?> ``` -------------------------------- ### Create Invoice using Python Source: https://docs.cryptocloud.plus/en/api-reference-v2/create-invoice Python example for creating an invoice using the 'requests' library. It sends a POST request with the necessary headers and JSON data to the API. Error handling for non-200 status codes is included. ```python import requests import json url = "https://api.cryptocloud.plus/v2/invoice/create" headers = { "Authorization": "Token ", "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) ``` -------------------------------- ### Create Invoice using cURL Source: https://docs.cryptocloud.plus/en/api-reference-v2/create-invoice Example of creating an invoice using cURL. This method sends a POST request with JSON payload to the Cryptocloud Plus API. Requires an API key in the Authorization header. ```bash curl -X POST \ -H "Authorization: Token " \ -H "Content-Type: application/json" \ -d '{"amount": 100, "shop_id": "xBAivfPIbskwuEWj", "currency": "USD"}' \ "https://api.cryptocloud.plus/v2/invoice/create" ``` -------------------------------- ### Get Invoice Info via API (cURL, Python, JavaScript, PHP) Source: https://docs.cryptocloud.plus/en/api-reference-v2/invoice-information These examples demonstrate how to make a POST request to the Cryptocloud Plus API to retrieve invoice information. The request requires an API key in the Authorization header and a JSON payload containing invoice UUIDs. Supported languages include cURL, Python, JavaScript, and PHP. ```bash curl -X POST https://api.cryptocloud.plus/v2/invoice/merchant/info \ -H "Authorization: Token " \ -H "Content-Type: application/json" \ -d '{"uuids":["INV-XXXXXXXX","INV-YYYYYYYY"]}' ``` ```python import requests url = "https://api.cryptocloud.plus/v2/invoice/merchant/info" headers = { "Authorization": "Token " } 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) ``` ```javascript fetch('https://api.cryptocloud.plus/v2/invoice/merchant/info', { method: 'POST', headers: { 'Authorization': 'Token ', '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 array("INV-XXXXXXXX", "INV-YYYYYYYY") ))); $headers = array( "Authorization: Token ", "Content-Type: application/json" ); costopt($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); ?> ``` -------------------------------- ### Create Payout using JavaScript with Axios Source: https://docs.cryptocloud.plus/en/api-reference-v2/withdrawals This JavaScript example shows how to create a payout using the Axios library. It defines a PayoutAPIError class for handling API errors and a PayoutAPIClient class for managing API interactions. ```javascript /** * Custom error for handling payout API response failures. */ class PayoutAPIError extends Error { /** * @param {number} statusCode - HTTP status code returned by the API. * @param {object} [errorData={}] - Error details returned by the API. */ constructor(statusCode, errorData = {}) { super(`API Request failed with status ${statusCode}: ${JSON.stringify(errorData)}`); this.name = 'PayoutAPIError'; this.statusCode = statusCode; this.errorData = errorData; } } /** * Client for interacting with CryptoCloud Payout API. */ class PayoutAPIClient { /** * @param {string} apiKey - API token used for authentication. */ constructor(apiKey) { this.apiKey = apiKey; this.baseUrl = 'https://api.cryptocloud.plus'; this.headers = { 'Authorization': `Token ${this.apiKey}`, 'Content-Type': 'application/json' }; } /** * Creates a payout request. * * @param {string} currencyCode - Currency code (e.g., "BTC", "ETH", "USDT", "LTC"). * @param {string} toAddress - Recipient address. * @param {number} amount - Amount to send. * @returns {Promise} - API response data. * @throws {PayoutAPIError} - On failed request. */ async createPayout(currencyCode, toAddress, amount) { const url = `${this.baseUrl}/v2/invoice/api/out/create`; const payload = { currency_code: currencyCode, to_address: toAddress, amount: amount }; try { const response = await axios.post(url, payload, { headers: this.headers }); return response.data; } catch (error) { const status = error.response?.status || 500; const data = error.response?.data || {}; throw new PayoutAPIError(status, data); } } } // Example usage with Axios (async () => { const client = new PayoutAPIClient(''); try { const result = await client.createPayout("BTC", "", 0.00023); console.log("Success:", result); } catch (error) { console.error("Error occurred:", error); } })(); ``` -------------------------------- ### Create Withdrawal Request (JSON Example) Source: https://docs.cryptocloud.plus/en/api-reference-v2/withdrawals This JSON snippet demonstrates a successful response when a withdrawal request is created. It includes the invoice ID, status, currency, and amount of the request. ```json { "status": "success", "data": { "invoice_id": "INV-XXXXXXXX", "status": "created", "currency": "BTC", "amount": 0.05 } } ``` -------------------------------- ### Integrate CryptoCloud Plus Payment Widget (HTML) Source: https://docs.cryptocloud.plus/en/buttons-forms/html-widget/form This HTML snippet integrates the CryptoCloud Plus payment widget into a webpage. It includes the necessary CSS and JavaScript links and the Vue.js widget component. Ensure you replace 'YOUR_SHOP_ID', 'YOUR_KEY', 'CURRENCY', 'AMOUNT', and 'LOCALE' with your actual project credentials and desired settings. ```html ``` -------------------------------- ### Integrate CryptoCloud Plus Payment Button (HTML/JavaScript) Source: https://docs.cryptocloud.plus/en/buttons-forms/html-widget/button This snippet includes the necessary HTML and JavaScript links to embed a customizable payment button on your website. It requires a SHOP ID and API KEY from your CryptoCloud account and allows customization of colors, logo, width, currency, amount, and order ID. ```html ``` -------------------------------- ### Create Payout using JavaScript with XMLHttpRequest Source: https://docs.cryptocloud.plus/en/api-reference-v2/withdrawals This JavaScript example illustrates how to create a payout using the XMLHttpRequest (AJAX) object. It configures the request, sets headers, and handles the response, including error conditions. ```javascript const apiKey = ''; const xhr = new XMLHttpRequest(); xhr.open("POST", "https://api.cryptocloud.plus/v2/invoice/api/out/create"); xhr.setRequestHeader("Authorization", `Token ${apiKey}`); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onload = function () { if (xhr.status === 200) { console.log("Success:", JSON.parse(xhr.responseText)); } else { console.error("Error:", xhr.status, xhr.responseText); } }; const payload = { currency_code: 'BTC', to_address: '', amount: 0.00023 }; xhr.send(JSON.stringify(payload)); ``` -------------------------------- ### Get Payment Statistics for a Period (cURL) Source: https://docs.cryptocloud.plus/en/api-reference-v2/statistics Retrieves payment statistics for a specified date range using a cURL request. Requires an API key for authorization and specifies the start and end dates in 'dd.mm.yyyy' format. ```bash curl -X POST https://api.cryptocloud.plus/v2/invoice/merchant/statistics \ -H "Authorization: Token " \ -H "Content-Type: application/json" \ -d '{"start":"01.01.2023","end":"31.01.2023"}' ``` -------------------------------- ### Get Payment Statistics for a Period (Python) Source: https://docs.cryptocloud.plus/en/api-reference-v2/statistics Fetches payment statistics for a given period using Python's requests library. The function sends a POST request with the necessary headers and a JSON payload containing start and end dates. ```python import requests url = "https://api.cryptocloud.plus/v2/invoice/merchant/statistics" headers = { "Authorization": "Token " } data = { "start": "01.01.2023", "end": "31.01.2023" } 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) ``` -------------------------------- ### Get Payment Statistics for a Period (PHP) Source: https://docs.cryptocloud.plus/en/api-reference-v2/statistics Retrieves payment statistics for a given period using PHP's cURL functions. The script configures cURL to send a POST request with JSON data, including the start and end dates, and necessary authorization headers. ```php "01.01.2023", "end" => "31.01.2023" ))); $headers = array( "Authorization: Token ", "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); ?> ``` -------------------------------- ### Get Invoice List (POST Request) Source: https://docs.cryptocloud.plus/en/api-reference-v2/invoice-list Send a POST request to this endpoint to retrieve a list of invoices. The request requires 'start' and 'end' dates. Optional 'offset' and 'limit' parameters can be used to paginate results. The maximum limit per request is 100, with a default of 10. ```HTTP POST https://api.cryptocloud.plus/v2/invoice/merchant/info Request Body: { "start": "dd.mm.yyyyy", "end": "dd.mm.yyyyy", "offset": 0, "limit": 10 } ``` -------------------------------- ### Process POSTBACK with Python Source: https://docs.cryptocloud.plus/en/api-reference-v2/postback This Python code snippet demonstrates how to set up a Flask server to receive and process POSTBACK notifications from CryptoCloud Plus. It extracts key information from the incoming JSON payload. ```python from flask import Flask, request, jsonify app = Flask(__name__) @app.route('/postback', methods=['POST']) def handle_postback(): data = request.json status = data.get('status') invoice_id = data.get('invoice_id') amount_crypto = data.get('amount_crypto') currency = data.get('currency') order_id = data.get('order_id') token = data.get('token') # ... your code for processing postback ... return jsonify({'message': 'Postback received'}), 200 if __name__ == '__main__': app.run(port=5000) ``` -------------------------------- ### POST /v2/invoice/create Source: https://docs.cryptocloud.plus/en/api-reference-v2/create-invoice Creates a new invoice by sending a POST request to the specified endpoint. Requires authentication and supports locale specification. ```APIDOC ## POST /v2/invoice/create ### Description Creates a new invoice using the Cryptocloud Plus API. ### Method POST ### Endpoint https://api.cryptocloud.plus/v2/invoice/create ### Parameters #### Query Parameters - **locale** (string) - Optional - Specifies the locale for the invoice (e.g., ?locale=en, ?locale=ru). #### Headers - **Authorization** (string) - Required - Your API key in the format: Token . ``` -------------------------------- ### POST /v2/invoice/merchant/statistics Source: https://docs.cryptocloud.plus/en/api-reference-v2/statistics Retrieve invoice statistics for a specified period by sending a POST request with start and end dates. ```APIDOC ## POST /v2/invoice/merchant/statistics ### Description Retrieves invoice statistics for a specified period. This endpoint requires an API key for authorization. ### Method POST ### Endpoint `https://api.cryptocloud.plus/v2/invoice/merchant/statistics` ### Parameters #### Request Body - **start** (String) - Required - Date in format «dd.mm.yyyyy» - **end** (String) - Required - Date in format «dd.mm.yyyyy» ### Request Example ```json { "start": "01.01.2023", "end": "31.01.2023" } ``` ### Response #### Success Response (200) - **status** (String) - Indicates the status of the request, e.g., "success". - **result** (Object) - An object containing statistical data. - **count** (Object) - An object containing invoice counts. - **all** (Number) - Total number of invoices. - **created** (Number) - Number of invoices with status "Created". - **paid** (Number) - Number of invoices with status "Paid". - **overpaid** (Number) - Number of invoices with status "Overpaid". - **partial** (Number) - Number of invoices with status "Partially paid". - **canceled** (Number) - Number of invoices with status "Canceled". - **amount** (Object) - An object containing invoice amounts in USD. - **all** (Number) - Total amount of all invoices. - **created** (Number) - Amount of invoices with status "Created". - **paid** (Number) - Amount of invoices with status "Paid". - **overpaid** (Number) - Amount of invoices with status "Overpaid". - **partial** (Number) - Amount of invoices with status "Partially paid". - **canceled** (Number) - Amount of invoices with status "Canceled". #### Response Example ```json { "status": "success", "result": { "count": { "all": 59, "created": 41, "paid": 16, "overpaid": 1, "partial": 1, "canceled": 0 }, "amount": { "all": 4683.83, "created": 3032.63, "paid": 1531.0, "overpaid": 100.2, "partial": 20.0, "canceled": 0 } } } ``` ``` -------------------------------- ### Process POSTBACK with PHP Source: https://docs.cryptocloud.plus/en/api-reference-v2/postback This PHP script demonstrates how to process POSTBACK data sent via HTTP POST. It reads the raw input, parses it as form data, and extracts the necessary fields for further handling. ```php 'Postback received']); ?> ``` -------------------------------- ### POST /v2/invoice/static/create Source: https://docs.cryptocloud.plus/en/api-reference-v2/static-wallet Creates a static wallet for receiving payments. Requires an API key for authorization. ```APIDOC ## POST /v2/invoice/static/create ### Description Creates a static wallet for receiving payments. Requires an API key for authorization. ### Method POST ### Endpoint https://api.cryptocloud.plus/v2/invoice/static/create ### Parameters #### Headers - **Authorization** (string) - Required - API Key in the format 'Token ' - **Content-Type** (string) - Required - 'application/json' #### Request Body - **shop_id** (string) - Required - Your shop identifier. - **currency** (string) - Required - The currency code for the wallet (e.g., 'BTC'). - **identify** (string) - Required - A unique identifier for the transaction or invoice. ### Request Example ```json { "shop_id": "", "currency": "BTC", "identify": "F4jSjfpwf4t" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **result** (object) - Contains the details of the created static wallet. - **wallet_id** (string) - The unique identifier for the created wallet. - **address** (string) - The generated static wallet address. - **currency** (string) - The currency of the wallet. - **identify** (string) - The identifier provided in the request. #### Response Example ```json { "status": "success", "result": { "wallet_id": "some_wallet_id", "address": "1A1oPZysJCO22sP823rYxP6u7X8d234234", "currency": "BTC", "identify": "F4jSjfpwf4t" } } ``` ``` -------------------------------- ### POST /api/v1/invoice Source: https://docs.cryptocloud.plus/en/api-reference-v2/create-invoice Creates a new payment invoice for a given shop and amount. Supports various currencies and additional fields for order tracking. ```APIDOC ## POST /api/v1/invoice ### Description Creates a new payment invoice for a given shop and amount. Supports various currencies and additional fields for order tracking. ### Method POST ### Endpoint /api/v1/invoice ### Parameters #### Request Body - **shop_id** (string) - Required - Unique identifier of the store from personal account - **amount** (decimal) - Required - Payment amount in USD - **currency** (string) - Optional - 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) - Optional - Additional parameters - **order_id** (string) - Optional - Arbitrary invoice number in the external system. - **email** (string) - Optional - Email address of the customer ### Request Example ```json { "shop_id": "your_shop_id", "amount": 100.50, "currency": "USD", "add_fields": { "order_id": "order_12345", "email": "customer@example.com" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **result** (object) - Contains the details of the created invoice or error information. - **uuid** (string) - Unique identifier for the invoice. - **created** (string) - Timestamp when the invoice was created. - **address** (string) - Payment address (if applicable). - **expiry_date** (string) - Timestamp when the invoice expires. - **side_commission** (string) - Commission side. - **side_commission_cc** (string) - Commission side for crypto. - **amount** (decimal) - The original payment amount. - **amount_usd** (decimal) - The payment amount in USD. - **amount_in_fiat** (decimal) - The payment amount in the specified fiat currency. - **fee** (decimal) - Transaction fee. - **fee_usd** (decimal) - Transaction fee in USD. - **service_fee** (decimal) - Service fee. - **service_fee_usd** (decimal) - Service fee in USD. - **type_payments** (string) - Type of payment (e.g., 'crypto'). - **fiat_currency** (string) - The fiat currency used for the payment. - **status** (string) - Current status of the invoice (e.g., 'created'). - **is_email_required** (boolean) - Whether email is required for this transaction. - **link** (string) - A direct link to the payment page. - **invoice_id** (string|null) - External invoice ID if provided. - **currency** (object) - Details about the cryptocurrency used for payment. - **id** (integer) - Currency ID. - **code** (string) - Currency code (e.g., 'USDT'). - **fullcode** (string) - Full currency code with network (e.g., 'USDT_TRC20'). - **network** (object) - Details about the blockchain network. - **code** (string) - Network code (e.g., 'TRC20'). - **id** (integer) - Network ID. - **icon** (string) - URL for the network icon. - **fullname** (string) - Full name of the network (e.g., 'Tron'). - **name** (string) - Full name of the currency (e.g., 'Tether'). - **is_email_required** (boolean) - Whether email is required for this currency. - **stablecoin** (boolean) - Whether the currency is a stablecoin. - **icon_base** (string) - URL for the base currency icon. - **icon_network** (string) - URL for the network-specific currency icon. - **icon_qr** (string) - URL for the QR code icon. - **order** (integer) - Order of the currency. - **project** (object) - Details about the merchant's project. - **id** (integer) - Project ID. - **name** (string) - Project name. - **fail** (string) - URL to redirect to on payment failure. - **success** (string) - URL to redirect to on successful payment. - **logo** (string) - URL for the project logo. - **test_mode** (boolean) - Indicates if the transaction is in test mode. #### Error Response (400) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **result** (object) - Contains error messages. - **amount** (string) - Error message related to the amount field. - **shop_id** (string) - Error message related to the shop_id field. - **currency** (string) - Error message related to the currency field. ### Response Example (Success) ```json { "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 } } ``` ### Response Example (Bad Request - Missing Parameters) ```json { "status": "error", "result": { "amount": "amount not passed.", "shop_id": "shop_id not passed." } } ``` ### Response Example (Bad Request - Invalid Amount) ```json { "status": "error", "result": { "amount": "Invalid value amount." } } ``` ### Response Example (Bad Request - Invalid Currency) ```json { "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'." } } ``` ``` -------------------------------- ### Bad Request Error Response (400) Source: https://docs.cryptocloud.plus/en/api-reference-v2/invoice-list This JSON indicates a 'Bad Request' error, typically occurring when mandatory parameters like 'start' or 'end' dates are not provided in the request body. ```json { "status": "error", "result": { "start": "start not passed.", "end": "end not passed." } } ```