Name | Description | Type |
---|---|---|
InvoiceAmount |
The the order total |
decimal number |
SettleCurrency |
This is the currency symbol that the order will be settled in (what currency the BTC is flipped to), the only two settle currencies available at the moment are "GBP" and "EUR" |
string |
InvoiceCurrency |
This is the currency symbol that the order will be invoiced in (What the user is displayed), for example if the merchant uses USD on their website, they can set the "InvoiceCurrency" to "USD", meaning the user will see a BTC/USD rate when paying for the order, but in the background the merchant receives whatever is specified in "SettleCurrency" |
string |
OrderId |
The unique order id you use for your system |
string |
SuccessRedirectURL |
Optional - Where to redirect to when the order is successful |
string |
FailRedirectURL |
Optional - Where to redirect to when the order is cancelled/ failed |
string |
NotificationURL |
Optional - The URL to callback to with events (authorising, fail, success, refunded) |
string |
ItemDescription |
Optional - The description which will be shown on the checkout page |
string |
ItemCode |
Optional - The itemcode which will be shown on the checkout page |
string |
WebsiteId |
Optional - A unique identifier for your website |
string |
CustomerId |
Optional - A unique identifier for you customer |
string |
Confirmations |
Optional - Amount of Bitcoin Transaction confirmations you want to wait for until payment is complete (more confirmations means more secure). |
integer |
APIKey |
Your public API Key which can be found in your account |
globally unique identifier |
Signature |
Your encrypted signature which includes your APIKey, UserId and Nonce, then salted with your API Secret |
string |
Nonce |
A constantly incrementing integer, you can use a timestamp for example. Example: 34235 |
integer |
Request Formats
application/json, text/json
{ "InvoiceAmount": 1.0, "SettleCurrency": "sample string 2", "InvoiceCurrency": "sample string 3", "OrderId": "sample string 4", "SuccessRedirectURL": "sample string 5", "FailRedirectURL": "sample string 6", "NotificationURL": "sample string 7", "ItemDescription": "sample string 8", "ItemCode": "sample string 9", "WebsiteId": "sample string 10", "CustomerId": "sample string 11", "Confirmations": 12, "APIKey": "f86c6093-4616-4ca3-b0cf-681c869388f4", "Signature": "sample string 14", "Nonce": 15 }
application/xml, text/xml
<CreateOrderParams xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CCPayments.Models"> <APIKey>f86c6093-4616-4ca3-b0cf-681c869388f4</APIKey> <Nonce>15</Nonce> <Signature>sample string 14</Signature> <Confirmations>12</Confirmations> <CustomerId>sample string 11</CustomerId> <FailRedirectURL>sample string 6</FailRedirectURL> <InvoiceAmount>1</InvoiceAmount> <InvoiceCurrency>sample string 3</InvoiceCurrency> <ItemCode>sample string 9</ItemCode> <ItemDescription>sample string 8</ItemDescription> <NotificationURL>sample string 7</NotificationURL> <OrderId>sample string 4</OrderId> <SettleCurrency>sample string 2</SettleCurrency> <SuccessRedirectURL>sample string 5</SuccessRedirectURL> <WebsiteId>sample string 10</WebsiteId> </CreateOrderParams>
Response Information
Resource Description
Name | Description | Type |
---|---|---|
OrderId |
The unique order id you use for your system |
string |
PaymentAddress |
The BTC address that the order is paid to |
string |
InvoiceAmount |
The invoice amount for the order (denominated in the InvoiceCurrency) |
decimal number |
InvoiceCurrency |
This is the currency symbol that the order will be invoiced in (What the user is displayed), for example if the merchant uses USD on their website, they can set the "InvoiceCurrency" to "USD", meaning the user will see a BTC/USD rate when paying for the order, but in the background the merchant receives whatever is specified in "SettleCurrency" |
string |
SettleAmount |
The amount that would be settled (denominated in the SettleCurrency) |
decimal number |
SettleCurrency |
This is the currency symbol that the order will be settled in (what currency the BTC is flipped to), the only two settle currencies available at the moment are "GBP" and "EUR" |
string |
CryptoAmount |
The BTC amount for the order |
decimal number |
ExpiryDate |
The date at which your order will expire if unpaid |
date |
OrderStatus |
Returns the status code of the order. The id corresponds as follows: |
integer |
OrderStatusText |
The status of your order displayed in text format |
string |
QRCode |
A url linking to a QR code for your order |
string |
IncludeLightning |
Boolean returning whether a lightning invoice is available |
boolean |
LightningInvoice |
The lightning invoice the order can be paid with |
string |
LightningInvoiceQRCode |
A url linking to a QR code for the lightning invoice of the order |
string |
Response Formats
application/json, text/json
{ "OrderId": "sample string 1", "PaymentAddress": "sample string 2", "InvoiceAmount": 3.0, "InvoiceCurrency": "sample string 4", "SettleAmount": 5.0, "SettleCurrency": "sample string 6", "CryptoAmount": 7.0, "ExpiryDate": "2024-11-08T05:39:59.6272249+00:00", "OrderStatus": 1, "OrderStatusText": "Pending Confirmation", "QRCode": "https://api.coincorner.com/QR/Generate?height=300&width=300&address=bitcoin:sample string 2?amount=7.00000000", "IncludeLightning": true, "LightningInvoice": "sample string 12", "LightningInvoiceQRCode": "https://api.coincorner.com/QR/Generate?height=300&width=300&address=sample string 12" }
application/xml, text/xml
<OrderDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CCPayments.Models"> <CryptoAmount>7</CryptoAmount> <ExpiryDate>2024-11-08T05:39:59.6272249+00:00</ExpiryDate> <IncludeLightning>true</IncludeLightning> <InvoiceAmount>3</InvoiceAmount> <InvoiceCurrency>sample string 4</InvoiceCurrency> <LightningInvoice>sample string 12</LightningInvoice> <LightningInvoiceQRCode>https://api.coincorner.com/QR/Generate?height=300&width=300&address=sample string 12</LightningInvoiceQRCode> <OrderId>sample string 1</OrderId> <OrderStatus>1</OrderStatus> <OrderStatusText>Pending Confirmation</OrderStatusText> <PaymentAddress>sample string 2</PaymentAddress> <QRCode>https://api.coincorner.com/QR/Generate?height=300&width=300&address=bitcoin:sample string 2?amount=7.00000000</QRCode> <SettleAmount>5</SettleAmount> <SettleCurrency>sample string 6</SettleCurrency> </OrderDetails>
const https = require('https')
var APIKey = 'Your CoinCorner API Key';
var nonce = Date.now();
var sig = GenerateSig(nonce);
const data = JSON.stringify({
'InvoiceAmount': '25.00',
'SettleCurrency': 'GBP',
'InvoiceCurrency': 'USD',
'OrderId': '154',
'SuccessRedirectURL': 'https://www.YourSite.com/Checkout/Success',
'FailRedirectURL': 'https://www.YourSite.com/Checkout/Failed',
'NotificationURL': 'https://www.YourSite.com/Checkout/CheckOrder',
'ItemDescription': '1 x Toaster',
'ItemCode': '28',
'APIKey': APIKey,
'Signature': sig,
'Nonce': nonce
})
const options = {
host: 'checkout.coincorner.com',
path: '/api/CreateQROrder',
protocol: 'https:',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)
}
}
const req = https.request(options, (res) => {
res.setEncoding('utf8');
res.on('data', (chunk) => {
console.log(`BODY: ${chunk}`);
});
});
req.write(data);
req.end()
public static async Task CreateQRCodeImage()
{
string PublicKey = "PublicKey".ToLower();
string nonce = ((int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds).ToString();
string CCSignature = GetHash(nonce);
Dictionary<string, string> values = new Dictionary<string, string>
{
{ "APIKey", PublicKey },
{ "Signature", CCSignature },
{ "Nonce", nonce },
{ "OrderId", "1b" },
{ "InvoiceAmount", "22.00" },
{ "SettleCurrency", "GBP" },
{ "InvoiceCurrency", "USD" },
{ "SuccessRedirectURL", "Your Success Redirect URL" },
{ "FailRedirectURL", "Your Fail Redirect URL" },
{ "NotificationURL", "Your call back URL" },
{ "ItemDescription", "Sony DVD player" },
{ "ItemCode", "45" },
};
FormUrlEncodedContent content = new FormUrlEncodedContent(values);
HttpResponseMessage response = await client.PostAsync("https://checkout.coincorner.com/api/CreateQROrder", content);
string QRCodeImage = await response.Content.ReadAsStringAsync();
}
import requests
import time
URL = "https://checkout.coincorner.com/api/CreateQROrder"
API_KEY = "Your CoinCorner API Key"
nonce = int(time.time())
sig = GenerateSig(nonce)
data = {'InvoiceAmount': '25.00',
'SettleCurrency':'GBP',
'InvoiceCurrency':'USD',
'OrderId':'576',
'SuccessRedirectURL': 'https://www.YourSite.com/Checkout/Success',
'FailRedirectURL': 'https://www.YourSite.com/Checkout/Failed',
'NotificationURL': 'https://www.YourSite.com/Checkout/CheckOrder',
'ItemDescription': 'Flip Flops',
'ItemCode': '45',
'APIKey': API_KEY,
'Signature': sig,
'Nonce': nonce
}
response = requests.post(url = URL, data = data)
<?php
function CreateQROrder()
{
$nonce = (int)(microtime(true) * 1e6);
$api_key = 'PublicKey';
$sig = Generate_Sig($nonce);
$params = array (
'OrderId' => '55736',
'InvoiceAmount' => '22.00',
'SettleCurrency' => 'GBP',
'InvoiceCurrency' => 'USD',
'SuccessRedirectURL' => 'Your Success Redirect URL',
'FailRedirectURL' => 'Your Fail Redirect URL',
'NotificationURL' => '"Your call back URL"',
'ItemDescription' => 'Sony DVD player',
'ItemCode' => '45',
'APIKey' => $api_key,
'nonce' => $nonce,
'Signature' => $sig,
);
$url = 'https://checkout.coincorner.com/api/CreateQROrder';
$curl = curl_init();
$curl_options = array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $url);
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
array_merge($curl_options, array(CURLOPT_POST => 1));
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt_array($curl, $curl_options);
curl_setopt($curl, CURLOPT_HTTPHEADER, array());
curl_setopt($curl, CURLOPT_USERAGENT, $user_agent);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = json_decode(curl_exec($curl), TRUE);
$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
header('Location:' . $response);
exit();
}
?>
#!/usr/bin/env ruby
require 'httparty'
require 'date'
$APIKey = 'Your CoinCorner APIKey'
$nonce = DateTime.now.strftime('%Q')
$sig = GenerateSig($nonce)
$response = HTTParty.post('https://checkout.coincorner.com/api/CreateQROrder', body: {
'APIKey' => $APIKey,
'Signature' => $sig,
'Nonce' => $nonce,
'UserId' => $UserId,
'OrderId' => '1980',
'InvoiceAmount' => '25.00',
'SettleCurrency' => 'GBP',
'InvoiceCurrency' => 'USD',
'SuccessRedirectURL': 'https://www.YourSite.com/Checkout/Success',
'FailRedirectURL': 'https://www.YourSite.com/Checkout/Failed',
'NotificationURL': 'https://www.YourSite.com/Checkout/CheckOrder',
'ItemCode' => '45',
'ItemDescription' => ' 1 x DVD Player'
})