LogoLogo
  • GENERAL
    • Introduction
    • Overview
    • Authentification
    • ENUM description
  • ACQUIRING
    • Customer wallets
    • Invoices
    • Onramp
  • EXCHANGE
    • Crypto exchange
  • PAYOUTS
    • Single Payout
    • Mass Payout
  • WEBHOOKS
    • Overview
    • Types of events
    • Webhook payload
    • Webhook sign check
  • GUIDES
    • General questions
      • What is Calypso Pay?
      • Which blockchains and tokens we support?
    • Calypso UI guides and questions
      • Introduction to Calypso Pay
      • Sandbox mode and limits
      • General
        • How to create new API key
        • How to create an additional account
        • How to add a new asset to account
        • How to add funds to your wallet
        • Protect your withdrawals with additional signatures
        • How to change your top-up address
        • How to use address book
        • How to set up auto currency conversion
        • How to transfer money within Calypso pay
        • Create a webhook
      • Accept Payments via UI
        • How to create an invoice via UI
        • Accept Payments FAQ
      • Make Payments via UI
        • How to create a single payout via UI
        • How to create mass payout via UI
        • Make Payments FAQ
      • Make Exchanges via UI
        • How to exchange one crypto asset to the other
      • Reports
        • How to get reports
        • Report contents description
    • Integration guides and questions
      • Get started with API
      • Use Customer purse via API
        • How create a customer
        • How to get a purse
        • How to get a transaction data
      • Accept Payments via API
        • How to create a Limited Invoice via API
        • How to create a Limited Fiat Invoice via API
        • How to create an Unlimited Invoice via API
        • How to manage interventions via API
        • How to embed invoice data to your payment page
      • Payment widget
        • How to create a limited fiat payment widget via API
        • How to create unlimited payment widget
        • How to embed a payment widget on a web page
      • Make Exchange via API
        • How to create a exchange
        • Get balance information via API
      • Make Payments via API
        • Get balance information via API
        • How to create a single payout via API
        • How to create a mass payout via API
  • API REFERENCE
    • Report API
    • Settlement Payout API
    • Webhook API
    • Payout API
    • Exchange API
    • Fiat API
    • User API
    • Rate API
    • Settlement Wallet API
    • Fiat withdrawal API
    • Account API
    • Currency API
    • Invoice API
    • Settlement Report API
    • Crypto to fiat API
    • Customer Purse API
    • Fiat deposit API
    • Payment Widget API
    • Models
Powered by GitBook
On this page
Export as PDF
  1. GUIDES
  2. Integration guides and questions

Get started with API

Signing requests

First of all to use Calypso Public API you’ll need to contact Technical Support to generate a new pair of API keys (public and secret keys):

secret key example:
b823a6b9ea72408583cef9ec8d67fa52
public key example:
c529e14832b34b74972365cf7bf02430

API keys are used for authorization in requests to the Calypso API. After receiving API keys from our Technical Support team you can start sending requests to Calypso Public API.

All requests must contain the following headers:

Key
The api key as a string.

Sign

The HEX-encoded signature (see below).

Content-Type

All request bodies should have content type application/json and be valid JSON.

Sign — POST data (in the same format in which you want to send) encrypted with the method HMAC-SHA512 using secret key and the result object is converted to a HEX string.

The body is the request body string (in all cases this is JSON stringified request params object).

All the requests should also include the obligatory POST parameter timestamp with current unix UTC timestamp in milliseconds. The value must not be less than 3 minutes in the past and not greater than 3 minutes in the future.

To create the sign:

  1. Build the body of the request with correct timestamp

  2. Encrypt the request body with method HMAC-SHA512 using the body as a message and the secret key as a key.

  3. Convert bytes to string of hexadecimal digits.

Examples of sign building:

  • Javascript

    JSX

    const crypto = require("crypto-js");
    
    signature = function (body, secretKey) {
            return crypto.HmacSHA512(body, secretKey).toString(crypto.enc.hex);
        };
  • Python

    Python

    import hmac
    import hashlib
    
    def signature(body, secret_key):
        return hmac.new(secret_key.encode(), body.encode(), hashlib.sha512).hexdigest()

Example of api keys, body and correct sign for request:

Python

api_key = 'c529e14832b34b74972365cf7bf02430'
secret_key = 'b823a6b9ea72408583cef9ec8d67fa52'

data = '{"timestamp":1}'
sign = 'b16e9d45f49f2069becbc4f108b237bee588cfc353fe9501df103e692acbc68d482a10d34c12bea22fedde7e28e1b8e57a6a0a373b0e9a27c5257bd8b36e13b9'

Examples of timestamp building:

  • Javascript

JavaScript

var timestamp = new Date().getTime();
  • Python

Python

import time

timestamp = round(time.time() * 1000)
PreviousIntegration guides and questionsNextUse Customer purse via API

Last updated 3 days ago