Custom Integration
BitcartCC provides a variety of ways to integrate into your application.

BitcartCC SDK

Do you need something completely custom, like atomic tip bot?
Then you can use our SDK
It is a python library simplifying the usage of our core daemons (refer to Architecture page for more information). If you are coding in python, you have the best development experience ever, as SDK supports everything daemon supports.
If coding in another language, you can either create a similar library for your language, or use the daemon directly.
The daemon follows the JSON-RPC 2.0 specification, with two extensions:
  • Arguments may be passed either by position, or by name, or by position AND by name (in that case, args are a list, the last element of which is a dictionary containing by-name arguments)
  • Xpub, if needed, is passed as part of the by-name argument

BitcartCC Merchants API

The Merchants API is used to simplify the usage of multiple daemons at once and suits the best for the case when you need to receive payments.
To create an invoice, just send a POST request to /invoices.
You can pass many arguments, but the only required ones are price and store_id.
Check out the swagger documentation for more information.

BitcartCC Admin Panel's checkout modal

To easily integrate a ready checkout page in your website, you may use a script that comes with your admin panel. You can create the invoice, and use that script to show a checkout modal on your page.
Example of usage to add the modal to your website:
  1. 1.
    Include the bitcart.js script in your html page
    1
    <script src="https://admin.your.bitcartcc.url/modal/bitcart.js"></script>
    Copied!
  2. 2.
    Call the invoice API to generate an invoice (example code). This is sample backend code as it contains an auth token that should not be exposed in your front-end.
    1
    const axiosClient = axios.create({
    2
    baseURL: BITCART_URL,
    3
    timeout: 5000,
    4
    responseType: 'json',
    5
    headers: {
    6
    'Content-Type': 'application/json',
    7
    'Authorization': BITCART_AUTH
    8
    }
    9
    });
    10
    11
    const invoiceCreation = {
    12
    "price": 5,
    13
    "store_id": 1,
    14
    "order_id": "something",
    15
    "notification_url": "https://webhook.after.checkout.com/goeshere",
    16
    "redirect_url": "https://go.here.after.checkout.com"
    17
    };
    18
    19
    const response = await axiosClient.post("/invoices", invoiceCreation);
    20
    const invoiceId = response.data.id;
    Copied!
  3. 3.
    Use the invoiceId to pop up the modal
    1
    window.bitcart.showInvoice(invoiceId);
    Copied!
  4. 4.
    You'll often want to do something like refresh the state of your page when the invoice is paid, or note some kind of state before the modal pops up. You can attach event listeners like this:
    1
    window.bitcart.onModalWillEnter(yourCallbackFunction);
    2
    window.bitcart.onModalWillLeave(yourCallbackFunction);
    Copied!
Last modified 11mo ago