Custom Integration
Last updated
Was this helpful?
Last updated
Was this helpful?
Bitcart provides a variety of ways to integrate into your application.
Do you need something completely custom, like ?
Then you can use our
It is a python library simplifying the usage of our core daemons (refer to 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
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 for more information.
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:
Include the bitcart.js
script in your html page
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.
Use the invoiceId
to pop up the modal
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: