Ruby SDK

Official COINQVEST SDK for Ruby. Accept digital currencies like Bitcoin, Ether, or Stellar Lumens and settle in your national currency.

View SDKs for other programming languages.

COINQVEST Merchant SDK (Ruby)

Official COINQVEST Merchant API SDK for Ruby by

This SDK implements the REST API documented at

For SDKs in different programming languages, see

Read our Merchant API development guide and the examples below to help you get started.


  • Ruby >= 2.0.0
  • rest-client >= 2.1.0
  • json >= 2.3.0

Installation with gem

gem install coinqvest_merchant_sdk

Usage Client

require 'coinqvest_merchant_sdk/client'

client =
    '/var/log/coinqvest-ruby.log' # an optional log file location

Get your API key and secret here:


Create a Customer (

Creates a customer object, which can be associated with checkouts, payments, and invoices. Checkouts associated with a customer generate more transaction details, help with your accounting, and can automatically create invoices for your customer and yourself.

response ='/customer', {:customer => {
    :email => '',
    :firstname => 'John',
    :lastname => 'Doe',
    :company => 'ACME Inc.',
    :adr1 => '810 Beach St',
    :adr2 => 'Finance Department',
    :zip => 'CA 94103',
    :city => 'San Francisco',
    :countrycode => 'US'
print "Status Code: " + response.code.to_s + "\n"
print "Response Body: " + response.body + "\n"

Create a Hosted Checkout (

Hosted checkouts are the simplest form of getting paid using the COINQVEST platform.

Using this endpoint, your server submits a set of parameters, such as the payment details including optional tax items, customer information, and settlement currency. Your server then receives a checkout URL in return, which is displayed back to your customer.

Upon visiting the URL, your customer is presented with a checkout page hosted on COINQVEST servers. This page displays all the information the customer needs to complete payment.

response ='/checkout/hosted', {
    :charge => {
        :customerId => customer_id, # associates this charge with a customer as crated by POST /customer
        :billingCurrency => 'USD', # a billing currency as given by GET /currencies
        :lineItems => [{ # a list of line items included in this charge
            :description => 'T-Shirt',
            :netAmount => 10, # denominated in the currency specified above
            :quantity => 1
        :discountItems => [{ # an optional list of discounts
            :description => 'Loyalty Discount',
            :netAmount => 0.5
        :shippingCostItems => [{ # an optional list of shipping and handling costs
            :description => 'Shipping and Handling',
            :netAmount => 3.99,
            :taxable => FALSE # sometimes shipping costs are taxable
        :taxItems => [{ # an optional list of taxes
            :name => 'CA Sales Tax',
            :percent => 0.0825 # 8.25% CA sales tax
    :settlementAsset => 'USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN' # your settlement asset as given by GET /assets (or ORIGIN to omit conversion)
print "Status Code: " + response.code.to_s + "\n"
print "Response Body: " + response.body + "\n"

Monitor Payment State (

Once the payment is captured we notify you via email, webhook. You can also poll GET /checkout for payment status updates:

response = client.get('/checkout', {:id => checkout_id})
if response.code == 200
  data = JSON.parse(response.body)
  state = data["checkout"]["state"]
  if state == 'COMPLETED'
    print "The payment has completed and your account was credited. You can now ship the goods."
    # try again in 30 seconds or so...

Query your USD Wallet (

response = client.get('/wallet', {:assetCode => 'USD'})

Query all Wallets (

response = client.get('/wallets')

Withdraw USDC to your Bitcoin Account (

response ='/withdrawal', {
  :sourceAsset => 'USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN', #withdraw from your USDC wallet
  :sourceAmount => '100',
  :targetNetwork => 'BITCOIN', # a target network as given by GET /networks
  :targetAccount => {
    :address => 'bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23'

Withdraw USDC to your Stellar Account (

response ='/withdrawal', {
  :sourceAsset => 'USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN', #withdraw from your USDC wallet
  :sourceAmount => '100',
  :targetNetwork => 'STELLAR', # a target network as given by GET /networks
  :targetAccount => {
    :memo => 'Exodus',
    :memoType => 'text'

Update a Customer (

response = client.put('/customer', {:customer => {
    :id => customer_id,
    :email => ''

Delete a Customer (

response = client.delete('/customer', {:id => customer_id})

List your 250 newest customers (

response = client.get('/customers', {:limit => 250})

List all available assets (

response = client.get('/assets')

List all available networks (

response = client.get('/networks')

Please inspect for detailed API documentation or email us at if you have questions.

Support and Feedback

We'd love to hear your feedback. If you have specific problems or bugs with this SDK, please file an issue on GitHub. For general feedback and support requests please email


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
View on GitHub View API Docs
© COINQVEST LLC 2018-2023 · Terms of Service · Privacy Policy · KYC/AML Policy · Anti-Fraud Policy · Data Processing · License COINQVEST LLC (Company Number 0000970546) is a limited liability company incorporated at 54 Jedności Street, 65-018 Zielona Góra, Poland. COINQVEST LLC reports to the General Inspector of Financial Information and is authorized by the Polish Ministry of Finance to provide virtual currency exchange and custody services under Virtual Asset Service Provider number RDWW-311. Licensed and Regulated in the EU © COINQVEST LLC 2018-2023 · Terms of Service · Privacy Policy · KYC/AML Policy · Anti-Fraud Policy · Data Processing · License
Space cat likes space and he surfs on a space ship.