Merchant Tools

We have already made some code-snippets ready in multiple programming languages to use.

How it works?


Register and Sign-in to your dashboard

Create your shop terminal, configure the shop supported coins and get your Secret-Key (x-api-key) for using the APIs.

Create the order and check the payment via APIs using the Secret-Key (x-api-key). You can see the details, test and run the APIs in swagger

Manage and check your shop orders, balance, withdraws and etc on your account dashboard

Snippet Codes


You can use the Counos Payment Gateway with these main APIs easily. You can see the other APIs full documentation, test and run the APIs here .


Get /api/terminal/tickers


This API shows the list of the activated tickers for the terminal of your store. It shows exactly which tickers are active for your terminal. All the currencies(including cryptocurrencies) have their own id which can be set in this API.

                        
                                curl --location --request GET 'https://payment.counos.io/api/terminal/tickers' \
                                --header 'accept: application/json' \
                                --header 'x-api-key: YOUR_STORE_X_API_KEY' \
                            
                        
                        
                                var handler = new HttpClientHandler();
                                handler.UseCookies = false;

                                using (var httpClient = new HttpClient(handler))
                                {
                                using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://payment.counos.io/api/terminal/tickers"))
                                {
                                request.Headers.TryAddWithoutValidation("accept", "application/json");
                                request.Headers.TryAddWithoutValidation("x-api-key", "YOUR_STORE_X_API_KEY");

                                var response = await httpClient.SendAsync(request);
                                }
                                }
                            
                        
                        
                                $ch = curl_init();

                                curl_setopt($ch, CURLOPT_URL, 'https://payment.counos.io/api/terminal/tickers');
                                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');


                                $headers = array();
                                $headers[] = 'Accept: application/json';
                                $headers[] = 'X-Api-Key: YOUR_STORE_X_API_KEY';
                                curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

                                $result = curl_exec($ch);
                                if (curl_errno($ch)) {
                                echo 'Error:' . curl_error($ch);
                                }
                                curl_close($ch);
                            
                        
                        
                                import requests

                                headers = {
                                'accept': 'application/json',
                                'x-api-key': 'YOUR_STORE_X_API_KEY',
                                }

                                response = requests.get('https://payment.counos.io/api/terminal/tickers', headers=headers)

                            
                        
                        

                                req, err := http.NewRequest("GET", "https://payment.counos.io/api/terminal/tickers", nil)
                                if err != nil {
                                // handle err
                                }
                                req.Header.Set("Accept", "application/json")
                                req.Header.Set("X-Api-Key", "YOUR_STORE_X_API_KEY")
                                
                                resp, err := http.DefaultClient.Do(req)
                                if err != nil {
                                // handle err
                                }
                                defer resp.Body.Close()

                            
                        
                        

                                wget --no-check-certificate --quiet \
                                --method GET \
                                --timeout=0 \
                                --header 'accept: application/json' \
                                --header 'x-api-key: YOUR_STORE_X_API_KEY' \
                                'https://payment.counos.io/api/terminal/tickers'

                            
                        
                        
                                OkHttpClient client = new OkHttpClient().newBuilder()
                                .build();
                                Request request = new Request.Builder()
                                .url("https://payment.counos.io/api/terminal/tickers")
                                .method("GET", null)
                                .addHeader("accept", "application/json")
                                .addHeader("x-api-key", "YOUR_STORE_X_API_KEY")
                                .build();
                                Response response = client.newCall(request).execute();

                            
                        
                        
                                var https = require('follow-redirects').https;
                                var fs = require('fs');

                                var options = {
                                'method': 'GET',
                                'hostname': 'payment.counos.io',
                                'path': '/api/terminal/tickers',
                                'headers': {
                                'accept': 'application/json',
                                'x-api-key': 'YOUR_STORE_X_API_KEY'
                                },
                                'maxRedirects': 20
                                };

                                var req = https.request(options, function (res) {
                                var chunks = [];

                                res.on("data", function (chunk) {
                                chunks.push(chunk);
                                });

                                res.on("end", function (chunk) {
                                var body = Buffer.concat(chunks);
                                console.log(body.toString());
                                });

                                res.on("error", function (error) {
                                console.error(error);
                                });
                                });

                                req.end();

                            
                        
                        
                                require "uri"
                                require "net/http"

                                url = URI("https://payment.counos.io/api/terminal/tickers")

                                https = Net::HTTP.new(url.host, url.port)
                                https.use_ssl = true

                                request = Net::HTTP::Get.new(url)
                                request["accept"] = "application/json"
                                request["x-api-key"] = "YOUR_STORE_X_API_KEY"

                                response = https.request(request)
                                puts response.read_body


                            
                        
                        
                                var settings = {
                                "url": "https://payment.counos.io/api/terminal/tickers",
                                "method": "GET",
                                "timeout": 0,
                                "headers": {
                                "accept": "application/json",
                                "x-api-key": "YOUR_STORE_X_API_KEY"
                                },
                                };

                                $.ajax(settings).done(function (response) {
                                console.log(response);
                                });

                            
                        



Post /api/terminal/order


When a customer wants to purchase a number of products from your store and then wants to pay for them, when the order is registered and the customer is waiting for the payment gateway, the order is registered here.
This order registrations is done in this API. For each order, you can set an order id of your choice.This order id must be unique and non-repetitive.
You can input the amount that is expected to be paid.And you can also input the ticker id belonging to a specific cryptocurrency. You can get this ticker id from the above-mentioned API. The last part is “renew.” If you set the value for renew as false, and you have used this order id before, then that order id does not change and does not reset.If you set the value for it as true, and you have used this order id before, then that order id is completely deleted and is created again. If the order id is completely new, then you can just set the value as false and it will have no effect.
After you create the order, some information is given to you.This information includes the amount that should be paid, the order id, the date the order id has been created, the number of confirmations it has received, the number of expected confirmations, the amount that has been paid, the address for payment, and all the other relevant information. A link to a QR code is also given to you after you create an order, this is the QR code that you need to put up in your online store. Using that QR code, the customer can make the payment. So with this API, you can create an order.

                        
                                curl --location --request POST 'https://payment.counos.io/api/terminal/order' \
                                --header 'accept: application/json' \
                                --header 'x-api-key: YOUR_STORE_X_API_KEY' \
                                --header 'Content-Type: application/json-patch+json' \
                                --data-raw '{ "orderId": YOUR_STORE_ORDER_ID, "expectedAmount": YOUR_ORDER_EXPECTED_AMOUNT, "tickerId": TICKER_ID, "renew": true}'
                            
                        
                        
                                using (var httpClient = new HttpClient())
                                {
                                using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://payment.counos.io/api/terminal/order"))
                                {
                                request.Headers.TryAddWithoutValidation("accept", "application/json");
                                request.Headers.TryAddWithoutValidation("x-api-key", "YOUR_STORE_X_API_KEY");

                                request.Content = new StringContent("{ \"orderId\": YOUR_STORE_ORDER_ID, \"expectedAmount\": YOUR_ORDER_EXPECTED_AMOUNT, \"tickerId\": TICKER_ID, \"renew\": true}");
                                request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json-patch+json");

                                var response = await httpClient.SendAsync(request);
                                }
                                }
                            
                        
                        
                                
                                $curl = curl_init();

                                curl_setopt_array($curl, array(
                                CURLOPT_URL => 'https://payment.counos.io/api/terminal/order',
                                CURLOPT_RETURNTRANSFER => true,
                                CURLOPT_ENCODING => '',
                                CURLOPT_MAXREDIRS => 10,
                                CURLOPT_TIMEOUT => 0,
                                CURLOPT_FOLLOWLOCATION => true,
                                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                                CURLOPT_CUSTOMREQUEST => 'POST',
                                CURLOPT_POSTFIELDS =>'{ "orderId": YOUR_STORE_ORDER_ID, "expectedAmount": YOUR_ORDER_EXPECTED_AMOUNT, "tickerId": TICKER_ID, "renew": true}',
                                CURLOPT_HTTPHEADER => array(
                                'accept: application/json',
                                'x-api-key: YOUR_STORE_X_API_KEY',
                                'Content-Type: application/json-patch+json',
                                ),
                                ));

                                $response = curl_exec($curl);

                                curl_close($curl);
                                echo $response;

                            
                        
                        
                                import requests

                                url = "https://payment.counos.io/api/terminal/order"

                                payload="{ \"orderId\": YOUR_STORE_ORDER_ID, \"expectedAmount\": YOUR_ORDER_EXPECTED_AMOUNT, \"tickerId\": TICKER_ID, \"renew\": true}"
                                headers = {
                                'accept': 'application/json',
                                'x-api-key': 'YOUR_STORE_X_API_KEY',
                                'Content-Type': 'application/json-patch+json'
                                }

                                response = requests.request("POST", url, headers=headers, data=payload)

                                print(response.text)

                            
                        
                        

                                package main

                                import (
                                "fmt"
                                "strings"
                                "net/http"
                                "io/ioutil"
                                )

                                func main() {

                                url := "https://payment.counos.io/api/terminal/order"
                                method := "POST"

                                payload := strings.NewReader(`{ "orderId": YOUR_STORE_ORDER_ID, "expectedAmount": YOUR_ORDER_EXPECTED_AMOUNT, "tickerId": TICKER_ID, "renew": true}`)

                                client := &http.Client {
                                }
                                req, err := http.NewRequest(method, url, payload)

                                if err != nil {
                                fmt.Println(err)
                                return
                                }
                                req.Header.Add("accept", "application/json")
                                req.Header.Add("x-api-key", "YOUR_STORE_X_API_KEY")
                                req.Header.Add("Content-Type", "application/json-patch+json")
                                
                                res, err := client.Do(req)
                                if err != nil {
                                fmt.Println(err)
                                return
                                }
                                defer res.Body.Close()

                                body, err := ioutil.ReadAll(res.Body)
                                if err != nil {
                                fmt.Println(err)
                                return
                                }
                                fmt.Println(string(body))
                                }

                            
                        
                        

                                wget --no-check-certificate --quiet \
                                --method POST \
                                --timeout=0 \
                                --header 'accept: application/json' \
                                --header 'x-api-key: YOUR_STORE_X_API_KEY' \
                                --header 'Content-Type: application/json-patch+json' \
                                --body-data '{ "orderId": YOUR_STORE_ORDER_ID, "expectedAmount": YOUR_ORDER_EXPECTED_AMOUNT, "tickerId": TICKER_ID, "renew": true}' \
                                'https://payment.counos.io/api/terminal/order'

                            
                        
                        
                                OkHttpClient client = new OkHttpClient().newBuilder()
                                .build();
                                MediaType mediaType = MediaType.parse("application/json-patch+json");
                                RequestBody body = RequestBody.create(mediaType, "{ \"orderId\": YOUR_STORE_ORDER_ID, \"expectedAmount\": YOUR_ORDER_EXPECTED_AMOUNT, \"tickerId\": TICKER_ID, \"renew\": true}");
                                Request request = new Request.Builder()
                                .url("https://payment.counos.io/api/terminal/order")
                                .method("POST", body)
                                .addHeader("accept", "application/json")
                                .addHeader("x-api-key", "YOUR_STORE_X_API_KEY")
                                .addHeader("Content-Type", "application/json-patch+json")
                                .build();
                                Response response = client.newCall(request).execute();

                            
                        
                        
                                var request = require('request');
                                var options = {
                                'method': 'POST',
                                'url': 'https://payment.counos.io/api/terminal/order',
                                'headers': {
                                'accept': 'application/json',
                                'x-api-key': 'YOUR_STORE_X_API_KEY',
                                'Content-Type': 'application/json-patch+json'
                                },
                                body: '{ "orderId": YOUR_STORE_ORDER_ID, "expectedAmount": YOUR_ORDER_EXPECTED_AMOUNT, "tickerId": TICKER_ID, "renew": true}'

                                };
                                request(options, function (error, response) {
                                if (error) throw new Error(error);
                                console.log(response.body);
                                });


                            
                        
                        
                                require "uri"
                                require "net/http"

                                url = URI("https://payment.counos.io/api/terminal/order")

                                https = Net::HTTP.new(url.host, url.port)
                                https.use_ssl = true

                                request = Net::HTTP::Post.new(url)
                                request["accept"] = "application/json"
                                request["x-api-key"] = "YOUR_STORE_X_API_KEY"
                                request["Content-Type"] = "application/json-patch+json"
                                request.body = "{ \"orderId\": YOUR_STORE_ORDER_ID, \"expectedAmount\": YOUR_ORDER_EXPECTED_AMOUNT, \"tickerId\": TICKER_ID, \"renew\": true}"

                                response = https.request(request)
                                puts response.read_body



                            
                        
                        
                                var settings = {
                                "url": "https://payment.counos.io/api/terminal/order",
                                "method": "POST",
                                "timeout": 0,
                                "headers": {
                                "accept": "application/json",
                                "x-api-key": "YOUR_STORE_X_API_KEY",
                                "Content-Type": "application/json-patch+json"
                                },
                                "data": "{ \"orderId\": YOUR_STORE_ORDER_ID, \"expectedAmount\": YOUR_ORDER_EXPECTED_AMOUNT, \"tickerId\": TICKER_ID, \"renew\": true}",
                                };

                                $.ajax(settings).done(function (response) {
                                console.log(response);
                                });

                            
                        



Get /api/terminal/order/{YOUR_ORDER_ID}


With this API you can check the status of the orders that you have created before. When you want to try it out, then you need to input the specific order id that you want to check.
These order ids have been created previously. After you put in the order id, click on execute. Then you can see the full information of the order id, including how many confirmations it has received, how much of it has been paid, what is its status, when it will expire, and other relevant information. If the payment is not yet made, the value “paid” is set to false, but if the payment is made the value will change to true.

                        
                                curl --location --request GET 'https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID' \
                                --header 'accept: application/json' \
                                --header 'x-api-key: YOUR_STORE_X_API_KEY'
                            
                        
                        
                                using (var httpClient = new HttpClient())
                                {
                                using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID"))
                                {
                                request.Headers.TryAddWithoutValidation("accept", "application/json");
                                request.Headers.TryAddWithoutValidation("x-api-key", "YOUR_STORE_X_API_KEY");

                                var response = await httpClient.SendAsync(request);
                                }
                                }
                            
                        
                        


                                $curl = curl_init();

                                curl_setopt_array($curl, array(
                                CURLOPT_URL => 'https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID',
                                CURLOPT_RETURNTRANSFER => true,
                                CURLOPT_ENCODING => '',
                                CURLOPT_MAXREDIRS => 10,
                                CURLOPT_TIMEOUT => 0,
                                CURLOPT_FOLLOWLOCATION => true,
                                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                                CURLOPT_CUSTOMREQUEST => 'GET',
                                CURLOPT_HTTPHEADER => array(
                                'accept: application/json',
                                'x-api-key: YOUR_STORE_X_API_KEY'
                                ),
                                ));

                                $response = curl_exec($curl);

                                curl_close($curl);
                                echo $response;

                            
                        
                        
                                import requests

                                url = "https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID"

                                payload={}
                                headers = {
                                'accept': 'application/json',
                                'x-api-key': 'YOUR_STORE_X_API_KEY'
                                }

                                response = requests.request("GET", url, headers=headers, data=payload)

                                print(response.text)


                            
                        
                        

                                package main

                                import (
                                "fmt"
                                "net/http"
                                "io/ioutil"
                                )

                                func main() {

                                url := "https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID"
                                method := "GET"

                                client := &http.Client {
                                }
                                req, err := http.NewRequest(method, url, nil)

                                if err != nil {
                                fmt.Println(err)
                                return
                                }
                                req.Header.Add("accept", "application/json")
                                req.Header.Add("x-api-key", "YOUR_STORE_X_API_KEY")

                                res, err := client.Do(req)
                                if err != nil {
                                fmt.Println(err)
                                return
                                }
                                defer res.Body.Close()

                                body, err := ioutil.ReadAll(res.Body)
                                if err != nil {
                                fmt.Println(err)
                                return
                                }
                                fmt.Println(string(body))
                                }

                            
                        
                        

                                wget --no-check-certificate --quiet \
                                --method GET \
                                --timeout=0 \
                                --header 'accept: application/json' \
                                --header 'x-api-key: YOUR_STORE_X_API_KEY' \
                                'https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID'

                            
                        
                        
                                OkHttpClient client = new OkHttpClient().newBuilder()
                                .build();
                                Request request = new Request.Builder()
                                .url("https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID")
                                .method("GET", null)
                                .addHeader("accept", "application/json")
                                .addHeader("x-api-key", "YOUR_STORE_X_API_KEY")
                                .build();
                                Response response = client.newCall(request).execute();

                            
                        
                        
                                var request = require('request');
                                var options = {
                                'method': 'GET',
                                'url': 'https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID',
                                'headers': {
                                'accept': 'application/json',
                                'x-api-key': 'YOUR_STORE_X_API_KEY'
                                }
                                };
                                request(options, function (error, response) {
                                if (error) throw new Error(error);
                                console.log(response.body);
                                });


                            
                        
                        
                                require "uri"
                                require "net/http"

                                url = URI("https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID")

                                https = Net::HTTP.new(url.host, url.port)
                                https.use_ssl = true

                                request = Net::HTTP::Get.new(url)
                                request["accept"] = "application/json"
                                request["x-api-key"] = "YOUR_STORE_X_API_KEY"

                                response = https.request(request)
                                puts response.read_body


                            
                        
                        
                                var settings = {
                                "url": "https://payment.counos.io/api/terminal/order/YOUR_ORDER_ID",
                                "method": "GET",
                                "timeout": 0,
                                "headers": {
                                "accept": "application/json",
                                "x-api-key": "YOUR_STORE_X_API_KEY"
                                },
                                };

                                $.ajax(settings).done(function (response) {
                                console.log(response);
                                });

                            
                        



These APIs which have been descriped above are the main APIs to use the payment gateway, if you are looking for whole APIs such as cryptocurrencies price, price conversion, store account balance, account withdraw and so on you can follow the below link. In addition you can test and run your APIs in this page.