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 cancellation
  • Request examples

Was this helpful?

  1. API REFERENCE V2

Invoice Cancellation

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

Invoice cancellation

POST https://api.cryptocloud.plus/v2/invoice/merchant/canceled

To cancel an invoice, send a request specifying a unique identifier. The request will be successful only if the invoice has a status of created.

Request Body

Name
Type
Description

uuid*

string

Unique invoice identifier (INV-XXXXXXXX or XXXXXXXX)

{
    "status": "success",
    "result": [
        "ok"
    ]
}
{
    "status": "error",
    "result": {
        "validate_error": "Invoice is not created"
    }
}
{
    "status": "error",
    "result": {
        "validate_error": "uuid is required"
    }
}

Request examples

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

curl -X POST https://api.cryptocloud.plus/v2/invoice/merchant/canceled \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"uuid":"INV-XXXXXXXX"}'
import requests

url = "https://api.cryptocloud.plus/v2/invoice/merchant/canceled"
headers = {
    "Authorization": "Token <API KEY>"
}
data = {
    "uuid": "INV-XXXXXXXX"

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/canceled', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ uuid: 'INV-XXXXXXXX' })
})
.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/canceled");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array("uuid" => "INV-XXXXXXXX")));
$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);
?>
PreviousInvoice CreationNextInvoice List

Last updated 1 year ago

Was this helpful?