× Docs Platform Dashboard Extensions Wallets Sign in

Currencies

Before transactions can be made in the platform at least two things need to be defined first: a currency and an account. Currencies are the resource Rehive uses to define common value (or assets) in the the platform. In almost all cases a currency represents a fiat currency, token or other cryptographic representation. However the currency system can support almost any fungible value you can think of (United states Dollar, Stellar Lumens, or gold).

Object

Currencies are simple resources that store details and information regarding the currency. This includes typical information like a description, unit and divisibility. The divisibility defines how many decimal places a currency should have.

The full currency object looks like:

{
    "code": "USD",
    "description": "United States dollar",
    "symbol": "$",
    "unit": "dollar",
    "divisibility": 2,
    "archived": false,
    "created": 1519288307393,
    "updated": 1519288307394
},

Endpoints

Currency data appears in some fashion throughout the platform. However there are only several places where the currency can be directly accessed or modified. Keep in mind, when currencies are used in other places within the API, they are always identified by their code.

section type URL methods
admin multiple https://api.rehive.com/3/admin/currencies/ GET, POST
admin single https://api.rehive.com/3/admin/currencies/<id>/ GET, PATCH, PUT, DELETE
user multiple https://api.rehive.com/3/company/currencies/ GET
user single https://api.rehive.com/3/company/currencies/<id>/ GET

Usage

Usage remains the same for all endpoints in Rehive. Simply invoke one of the allowed HTTP methods with the correct Content-Type and a Authorization header.