Authentication requires 2 parameters: API Token ID and API Secret. These parameters can be obtained from API Setting page. We use JSON Web Token open standard for Authentication. First you need to build an auth payload.

Auth Payload Parameters

After constructing the auth payload, you need to sign it with your secret using HMAC-SHA256 (HS256). JWT.encode(auth_payload, user_secret, 'HS256') You can choose to manually sign by following JWT specs. But we highly recommend using a JWT library, which is available in a wide range of programming languages.

Request Header

require 'uri'
require 'net/http'
require 'time'
require 'jwt'

uri = URI.parse("")
http =, uri.port)
http.use_ssl = true

token_id = 'YOUR_API_TOKEN_ID'
user_secret = 'YOUR_API_SECRET'
path = '/orders?product_id=1'

auth_payload = {
  path: path,
  token_id: token_id

signature = JWT.encode(auth_payload, user_secret, 'HS256')

request =
request.add_field('X-Quoine-API-Version', '2')
request.add_field('X-Quoine-Auth', signature)
request.add_field('Content-Type', 'application/json')

response = http.request(request)

Last updated