Richamster API API Reference

API description. Base url is https://richamster.com/public/v1/

Request Content-Types: application/json
Response Content-Types: application/json
Version: v1

Authentication

api_key

JWT token authorization

in
header
name
Authorization: JWT <your_token>
type
apiKey

exchange

GET /exchange/order-book/

Order book.

pair: string
in query

(no description)

side: string
in query

(no description)

Response Example (200 OK)
[
  {
    "volume": "string (decimal)",
    "unit_price": "string (decimal)",
    "sum": "string (decimal)",
    "side": "string",
    "pair": "string"
  }
]

GET /exchange/orders/history/

Orders history (closed orders).

pair: string
in query

(no description)

cursor: string
in query

The pagination cursor value.

page_size: integer
in query

Number of results to return per page.

Response Example (200 OK)
[
  {
    "pk": "integer",
    "created_at": "string (date-time)",
    "closed_at": "string (date-time)",
    "side": "string",
    "volume": "string (decimal)",
    "unit_price": "string (decimal)",
    "sum": "string (decimal)",
    "pair": "string"
  }
]

GET /exchange/restrictions/

Currency pair trading restrictions data api view.

Response Example (200 OK)
[
  {
    "currency_pair": "string",
    "min_quantity": "string",
    "price_scale": "integer"
  }
]

GET /exchange/ticker/

Ticker list.

pair: string
in query

(no description)

200 OK
type
Response Example (200 OK)
[
  {
    "pk": "integer",
    "pair": "string",
    "last": "string (decimal)",
    "first": "string (decimal)",
    "high": "string (decimal)",
    "low": "string (decimal)",
    "volume": "string (decimal)"
  }
]

GET /exchange/user/orders/

User orders (open orders).

pair: string
in query

(no description)

cursor: string
in query

The pagination cursor value.

page_size: integer
in query

Number of results to return per page.

200 OK

User order list

Response Example (200 OK)
{
  "pk": "integer",
  "created_at": "string (date-time)",
  "closed_at": "string (date-time)",
  "side": "string",
  "volume": "string (decimal)",
  "unit_price": "string (decimal)",
  "sum": "string (decimal)",
  "pair": "string"
}

POST /exchange/user/orders/

User orders (open orders).

undefined

Request Example
{
  "amount": "string (decimal)",
  "unit_price": "string (decimal)",
  "currency_pair": "string",
  "type": "string"
}
201 Created

New order

Response Example (201 Created)
{
  "order_type": "string",
  "amount": "string (decimal)",
  "unit_price": "string (decimal)",
  "currency_pair": "string",
  "commision": "string (decimal)",
  "closed_at": "string (date-time)",
  "type": "string",
  "created_at": "string (date-time)",
  "is_partial": "string",
  "user_from": "string",
  "user_to": "string"
}

DELETE /exchange/user/orders/{id}/

Destroys user order by id.

id: integer
in path

A unique integer value identifying this Trade order.

204 No Content

feedback

POST /feedback/contact-us/

undefined

Request Example
{
  "name": "string",
  "phone": "string",
  "email": "string (email)",
  "question": "string"
}
201 Created
Response Example (201 Created)
{
  "id": "integer",
  "created_at": "string (date-time)",
  "updated_at": "string (date-time)",
  "name": "string",
  "phone": "string",
  "email": "string (email)",
  "question": "string"
}

login

POST /login/

Authenticates user with plain credentials. If user has no two factor auth he must be authenticated here (jwt token returns as response), otherwise - text to go to the next step.

undefined

Request Example
{
  "username": "string",
  "password": "string",
  "recaptcha": "string"
}
200 OK

Login response

type
object
201 Created

Login response

type
object
Response Example (200 OK)
{
  "requires_two_factor": "boolean"
}
Response Example (201 Created)
{
  "token": "string"
}

payments

GET /payments/replenish/{currency}/

Replenishes user account

currency: string
in path

(no description)

200 OK

Replenish initial data

Response Example (200 OK)
{
  "pk": "integer",
  "currency": "string",
  "sum": "string (decimal)",
  "will_be_holded": "string",
  "meta": "string"
}

POST /payments/replenish/{currency}/

Replenishes user account

currency: string
in path

(no description)

201 Created

GET /payments/withdraw/{currency}/

Withdraws user money.

currency: string
in path

(no description)

200 OK

Withdraw initial data

Response Example (200 OK)
{
  "address": "string",
  "sum": "string (decimal)",
  "fee": "string"
}

POST /payments/withdraw/{currency}/

Withdraws user money.

currency: string
in path

(no description)

201 Created

register

POST /register/

Registers user.

undefined

Request Example
{
  "username": "string",
  "email": "string (email)",
  "password1": "string",
  "password2": "string",
  "not_usa_citizen": "boolean",
  "is_licence_agree": "boolean",
  "recaptcha": "string"
}
201 Created
Response Example (201 Created)
{
  "username": "string",
  "email": "string (email)",
  "password1": "string",
  "password2": "string",
  "not_usa_citizen": "boolean",
  "is_licence_agree": "boolean",
  "recaptcha": "string"
}

token

API View that returns a refreshed token (with new expiration) based on existing token

POST /token/refresh/

If 'orig_iat' field (original issued-at-time) is found, will first check if it's within expiration window, then copy it to the new token

Request Example
{
  "token": "string"
}
201 Created
Response Example (201 Created)
{
  "token": "string"
}

POST /token/verify/

API View that checks the veracity of a token, returning the token if it is valid.

undefined

Request Example
{
  "token": "string"
}
201 Created
Response Example (201 Created)
{
  "token": "string"
}

two-factor-login

POST /two-factor-login/

Authenticates user with two-factor credentials.

undefined

Request Example
{
  "otp_token": "string"
}
201 Created

Login response

type
object
Response Example (201 Created)
{
  "token": "string"
}

user

GET /user/balances/

User balances.

currency: string
in query

(no description)

200 OK

User balances

Response Example (200 OK)
{
  "currency": {
    "id": "integer",
    "abbreviation": "string",
    "system_name": "string",
    "io_fee": "string (decimal)",
    "is_auction_currency": "boolean",
    "is_market": "boolean",
    "precision": "integer",
    "can_input_output": "boolean"
  },
  "balance": "string (decimal)",
  "active_balance": "string",
  "in_orders": "string",
  "in_auctions": "string",
  "in_krb": "string (decimal)"
}

GET /user/detail/

User detail info.

200 OK

User detail

Response Example (200 OK)
{
  "username": "string",
  "first_name": "string",
  "middle_name": "string",
  "last_name": "string",
  "dices": "integer",
  "role": "string",
  "phone": "string",
  "email": "string (email)",
  "fee": "string"
}

GET /user/orders/

User orders.

pair: string
in query

(no description)

side: string
in query

(no description)

closed_at__gte: number
in query

(no description)

closed_at__lte: number
in query

(no description)

200 OK

User order list

Response Example (200 OK)
{
  "closed_at": "string (date-time)",
  "type": "string",
  "unit_price": "string",
  "volume": "string (decimal)",
  "sum": "string (decimal)",
  "pair": "string"
}

GET /user/transactions/

User transactions.

currency: string
in query

(no description)

type: string
in query

(no description)

closed_at__gte: number
in query

(no description)

closed_at__lte: number
in query

(no description)

200 OK

User transactions

Response Example (200 OK)
{
  "created_at": "string (date-time)",
  "closed_at": "string (date-time)",
  "status": "string",
  "type": "integer",
  "currency": "string",
  "sum": "string (decimal)",
  "fee": "string (decimal)",
  "balance": "string (decimal)",
  "hash": "string"
}

Schema Definitions

ExchangeGlass: object

volume: string (decimal)
unit_price: string (decimal)
sum: string (decimal)
side: string buying, selling
pair: string
Example
{
  "volume": "string (decimal)",
  "unit_price": "string (decimal)",
  "sum": "string (decimal)",
  "side": "string",
  "pair": "string"
}

OrderHistory: object

pk: integer
created_at: string (date-time)
closed_at: string (date-time)
side: string buying, selling
volume: string (decimal)
unit_price: string (decimal)
sum: string (decimal)
pair: string
Example
{
  "pk": "integer",
  "created_at": "string (date-time)",
  "closed_at": "string (date-time)",
  "side": "string",
  "volume": "string (decimal)",
  "unit_price": "string (decimal)",
  "sum": "string (decimal)",
  "pair": "string"
}

CurrencyPairRestrictions: object

currency_pair: string
min_quantity: string
price_scale: integer
Example
{
  "currency_pair": "string",
  "min_quantity": "string",
  "price_scale": "integer"
}

Ticker: object

pk: integer
pair: string
last: string (decimal)
first: string (decimal)
high: string (decimal)
low: string (decimal)
volume: string (decimal)
Example
{
  "pk": "integer",
  "pair": "string",
  "last": "string (decimal)",
  "first": "string (decimal)",
  "high": "string (decimal)",
  "low": "string (decimal)",
  "volume": "string (decimal)"
}

NewOrder: object

order_type: string buying, selling
amount: string (decimal)
unit_price: string (decimal)
currency_pair: string (at least 1 chars)
commision: string (decimal)
closed_at: string (date-time)
type: string buying, selling
created_at: string (date-time)
is_partial: string
user_from: string
user_to: string
Example
{
  "order_type": "string",
  "amount": "string (decimal)",
  "unit_price": "string (decimal)",
  "currency_pair": "string",
  "commision": "string (decimal)",
  "closed_at": "string (date-time)",
  "type": "string",
  "created_at": "string (date-time)",
  "is_partial": "string",
  "user_from": "string",
  "user_to": "string"
}

ContactUs: object

id: integer
created_at: string (date-time)
updated_at: string (date-time)
name: string | null (up to 125 chars)
phone: string | null (up to 25 chars)
email: string | null (email) (up to 254 chars)
question: string (1 to 1024 chars)
Example
{
  "id": "integer",
  "created_at": "string (date-time)",
  "updated_at": "string (date-time)",
  "name": "string",
  "phone": "string",
  "email": "string (email)",
  "question": "string"
}

Login: object

username: string (at least 1 chars)
password: string (at least 1 chars)
recaptcha: string (at least 1 chars)
Example
{
  "username": "string",
  "password": "string",
  "recaptcha": "string"
}

BaseReplenish: object

pk: integer
currency: string
sum: string (decimal)
will_be_holded: string
meta: string
Example
{
  "pk": "integer",
  "currency": "string",
  "sum": "string (decimal)",
  "will_be_holded": "string",
  "meta": "string"
}

BaseWithdraw: object

address: string (at least 1 chars)
sum: string (decimal)
fee: string
Example
{
  "address": "string",
  "sum": "string (decimal)",
  "fee": "string"
}

UserCreation: object

username: string (1 to 150 chars)

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

email: string (email) (1 to 254 chars)
password1: string (at least 1 chars)
  • Your password can't be too similar to your other personal information.
  • Your password must contain at least 8 characters.
  • Your password can't be a commonly used password.
  • Your password can't be entirely numeric.
  • Your password need to have chars and numbers.
password2: string (at least 1 chars)

Enter the same password as before, for verification.

not_usa_citizen: boolean
is_licence_agree: boolean
recaptcha: string (at least 1 chars)
Example
{
  "username": "string",
  "email": "string (email)",
  "password1": "string",
  "password2": "string",
  "not_usa_citizen": "boolean",
  "is_licence_agree": "boolean",
  "recaptcha": "string"
}

RefreshJSONWebToken: object

token: string (at least 1 chars)
Example
{
  "token": "string"
}

VerifyJSONWebToken: object

token: string (at least 1 chars)
Example
{
  "token": "string"
}

OTPLogin: object

otp_token: string (at least 1 chars)
Example
{
  "otp_token": "string"
}

Currency: object

id: integer
abbreviation: string (1 to 25 chars)
system_name: string | null (up to 10 chars)

Used in code to identify currencies. Think carefully before changing it

io_fee: string (decimal)
is_auction_currency: boolean
is_market: boolean
precision: integer -2147483648 ≤ x ≤ 2147483647
can_input_output: boolean
Example
{
  "id": "integer",
  "abbreviation": "string",
  "system_name": "string",
  "io_fee": "string (decimal)",
  "is_auction_currency": "boolean",
  "is_market": "boolean",
  "precision": "integer",
  "can_input_output": "boolean"
}

UserBalance: object

currency: Currency
balance: string (decimal)
active_balance: string
in_orders: string
in_auctions: string
in_krb: string (decimal)
Example
{
  "currency": {
    "id": "integer",
    "abbreviation": "string",
    "system_name": "string",
    "io_fee": "string (decimal)",
    "is_auction_currency": "boolean",
    "is_market": "boolean",
    "precision": "integer",
    "can_input_output": "boolean"
  },
  "balance": "string (decimal)",
  "active_balance": "string",
  "in_orders": "string",
  "in_auctions": "string",
  "in_krb": "string (decimal)"
}

User: object

username: string (1 to 150 chars)

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

first_name: string (up to 30 chars)
middle_name: string | null (up to 255 chars)
last_name: string (up to 150 chars)
dices: integer -2147483648 ≤ x ≤ 2147483647
role: string
phone: string | null (up to 255 chars)
email: string (email) (1 to 254 chars)
fee: string
Example
{
  "username": "string",
  "first_name": "string",
  "middle_name": "string",
  "last_name": "string",
  "dices": "integer",
  "role": "string",
  "phone": "string",
  "email": "string (email)",
  "fee": "string"
}

UserOrder: object

closed_at: string (date-time)
type: string buying, selling
unit_price: string
volume: string (decimal)
sum: string (decimal)
pair: string
Example
{
  "closed_at": "string (date-time)",
  "type": "string",
  "unit_price": "string",
  "volume": "string (decimal)",
  "sum": "string (decimal)",
  "pair": "string"
}

Transaction: object

created_at: string (date-time)
closed_at: string (date-time)
status: string draft, confirmed, failed
type: integer replenish, withdrawal
currency: string
sum: string (decimal)
fee: string (decimal)
balance: string | null (decimal)
hash: string
Example
{
  "created_at": "string (date-time)",
  "closed_at": "string (date-time)",
  "status": "string",
  "type": "integer",
  "currency": "string",
  "sum": "string (decimal)",
  "fee": "string (decimal)",
  "balance": "string (decimal)",
  "hash": "string"
}