walesyu / api-doc

cubepay api document

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

CubePay's API makes it easy to receive or send cryptocurrency by BTC, ETH , LTC and customized ERC-20 token. More info at https://cubepay.io

Getting Start

Get client_id and client_key on https://cubepay.io >> Account Setting

The URL to the API service

Request

All API request with parameter using POST method and most have parameters client_id and sign. more about Authentication.

Response

All API response process status with standard HTTP Status Code in header, and with JSON format like below:

status : status code, 200 means process success and the others code means error.

data : a structure with relation information if success, else there will content error message.

{
data: "missing client_id",
status: 401
}

Status Code and message

status code message
200 success
400 process error
401 authentication fail
404 not found
500 fatal error

Authentication

Generate a sign string follow these step :

1. Ascending sort your parameters by parameter's name, and join to a string format in Pattern of Query String.

akey=100&client_id=exampleclientid&ekey1=100&ekey2=200&wkey3=250

2. Put client_key={your client key} to the end of string.

akey=100&client_id=exampleclientid&ekey1=100&ekey2=200&wkey3=250&client_key=exampleclientkey

3. Hash String by Sha-256

SHA256(akey=100&client_id=exampleclientid&ekey1=100&ekey2=200&wkey3=250&client_key=exampleclientkey)
=
ca3f40ae95c5dc7cd89259746d2c2476f600e9c914ac2d35f6510aadb39a1364

4. String to uppercase

sign=CA3F40AE95C5DC7CD89259746D2C2476F600E9C914AC2D35F6510AADB39A1364

5. Attach sign to parameter

About

cubepay api document