NAV Navbar
Logo
shell javascript python

Introduction

SDK Initialization

// Both apiVersion and apiToken are optional and the apiVersion defaults to 3
window.rehive = new Rehive({apiVersion: 3, apiToken: 'APITOKEN'});
from rehive import Rehive

# The API_TOKEN can be left blank
rehive = Rehive(API_TOKEN)

API Endpoint

https://api.rehive.com/3/
"""
To override the default add the ENV variable REHIVE_API_URL to your environment
and set this to another base Rehive api url: 'https://staging.rehive.com/3/'
"""

The Rehive API is the core interface for communicating with Rehive. The API is organized around REST with predictable resource oriented URLs. Standard HTTP verbs, codes and authentication methods are used alongside JSON to ensure ease of implementation.

JSON is returned by all API responses. API errors will result in a JSON response as well as a corresponding HTTP response code. For more on errors take a look at errors.

Browsable API

Rehive has made a browsable API to make the platform more explorable. You can experiment with different request formats and methods from within your browser:

Browsable API

Pagination

Pagination Response

 {
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": []
    }
}

// The SDK handles paginations automatically for every resource.

rehive.resource.get() // Stores pagination if returned
rehive.resource.getNext() // Calls with current next value
rehive.resource.getPrevious() // Call with current previous value
# The SDK handles paginations automatically for every resource.

rehive.resource.get() # Stores pagination if returned
rehive.resource.get_next() # Calls with current next value
rehive.resource.get_previous() # Call with current previous value

Almost all listing endpoints include a way to perform pagination. The default pagination method offered by Rehive is offset pagination, which allows navigation to an arbitrary point in a list of results as well as via next and prev attributes. The default page size is 15 but can be changed by adding a page_size query parameter to the request URL.

Options

Value Descrition
page_size number of results per page

Filters

Filtered Request

curl https://api.rehive.com/3/endpoint/?field_1=abc&field_2=123&orderby=field_1
  -X GET
  -H "Content-Type: application/json"
// Filters can be sent to any list resource as an object, ex:
filters = {
   field_1: "abc",
   field_2: 123,
   orderby: "field_1"
}
rehive.resource.get({filters: filters})
# Filters can be parsed to any resource as a dictionary, ex:
filters = {
   "field_1": "abc",
   "field_2": 123,
   "orderby": "field_1"
}
rehive.resource.get(
    filters=filters
)

Most listing pages also include a way to filter and/or sort the returned list of objects. All filtering and sorting is done via query parameters in the GET request.

Each endpoint’s documentation contains a list of fields that are available for filtering and sorting. To filter by a field, include it in the URL as a standard query parameter with a ? delimiting the URL and the start of the query parameters and a & between each filtered field.

To sort results, an endpoint will often inlcude an orderby attribute. Check the specific endpoints documentation on what fields can be used for sorting.

Complex Filter Fields

There are several filter field types in the API that offer more complex interactions:

Date Fields

Date fields can be further narrowed down by filtering on ranges using the greater than (__gt) and less than (__lt) suffixes (eg. created__gt).

Metadata Fields

Custom metadata fields can be filtered on their first level children by adding the child attribute as a suffix (__child_attribute). So if metadata contains a JSON object with an attribute name it can be filtered using metadata__name.

Currency and Amounts

In order to prevent precision errors due to float data types, the API only deals in integers for currency amounts. This means that when posting an amount it should always be converted to it’s lowest currency unit size (ie. an integer). For most currencies/assets this will be the cents value (eg. $ 1.00 represented as 100 in the API). When returning an integer value for a currency amount Rehive will always include a currency object and its associated divisibility so that it is easy to run any conversions back to a decimal number.

Errors

Error Handling

from rehive import APIException

try:
    rehive.admin.currencies.get()
except APIException as e:
    print(e.status_code)
    print(e.data)

Basic error response:

{
    "status": "error",
    "message": "Error message."
}
{
    "message": "Error message."
}
{
    "status": "error",
    "message": "Error message."
}

Multiple errors response:

 {
    "status": "error",
    "message": "First error message, Second error message",
    "data": {
        "field_name1": [
            "First error message."
        ],
        "field_name2": [
            "Second error message."
        ]
    }
}
 {
    "field_name1": [
        "First error message."
    ],
    "field_name2": [
        "Second error message."
    ]
}
{
    "status": "error",
    "message": "First error message, Second error message",
    "data": {
        "field_name1": [
            "First error message."
        ],
        "field_name2": [
            "Second error message."
        ]
    }
}

Rehive errors return an API response message (formatted in JSON) as well as a standard HTTP response code.

The JSON error respone generally includes a message string. If an error occurred on a specific attribute or key they will be outputted in the data object.

Webhook Events

Webhook format

{
    "event": "event.name",
    "company": "company_id",
    "data": {

    }
}

Rehive has a collection of internal events that can be configured to fire off custom webhooks.

Webhooks should always be created with a secure and private secret key (See the webhook API endpoint docs for more about creating webhooks). The secret key can be used to identify valid Rehive requests to your server. The secret should be checked in the Authorization header when receiving a webhook.

Rehive expects a 200 OK HTTP response when webhooks are called. If a 200 response is not returned, Rehive will retry the webhook up to a max of 12 times with a gradually increasing delay between each retry.

Webhook Events

Rehive currently support the following webhook events:

Event Description
user.create user created event
user.update user updated event
user.password.reset user password reset request event
user.email.verify user email verification event (Email key)
user.mobile.verify user mobile verification event (OTP key)
address.create address created event
address.update address updated event
document.create document created event
document.update document updated event
bank_account.create bank account created event
bank_account.update bank account updated event
crypto_account.create crypto account created event
crypto_account.update crypto account updated event
transaction.create transaction created event
transaction.update transaction updated event
transaction.delete transaction deleted event
transaction.initiate transaction initiated (pending) event
transaction.execute transaction executed (complete/failed) event

Idempotent Requests

Idempotent Request

curl {url}
  -X GET
  -H "Idempotency-Key: {key}"
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

The Rehive API supports idempotent requests for ensuring the same operations never occur twice.

To perform an idempotent request, attach a unique key to any POST, PUT or PATCH request made to the API: via the Idempotency-Key: {key} header.

API requests made with a new key will get saved along with their HTTP response. Follow up requests made with the same key will always return the same response (As long as the request has the same HTTP method and URL path). The keys (and their associated saved responses) expire after 24 hours.

Authentication

The authentication endpoints provide the core for all Rehive access control. This includes such tasks as registration, login, verification, password changes and lost password retrievals.

Authorization

Rehive uses a token-based HTTP Authentication scheme.

Once a user has logged in and received a token, each subsequent request should include the token in the HTTP Authorization header.

Tokens expire 10 hours after creation. Once a token has expired, login is required in order to re-authenticate.

Rehive’s tokens allow for a single user to have multiple active tokens on separate devices as well as the ability for admin users to create tokens that do not expire.

Authorization Header

Token authorization request

curl https://api.rehive.com/3/
  -H "Authorization: Token {token}"
"The javascript SDK handles storing and sending the authentication token"
"The python SDK handles storing and sending the authentication token"

When making requests, the API key should be included as a token in the Authorization header:

Authorization: Token {token}

Company Register

Company registration request

curl https://api.rehive.com/3/auth/company/register/
  -X POST
  -H "Content-Type: application/json"
  -d '{"first_name": "Joe",
       "last_name": "Soap",
       "email": "joe@rehive.com",
       "mobile": "+00000000000",
       "company": "rehive",
       "password1": "joe1234",
       "password2":"joe1234",
       "terms_and_conditions": true}'
rehive.auth.registerCompany({
    first_name: "Joe",
    last_name: "Soap",
    email: "joe@rehive.com",
    mobile:"+00000000000",
    company: "rehive",
    password1: "joe1234",
    password2: "joe1234",
    terms_and_conditions: true
}).then(function (user) {
    ...
}, function (err) {
    ...
})
rehive.auth.register_company(
    first_name="Joe",
    last_name="Soap",
    email="joe@rehive.com",
    mobile="+00000000000",
    company="rehive",
    password1="joe1234",
    password2="joe1234",
    terms_and_conditions=True
)

Company registration response

{
    "status": "success"
    "data": {
        "token": "{token}",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": "",
            "id_number": null,
            "birth_date": null,
            "profile": null,
            "currency": null,
            "company": "rehive",
            "language": "en",
            "nationality": "ZA",
            "metadata": {},
            "mobile": "+00000000000",
            "timezone": null,
            "verified": false,
            "verification": {
                "email": true,
                "mobile": true
            },
            "kyc": {
                "updated": 1509539801040,
                "status": "pending"
            },
            "status": "pending",
            "groups": [
                {
                    "name": "test",
                    "label": "Test",
                    "settings": {
                        "allow_transactions": true,
                        "allow_debit_transactions": true,
                        "allow_credit_transactions": true
                    }
                }
            ],
            "permissions": [],
            "created": 1464912953000,
            "updated": 1464912953000,
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}

Register a company owner with the details specified. A successful registration will create a company, return the user’s details and a token that can be used for subsequent requests.

Endpoint

https://api.rehive.com/3/auth/company/register/

Required Fields

Field Description Default
first_name first name null
last_name last name null
email email address null
company company id null
password1 password null
password2 repeat password null
terms_and_conditions agreed to terms false

Optional Fields

Field Description Default
mobile mobile number null
nationality country code null
session_duration session duration 36000000

Register

User registration request

curl https://api.rehive.com/3/auth/register/
  -X POST
  -H "Content-Type: application/json"
  -d '{"first_name": "Joe",
       "last_name": "Soap",
       "email": "joe@rehive.com",
       "company": "rehive",
       "password1": "joe1234",
       "password2":"joe1234"}'
rehive.auth.register({
    first_name: "Joe",
    last_name: "Soap",
    email: "joe@rehive.com",
    company: "rehive",
    password1: "joe1234",
    password2:"joe1234",
    terms_and_conditions:true
}).then(function(user){
    ...
},function(err){
    ...
});
rehive.auth.register(
  first_name="Joe",
  last_name="Soap",
  email="joe@rehive.com",
  company="rehive",
  password1="joe1234",
  password2="joe1234",
  terms_and_conditions=True
)

User registration response

{
    "status": "success"
    "data": {
        "token": "{token}",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": "",
            "id_number": null,
            "birth_date": null,
            "profile": null,
            "currency": null,
            "company": "rehive",
            "language": "en",
            "nationality": "ZA",
            "metadata": {},
            "mobile": "+00000000000",
            "timezone": null,
            "verified": false,
            "verification": {
                "email": true,
                "mobile": true
            },
            "kyc": {
                "updated": 1509539801040,
                "status": "pending"
            },
            "status": "pending",
            "groups": [
                {
                    "name": "test",
                    "label": "Test",
                    "settings": {
                        "allow_transactions": true,
                        "allow_debit_transactions": true,
                        "allow_credit_transactions": true
                    }
                }
            ],
            "permissions": [],
            "created": 1464912953000,
            "updated": 1464912953000,
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}

Register a user with the credentials provided. A successful registration will return the user’s details and a token that can be used for subsequent requests.

Endpoint

https://api.rehive.com/3/auth/register/

Required Fields

Field Description Default
first_name first name null
last_name last name null
email email address null
company company id null
password1 password null
password2 repeat password null

Optional Fields

Field Description Default
terms_and_conditions agreed to terms false
mobile mobile number null
nationality country code null
session_duration session duration 36000000

Login

User login request

curl https://api.rehive.com/3/auth/login/
  -X POST
  -H "Content-Type: application/json"
  -d '{"user": "joe@rehive.com",
       "company": "rehive"
       "password": "joe1234"}'
rehive.auth.login({
    user: "joe@rehive.com",
    company: "rehive",
    password: "joe1234"
}).then(function(user){
    ...
},function(err){
    ...
})
rehive.auth.login(
    user="joe@rehive.com",
    company="rehive",
    password="joe1234"
)

User login response

{
    "status": "success"
    "data": {
        "token": "{token}",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": "",
            "id_number": null,
            "birth_date": null,
            "profile": null,
            "currency": null,
            "company": "rehive",
            "language": "en",
            "nationality": "ZA",
            "metadata": {},
            "mobile": "+00000000000",
            "timezone": null,
            "verified": false,
            "verification": {
                "email": true,
                "mobile": true
            },
            "kyc": {
                "updated": 1509539801040,
                "status": "pending"
            },
            "status": "pending",
            "groups": [
                {
                    "name": "test",
                    "label": "Test",
                    "settings": {
                        "allow_transactions": true,
                        "allow_debit_transactions": true,
                        "allow_credit_transactions": true
                    }
                }
            ],
            "permissions": [],
            "created": 1464912953000,
            "updated": 1464912953000,
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
  "status": "success"
  "data": {
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
  }
}

Login a user with the credentials provided. A successful login will return the user’s details and a token that can be used for subsequent requests.

Endpoint

https://api.rehive.com/3/auth/login/

Required Fields

Field Description Default
user email, mobile number, or unique id null
company company id null
password password null

Optional Fields

Field Description Default
session_duration session duration 36000000

Logout

User logout request

curl https://api.rehive.com/3/auth/logout/
  -X POST
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
rehive.auth.logout().then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.logout()

User logout response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Logs the current user out and invalidates the token that was used to authenticate.

Endpoint

https://api.rehive.com/3/auth/logout/

Logout All

User logout all request

curl https://api.rehive.com/3/auth/logout/all/
  -X POST
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
rehive.auth.logoutAll().then(function(res){
    ...
}, function (err){
    ...
})
rehive.auth.logout_all()

User logout all response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Logs the current user out and invalidates all the tokens related to the user that have expiry dates.

Endpoint

https://api.rehive.com/3/auth/logout/all/

Change Password

User change password request

curl https://api.rehive.com/3/auth/password/change/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"old_password": "joe1234",
       "new_password1": "joe1234",
       "new_password2": "joe1234"}'
rehive.auth.password.change({
    old_password: "joe1234",
    new_password1: "joe1234",
    new_password2: "joe1234"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.password.change(
    old_password="joe1234",
    new_password1="joe1234",
    new_password2="joe1234"
)

User change password response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Change a user’s password.

Endpoint

https://api.rehive.com/3/auth/password/change/

Required Fields

Field Description Default
old_password old password null
new_password1 new password null
new_password2 confirm new password null

Reset Password

User reset password request

curl https://api.rehive.com/3/auth/password/reset/
  -X POST
  -H "Content-Type: application/json"
  -d '{"user": "joe@rehive.com",
       "company": "rehive"}'
rehive.auth.password.reset({
    user: "joe@rehive.com",
    company: "rehive"
}).then(function(res){
    ...
}, function (err) {
    ...
})
rehive.auth.password.reset(
  user="joe@rehive.com",
  company="rehive"
)

User reset password response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Send a password reset email.

Endpoint

https://api.rehive.com/3/auth/password/reset/

Required Fields

Field Description Default
user email, mobile number, or unique id null
company company id null

Reset Password Confirm

User reset password confirm request

curl https://api.rehive.com/3/auth/password/reset/confirm/
  -X POST
  -H "Content-Type: application/json"
  -d '{"new_password1": "joe1234",
       "new_password2": "joe1234",
       "uid": "{uid}",
       "token": "{token}"}'
rehive.auth.password.resetConfirm({
    new_password1: "joe1234",
    new_password2: "joe1234",
    uid: "{uid}",
    token: "{token}"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.password.reset_confirm_password(
  new_password1="joe1234",
  new_password2="joe1234",
  uid="{uid}",
  token="{token}"
)

User reset password confirm response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Reset a password using a reset token and uid. These details are sent in an email by Rehive.

Endpoint

https://api.rehive.com/3/auth/password/reset/confirm/

Required Fields

Field Description Default
new_password1 password null
new_password2 password confirm null
uid unique identifer for reset null
token unique token for reset null

Resend Email Verification

User resend email verification request

curl https://api.rehive.com/3/auth/email/verify/resend/
  -X POST
  -H "Content-Type: application/json"
  -d '{"email": "joe@rehive.com",
       "company": "rehive"}'
rehive.auth.email.resendEmailVerification({
    email: "joe@rehive.com",
    company: "rehive"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.email.resend_email_verification(
  email="joe@rehive.com",
  company="rehive"
)

User resend email verification response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Resend email verifications for an email.

Endpoint

https://api.rehive.com/3/auth/email/verify/resend/

Required Fields

Field Description Default
email email address null
company company id null

Resend Mobile Verification

User resend mobile verification request

curl https://api.rehive.com/3/auth/mobile/verify/resend/
  -X POST
  -H "Content-Type: application/json"
  -d '{"mobile": "+27840000000",
       "company": "rehive"}'
rehive.auth.mobile.resendMobileVerification({
    mobile: "+27840000000",
    company: "rehive"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.mobile.resend_mobile_verification(
  mobile="+27840000000",
  company="rehive"
)

User resend mobile verification response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Resends mobile verifications for a mobile number.

Endpoint

https://api.rehive.com/3/auth/mobile/verify/resend/

Required Fields

Field Description Default
mobile mobile number null
company company id null

Verify Email

User verify email request

curl https://api.rehive.com/3/auth/email/verify/
  -X POST
  -H "Content-Type: application/json"
  -d '{"key": "{key}"}'
rehive.auth.email.verify({
    key: key
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.email.verify(
    key='{key}'
)

User verify email response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Verify an email number with a key. The key is sent in an email by Rehive.

Endpoint

https://api.rehive.com/3/auth/email/verify/

Required Fields

Field Description Default
key verification key null

Verify Mobile

User verify mobile request

curl https://api.rehive.com/3/auth/mobile/verify/
  -X POST
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
  -d '{"otp": "{otp}"}'
rehive.auth.mobile.verify({
    otp: otp
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.verify(
  otp="{otp}"
)

User verify mobile response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Verify a mobile number with an OTP. Unlike the “Verify Email”, the user needs to be logged in for this functionality to work.

Endpoint

https://api.rehive.com/3/auth/mobile/verify/

Required Fields

Field Description Default
otp one time password null

Tokens

The tokens endpoints provide some basic access to managing user and admin tokens. The ability to create infinite lifespan tokens as well as viewing active tokens and deleting unused tokens.

List Tokens

List tokens request

curl https://api.rehive.com/3/auth/tokens/
  -X GET
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
rehive.auth.tokens.get().then(function(res){
    ...
},function(err){
    ...
});
rehive.auth.tokens.get()

List user tokens response

{
  "status": "success",
  "data": [
    {
      "token_key": "00000000",
      "expires": null
    }
  ]
}
    [
        {
          "expires": null,
          "token_key": "00000000"
        },
        {
          "expires": "2001-01-01T01:01:01.000001Z",
          "token_key": "00000000",
        },
        {
          "expires": "2001-01-01T01:01:01.000002Z",
          "token_key": "00000000",
        }
    ]
[
  {
    "token_key": "00000000",
    "expires": null
  }
]

Retrieve a list of the current active tokens for the authenticated user. Notice that only the token_key is exposed here and not the whole token, in case user tokens need to be managed on the client side.

Create Token

Create token request

curl https://api.rehive.com/3/auth/tokens/
  -X POST
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
  -D "{"password": "joe1234"}"
rehive.auth.tokens.create({
    password: "joe12345"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.tokens.create(
  password="joe1234"
)

Create token response

{
    "status": "success"
    "data": {
        "token": "{token}",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": "",
            "id_number": null,
            "birth_date": null,
            "profile": null,
            "currency": null,
            "company": "rehive",
            "language": "en",
            "nationality": "ZA",
            "metadata": {},
            "mobile": "+00000000000",
            "timezone": null,
            "verified": false,
            "verification": {
                "email": true,
                "mobile": true
            },
            "kyc": {
                "updated": 1509539801040,
                "status": "pending"
            },
            "status": "pending",
            "groups": [
                {
                    "name": "test",
                    "label": "Test",
                    "settings": {
                        "allow_transactions": true,
                        "allow_debit_transactions": true,
                        "allow_credit_transactions": true
                    }
                }
            ],
            "permissions": [],
            "created": 1464912953000,
            "updated": 1464912953000,
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
    "token": "{token}",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}

Creating a token here will remove the expiration time on the token, thus giving it an infinite lifespan.

Endpoint

https://api.rehive.com/3/auth/tokens/

Required Fields

Field Description Default
password password null

Delete Token

Delete token request

curl https://api.rehive.com/3/auth/tokens/{token_key}/
  -X DELETE
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
rehive.auth.tokens.delete("token_key").then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.tokens.delete("{token_key}")

Delete token response

{
  "status": "success"
}
{}
{
  "status": "success"
}

Endpoint

https://api.rehive.com/3/auth/tokens/{token_key}/

Verify Token

Verify token request

curl https://api.rehive.com/3/auth/tokens/verify/
  -X POST
  -H "Content-Type: application/json"
  -H "Authorization: Token {token}"
  -D "{"token": "{token}"}"
rehive.auth.tokens.verify("token_key").then(function(res){
    ...
},function(err){
    ...
})
rehive.auth.tokens.verify("{token_key}")

Verify token response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": "",
    "id_number": null,
    "birth_date": null,
    "profile": null,
    "currency": null,
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": {},
    "mobile": "+00000000000",
    "timezone": null,
    "verified": false,
    "verification": {
        "email": true,
        "mobile": true
    },
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [
        {
            "name": "test",
            "label": "Test",
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    ],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "status": "success",
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}

Endpoint

https://api.rehive.com/3/auth/tokens/verify/

Multi-factor Authentication

Rehive allows for the use of token-based or sms-otp based multi-factor authentication, both of which can be fully managed and utilised by the API.

Multi-factor Status

Status request

curl https://api.rehive.com/3/auth/mfa/
  -X GET
  -H "Content-Type: application/json"
rehive.auth.mfa.status.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.get()

Status response

  {
    "status": "success"
    "data": {
        "sms": false,
        "token": false
    }
  }
{
  "sms":false,
  "token":false
}
{
    "sms": false,
    "token": false
}

Provides the statuses for SMS and Token bases authentication. When successfully enabled, the respective type will be true.

Endpoint

https://api.rehive.com/3/auth/mfa/

View SMS Authentication

SMS request

curl https://api.rehive.com/3/auth/mfa/sms/
  -X GET
  -H "Content-Type: application/json"
rehive.auth.mfa.sms.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.sms.get()

SMS response

  {
    "status": "success"
    "data": {
        "mobile": "+27000000000",
        "confirmed": true
      }
    }
  }
{
    "mobile": "+27000000000",
    "confirmed": false
}
{
  "mobile": "+27000000000",
  "confirmed": true
}

Endpoint

https://api.rehive.com/3/auth/mfa/sms/

Enable SMS Authentication

SMS request

curl https://api.rehive.com/3/auth/mfa/sms/
  -X POST
  -H "Content-Type: application/json"
  -D '{"mobile": "+27000000000"}'
rehive.auth.mfa.sms.enable({
    mobile: mobile_no
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.authorize_number(
  mobile="+27000000000"
)

SMS response

  {
    "status": "success"
    "data": {
        "mobile": "+27000000000",
        "confirmed": false
      },
    }
  }
{
  "mobile": "+27000000000",
  "confirmed": false
}
{
  "mobile": "+27000000000",
  "confirmed": false
}

By posting to this endpoint you are starting the verification process for enabling SMS authentication. At this point an OTP will be sent to the mobile number that was posted. Use this OTP to verify the mobile number at the Verify endpoint.

Endpoint

https://api.rehive.com/3/auth/mfa/sms/send/

Required Fields

Field Description Default
mobile Mobile Number null

Disable SMS Authentication

Disable SMS request

curl https://api.rehive.com/3/auth/mfa/sms/
  -X DELETE
  -H "Content-Type: application/json"
rehive.auth.mfa.sms.disable().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.sms.disable()

Disable SMS response

  {
    "status": "success"
  }
{}
 {
    "status": "success"
  }

Endpoint

https://api.rehive.com/3/auth/mfa/sms/

Send SMS

Send SMS request

curl https://api.rehive.com/3/auth/mfa/sms/send/
  -X POST
  -H "Content-Type: application/json"
rehive.auth.mfa.sms.send().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.send_sms(
  mobile="+27000000000"
)

Send SMS response

{
   "status": "success"
}
{}
{
   "status": "success"
}

Sends an OTP to the mobile number that was used to enabled SMS based multi-factor authentication.

Endpoint

https://api.rehive.com/3/auth/mfa/sms/

Required Fields

Field Description Default
mobile Mobile Number null

View Token Authentication

Token request

curl https://api.rehive.com/3/auth/mfa/token/
  -X GET
  -H "Content-Type: application/json"
rehive.auth.mfa.token.get().then(function (res) {
     ...
}, function (err) {
     ...
});
rehive.auth.mfa.token.get()

Token response

  {
    "status": "success"
    "data": {
        "otpauth_url": "otpauth://totp/Rehive1%3A%20joe%40rehive.com?secret=00000000000000000000000000000000&digits=6&issuer=Rehive",
        "issuer": "Rehive",
        "account": "joe@rehive.com",
        "key": "00000000000000000000000000000000",
        "confirmed": false
    }
  }
{
    "otpauth_url": "otpauth://totp/Rehive1%3A%20joe%40rehive.com?secret=00000000000000000000000000000000&digits=6&issuer=Rehive",
    "issuer": "Rehive",
    "account": "joe@rehive.com",
    "key": "00000000000000000000000000000000",
    "confirmed": false
}
{
    "otpauth_url": "otpauth://totp/Rehive1%3A%20joe%40rehive.com?secret=00000000000000000000000000000000&digits=6&issuer=Rehive",
    "issuer": "Rehive",
    "account": "joe@rehive.com",
    "key": "00000000000000000000000000000000",
    "confirmed": false
}

Endpoint

https://api.rehive.com/3/auth/mfa/token/

Enable Token Authentication

Token request

curl https://api.rehive.com/3/auth/mfa/token/
  -X POST
  -H "Content-Type: application/json"
rehive.auth.mfa.token.enable().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.authorize_token()

Token response

  {
    "status": "success"
    "data": {
        "otpauth_url": "otpauth://totp/Rehive1%3A%20joe%40rehive.com?secret=00000000000000000000000000000000&digits=6&issuer=Rehive",
        "issuer": "Rehive",
        "account": "joe@rehive.com",
        "key": "00000000000000000000000000000000"
    }
  }
{
    "otpauth_url": "otpauth://totp/Rehive1%3A%20joe%40rehive.com?secret=00000000000000000000000000000000&digits=6&issuer=Rehive",
    "issuer": "Rehive",
    "account": "joe@rehive.com",
    "key": "00000000000000000000000000000000"
}
{
    "otpauth_url": "otpauth://totp/Rehive1%3A%20joe%40rehive.com?secret=00000000000000000000000000000000&digits=6&issuer=Rehive",
    "issuer": "Rehive",
    "account": "joe@rehive.com",
    "key": "00000000000000000000000000000000"
}

By posting to this endpoint you are starting the verification process for enabling token based authentication. The response contains data that can be used with apps such as Google Authenticator. Use the otpauth_url to generate a QR code. For more information on how to generate a QR code, check out the Google Charts API. The rest of the data can be used for manual entry into the app. Use the token OTP generated by the app to finalise the verification process at the Verify endpoint.

Endpoint

https://api.rehive.com/3/auth/mfa/token/

Response Fields

Field Description
otpauth_url url used for QR generation
issuer The company name in Rehive
account The user email address enabling multi-factor authentication
key Secret key

Disable Token Authentication

Disable Token request

curl https://api.rehive.com/3/auth/mfa/token/
  -X DELETE
  -H "Content-Type: application/json"
rehive.auth.mfa.token.disable().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.auth.mfa.token.disable()

Disable Token response

  {
    "status": "success"
  }
{}
 {
    "status": "success"
  }

Endpoint

https://api.rehive.com/3/auth/mfa/token/

Verify Multi-factor Authentication

Verify request

curl https://api.rehive.com/3/auth/mfa/verify/
  -X POST
  -H "Content-Type: application/json"
  -D '{"token": "123456"}'
rehive.auth.mfa.verify({
    token: token
}).then(function (res) {
    ...
}, function (err) {
    ...
})
rehive.auth.mfa.verify(
  token="123456"
)

Verify response

  {
    "status": "success"
  }
{}
{
  "status": "success"
}

This endpoint finalises the verification process for multi-factor authentication. Once you successfully verify the SMS OTP or the token OTP, your multi-factor authentication will now be enabled.

Endpoint

https://api.rehive.com/3/auth/mfa/verify/

Required Fields

Field Description Default
token Token or SMS OTP null

Users

All non authentication access on the Rehive API is made by registered users. This is true of the orginal company owner as well as all subsequent users (whether granted admin permissions or not). The user endpoints provide a means to add, alter and view additional user information.

Retrieve Profile

User profile request

curl https://api.rehive.com/3/user/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.get().then(function(user){
    ...
},function(err){
    ...
})
rehive.user.get()

User profile response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": "",
    "id_number": null,
    "birth_date": null,
    "profile": null,
    "currency": null,
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": {},
    "mobile": "+00000000000",
    "timezone": null,
    "verified": false,
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [
        {
            "name": "test",
            "label": "Test",
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    ],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": "",
    "id_number": null,
    "birth_date": null,
    "profile": null,
    "currency": null,
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": {},
    "mobile": "+00000000000",
    "timezone": null,
    "verified": false,
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [
        {
            "name": "test",
            "label": "Test",
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    ],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}

Retrieve a user’s profile information.

Endpoint

https://api.rehive.com/3/user/

Update Profile

User update profile request

curl https://api.rehive.com/3/user/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"first_name": "Joe"}'
rehive.user.update({first_name: "Joe"}).then(function (user) {
    ...
}, function (err) {
    ...
});
rehive.user.update(
    first_name="Joe"
)

User update profile response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": "",
        "id_number": null,
        "birth_date": null,
        "profile": null,
        "currency": null,
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": {},
        "mobile": "+00000000000",
        "timezone": null,
        "verified": false,
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [
            {
                "name": "test",
                "label": "Test",
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                }
            }
        ],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        }
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": "",
    "id_number": null,
    "birth_date": null,
    "profile": null,
    "currency": null,
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": {},
    "mobile": "+00000000000",
    "timezone": null,
    "verified": false,
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [
        {
            "name": "test",
            "label": "Test",
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    ],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": "",
    "id_number": null,
    "birth_date": null,
    "profile": null,
    "currency": null,
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": {},
    "mobile": "+00000000000",
    "timezone": null,
    "verified": false,
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [
        {
            "name": "test",
            "label": "Test",
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
        }
    ],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}

Update a user’s profile information.

Endpoint

https://api.rehive.com/3/user/

Optional Fields

Field Description Default
first_name first name blank
last_name last name blank
id_number ID number blank
profile profile image blank
language language code (af, en etc.) blank
nationality nationality code (ZA, UK etc.) blank
metadata custom metadata {}
mobile mobile number blank
timezone timezone blank
birth_date birth date blank

List Addresses

User list addresses request

curl https://api.rehive.com/3/user/addresses/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

User list addresses response

{
    "status": "success",
    "data": [
        {
            "line_1": "1 Main Street",
            "line_2": "East City",
            "city": "Cape Town",
            "state_province": "Western Cape",
            "country": "ZA",
            "postal_code": "8001",
            "status": "pending",
            "created": 1516281408895,
            "updated": 1528454842365
        }
    ]
}

List a user’s addresses.

Endpoint

https://api.rehive.com/3/user/addresses/

Create Address

User create address request

curl https://api.rehive.com/3/user/addresses/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"}'

User create address response

{
    "status": "success",
    "data": {
        "line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}

Create an address for a user.

Endpoint

https://api.rehive.com/3/user/addresses/

Optional Fields

Field Description Default
line_1 Address line one null
line_2 Address line two null
city City null
state_province State or province null
country country code null
postal_code Zip or postal code null

Retrieve Address

User retrieve address request

curl https://api.rehive.com/3/user/addresses/{address_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

User retrieve address response

{
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001",
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}

Retrieve a user’s address.

Endpoint

https://api.rehive.com/3/user/addresses/{address_id}/

Update Address

User update address request

curl https://api.rehive.com/3/user/addresses/{address_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"city": "Cape Town"}'

User update address response

{
    "status": "success",
    "data": {
        "line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}

Update a user’s address.

Endpoint

https://api.rehive.com/3/user/addresses/{address_id}/

Optional Fields

Field Description Default
line_1 address line one blank
line_2 address line 2 blank
city city blank
state_province state or province blank
country country code blank
postal_code postal or zip code) blank

List Bank Accounts

User list bank accounts request

curl https://api.rehive.com/3/user/bank-accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.bankAccounts.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.bank_accounts.get()

User list bank accounts response

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "name": "Default",
            "number": "9999999999",
            "type": "Cheque",
            "bank_name": "Central Bank",
            "bank_code": "0000",
            "branch_code": "0000",
            "swift": "",
            "iban": "",
            "bic": "",
            "code": "bank_account_VEM7k1y5hnuF",
            "status": "pending",
            "created": 1516281408895,
            "updated": 1528454842365
        }
    ]
}
[
    {
        "id": 1,
        "name": "Default",
        "number": "9999999999",
        "type": "Cheque",
        "bank_name": "Central Bank",
        "bank_code": "0000",
        "branch_code": "0000",
        "swift": "",
        "iban": "",
        "bic": "",
        "code": "bank_account_VEM7k1y5hnuF",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
]

[
    {
        "id": 1,
        "name": "Default",
        "number": "9999999999",
        "type": "Cheque",
        "bank_name": "Central Bank",
        "bank_code": "0000",
        "branch_code": "0000",
        "swift": "",
        "iban": "",
        "bic": "",
        "code": "bank_account_VEM7k1y5hnuF",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
]

List a user’s bank accounts.

Endpoint

https://api.rehive.com/3/user/bank-accounts/

Create Bank Account

User create bank account request

curl https://api.rehive.com/3/user/bank-accounts/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"name": "Bank",
       "number": "000000000000000",
       "type": "Cheque",
       "bank_name": "Bank Ltd.",
       "branch_code": "0000"}'
rehive.user.bankAccounts.create(
{
    name: "Bank",
    number: "000000000000000",
    type: "Cheque",
    bank_name: "Bank Ltd.",
    branch_code: "0000"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.bank_account.create(
    name="Bank",
    number="000000000000000",
    type="Cheque",
    bank_name="Bank Ltd.",
    branch_code="0000"
)

User create bank account response

{
    "status": "success",
    "data": {
        "id": 1,
        "name": "Bank",
        "number": "000000000000000",
        "type": "Cheque",
        "bank_name": "Bank Ltd.",
        "bank_code": null,
        "branch_code": "0000",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 1,
    "name": "Bank",
    "number": "000000000000000",
    "type": "Cheque",
    "bank_name": "Bank Ltd.",
    "bank_code": null,
    "branch_code": "0000",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 1,
    "name": "Bank",
    "number": "000000000000000",
    "type": "Cheque",
    "bank_name": "Bank Ltd.",
    "bank_code": null,
    "branch_code": "0000",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}

Create a bank account for a user.

Endpoint

https://api.rehive.com/3/user/bank-accounts/

Optional Fields

Field Description Default
name account name null
number account number null
type account type null
bank_name bank name null
bank_code bank code null
branch_code branch code null
swift swift number null
iban IBAN number null
bic BIC number null

Retrieve Bank Account

User retrieve bank account request

curl https://api.rehive.com/3/user/bank-accounts/{account_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.bankAccounts.get(accountId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.bank_accounts.get(
    {account_id}
)

User retrieve bank account response

{
    "status": "success",
    "data": {
        "id": {account_id},
        "name": "Bank",
        "number": "000000000000000",
        "type": "Cheque",
        "bank_name": "Bank Ltd.",
        "bank_code": null,
        "branch_code": "0000",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": {account_id},
    "name": "Bank",
    "number": "000000000000000",
    "type": "Cheque",
    "bank_name": "Bank Ltd.",
    "bank_code": null,
    "branch_code": "0000",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": {account_id},
    "name": "Bank",
    "number": "000000000000000",
    "type": "Cheque",
    "bank_name": "Bank Ltd.",
    "bank_code": null,
    "branch_code": "0000",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending"
}

Retrieve a user’s bank account.

Endpoint

https://api.rehive.com/3/user/bank-accounts/{account_id}/

Update Bank Account

User update bank account request

curl https://api.rehive.com/3/user/bank-accounts/{account_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"name": "Bank"}'
rehive.user.bankAccounts.update(accountId,{name: "Bank"}).then(function(res){
    ...
},function(err){
    ...
})
rehive.user.bank_accounts.update(
    {account_id},
    name="Bank"
)

User update bank account response

{
    "status": "success",
    "data": {
        "id": {account_id},
        "name": "Bank",
        "number": "000000000000000",
        "type": "Cheque",
        "bank_name": "Bank Ltd.",
        "bank_code": null,
        "branch_code": "0000",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": {account_id},
    "name": "Bank",
    "number": "000000000000000",
    "type": "Cheque",
    "bank_name": "Bank Ltd.",
    "bank_code": null,
    "branch_code": "0000",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": {account_id},
    "name": "Bank",
    "number": "000000000000000",
    "type": "Cheque",
    "bank_name": "Bank Ltd.",
    "bank_code": null,
    "branch_code": "0000",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}

Update a user’s bank account.

Endpoint

https://api.rehive.com/3/user/bank-accounts/{account_id}/

Optional Fields

Field Description Default
name account name null
number account number null
type account type null
bank_name bank name null
bank_code bank code null
branch_code branch code null
swift swift number null
iban IBAN number null
bic BIC number null

Delete Bank Account

User delete bank account request

curl https://api.rehive.com/3/user/bank-accounts/{account_id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.bankAccounts.delete(accountId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.bank_accounts.delete(
   {account_id}
)

User delete bank account response

{
    "status": "success"
}
{}
{
    "status": "success"
}

Delete a user’s bank account.

Endpoint

https://api.rehive.com/3/user/bank-accounts/{account_id}/

List Crypto Accounts

User list crypto accounts request

curl https://api.rehive.com/3/user/crypto-accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.cryptoAccounts.get().then(function (res) {
    ...
}, function (err) {
    ...
})
rehive.user.crypto_accounts.get()

User list crypto accounts response

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "address": "0000000000000000000000000000000000",
            "code": "crypto_account_000000000000",
            "crypto_type": "bitcoin",
            "metadata": {},
            "status": "pending",
            "created": 1516281408895,
            "updated": 1528454842365
        }
    ]
}
[
    {
        "id": 1,
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
]
[
    {
        "id": 1,
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
]

List a user’s cryptocurrency addresses.

Endpoint

https://api.rehive.com/3/user/crypto-accounts/

Create Crypto Account

User create crypto account request

curl https://api.rehive.com/3/user/crypto-accounts/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"address": "0000000000000000000000000000000000"}'
rehive.user.cryptoAccounts.create({
    address: "0000000000000000000000000000000000",
    crypto_type: "bitcoin"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.crypto_accounts.create(
    address="0000000000000000000000000000000000",
    crypto_type="bitcoin"
)

User create crypto account response

{
    "status": "success",
    "data": {
        "id": 1,
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 1,
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 1,
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}

Create a crypto account for a user.

Endpoint

https://api.rehive.com/3/user/crypto-accounts/

Required Fields

Field Description Default
address full bitcoin address null

Optional Fields

Field Description Default
crypto_type string type (bitcoin, ethereum, other) bitcoin
metadata custom metadata {}

Retrieve Crypto Account

User retrieve crypto account request

curl https://api.rehive.com/3/user/crypto-accounts/{account_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.cryptoAccounts.get(accountId).then(function (res) {
    ...
}, function (err) {
    ...
})
rehive.user.crypto_accounts.get(
    {account_id}
)

User retrieve crypto account response

{
    "status": "success",
    "data": {
        "id": {account_id},
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 1,
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": {account_id},
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}

Get a user’s crypto account.

Endpoint

https://api.rehive.com/3/user/crypto-accounts/{account_id}/

Update Crypto Account

User update crypto account request

curl https://api.rehive.com/3/user/crypto-accounts/{account_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"address": "0000000000000000000000000000000000"}'
rehive.user.cryptoAccounts.update(accountId, {address: "0000000000000000000000000000000000"}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.crypto_accounts.update(
    address="0000000000000000000000000000000000"
)

User update crypto account response

{
    "status": "success",
    "data": {
        "id": {account_id},
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": {account_id},
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": {account_id},
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "created": 1516281408895,
    "updated": 1528454842365
}

Update a user’s crypto account.

Endpoint

https://api.rehive.com/3/user/crypto-accounts/{account_id}/

Required Fields

Field Description Default
address full bitcoin address null

Optional Fields

Field Description Default
crypto_type string type (bitcoin, ethereum, other) bitcoin
metadata custom metadata {}
status string status ‘pending’

Delete Crypto Account

User delete crypto account request

curl https://api.rehive.com/3/user/crypto-accounts/{account_id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.cryptoAccounts.delete(accountId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.crypto_accounts.delete(
   {account_id}
)

User delete crypto account response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Delete a user’s crypto account.

Endpoint

https://api.rehive.com/3/user/crypto-accounts/{account_id}/

List Documents

User list documents request

curl https://api.rehive.com/3/user/documents/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.documents.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.documents.get()

User list documents response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": 0,
                "file": "https://url.to/file.pdf",
                "document_category": "other",
                "document_type": "other",
                "metadata": {},
                "status": "pending",
                "note": null,
                "created": 1516281408895,
                "updated": 1528454842365
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 0,
            "file": "https://url.to/file.pdf",
            "document_category": "other",
            "document_type": "other",
            "metadata": {},
            "status": "pending",
            "note": null,
            "created": 1516281408895,
            "updated": 1528454842365
        }
    ]
}
[
    {
        "id": 0,
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "pending",
        "note": null,
        "created": 1516281408895,
        "updated": 1528454842365
    }
]

Get a list of user’s documents.

Endpoint

https://api.rehive.com/3/user/documents/

Retrieve Document

User retrieve document request

curl https://api.rehive.com/3/user/documents/{document_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.documents.get({id: documentId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.documents.get(
    {document_id}
)

User retrieve document response

{
    "status": "success",
    "data": {
        "id": 0,
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "pending",
        "note": null,
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 0,
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 0,
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "created": 1516281408895,
    "updated": 1528454842365
}

Get a user’s document.

Endpoint

https://api.rehive.com/3/user/documents/{document_id}/

Create Document

User create document request

curl https://api.rehive.com/3/user/document/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: multipart/form-data"
  -F file=@localfilename
var fileSelected = document.getElementById("fileInput").files[0],
    formData = new FormData;

formData.append('file', fileSelected);
formData.append('document_type', document_type);
formData.append('metadata', JSON.stringify(metadata));

rehive.user.documents.create(formData).then(function (res) {
    ...
}, function (err) {
    ...
});
# Note: The file argument should be the full path of the file
rehive.user.documents.upload(
    document_type='other',
    file=file
)

User create document response

{
    "status": "success",
    "data": {
        "id": 0,
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "pending",
        "note": null,
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 0,
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 0,
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "created": 1516281408895,
    "updated": 1528454842365
}

Upload a user document.

Endpoint

https://api.rehive.com/3/user/document/

Required Fields

Field Description Default
file a document file null

Optional Fields

Field Description Default
document_category The document category other
document_type The type of docuemnt other
metadata custom metadata {}

List Email Addresses

User list email addresses request

curl https://api.rehive.com/3/user/emails/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.emails.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.emails.get()

User list email addresses response

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "email": "joe@rehive.com",
            "primary": true,
            "verified": true
        }
    ]
}
[
    {
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
]
[
    {
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
]

Get a list of user’s email addresses.

Endpoint

https://api.rehive.com/3/user/emails/

Create Email Address

User create email address request

curl https://api.rehive.com/3/user/emails/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"email": "joe@rehive.com",
       "primary": true}'
rehive.user.emails.create(
{
    email: "joe@rehive.com",
    primary: true
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.email.create(
    email="joe@rehive.com"
)

User create email address response

{
    "status": "success",
    "data": {
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
}
{
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}
{
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}

Create an email address for a user.

Endpoint

https://api.rehive.com/3/user/emails/

Required Fields

Field Description Default
email email address null

Optional Fields

Field Description Default
primary is a primary user email false

Retrieve Email Address

User retrieve email address request

curl https://api.rehive.com/3/user/emails/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.emails.get(emailId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.emails.get("{email_id}")

User retrieve email address response

{
    "status": "success",
    "data": {
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
}
{
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}
{
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}

Endpoint

https://api.rehive.com/3/user/emails/{id}/

Update Email Address

User update email address request

curl https://api.rehive.com/3/user/emails/{email_id}
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"primary": true}'
rehive.user.emails.update(emailId, {primary: true}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.emails.update(
    '{email_id}',
    primary=True
)

# Quick method for setting primary
rehive.user.emails.make_primary(
   "{email_id}"
)

User update email address response

{
    "status": "success",
    "data": {
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
}
{
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}
{
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}

Update a user’s email address. The email address can be changed to be the user’s primary email address. The actual address cannot be updated and a new one should instead be created.

Endpoint

https://api.rehive.com/3/user/emails/{email_id}

Optional Fields

Field Description Default
primary is a primary user email false

Delete Email Address

User delete email address request

curl https://api.rehive.com/3/user/emails/{id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.emails.delete(emailId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.emails.delete(
    {id}
)

User delete email address response

{
    "status": "success"
}
{}
{
    "status": "success"
}

Endpoint

https://api.rehive.com/3/user/emails/{id}/

List Mobile Numbers

User mobile numbers request

curl https://api.rehive.com/3/user/mobiles/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.mobiles.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.mobiles.get()

User mobile numbers response

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "number": "+00000000000",
            "primary": true,
            "verified": true,
            "created": 1516281408895,
            "updated": 1528454842365
        }
    ]
}
[
    {
        "id": 1,
        "number": "+00000000000",
        "primary": true,
        "verified": true,
        "created": 1516281408895,
        "updated": 1528454842365
    }
]
[
    {
        "id": 1,
        "number": "+00000000000",
        "primary": true,
        "verified": true,
        "created": 1516281408895,
        "updated": 1528454842365
    }
]

Get a list of user’s mobile numbers.

Endpoint

https://api.rehive.com/3/user/mobiles/

Create Mobile Number

User create mobile number request

curl https://api.rehive.com/3/user/mobiles/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"number": "+00000000000",
       "primary": true}'
rehive.user.mobiles.create({
    number: "+00000000000",
    primary: true
}).then(function (res) {
    ...
}, function (err) {
    ...
})
rehive.user.mobiles.create(
    number="+00000000000"
)

User create mobile number response

{
    "status": "success",
    "data": {
        "id": 1,
        "number": "+00000000000",
        "primary": true,
        "verified": true,
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 1,
    "number": "+00000000000",
    "primary": true,
    "verified": true,
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 1,
    "number": "+00000000000",
    "primary": true,
    "verified": true,
    "created": 1516281408895,
    "updated": 1528454842365
}

Create a mobile number for a user.

Endpoint

https://api.rehive.com/3/user/mobiles/

Required Fields

Field Description Default
number mobile number address (including area code) null

Optional Fields

Field Description Default
primary is a primary user number false

Retrieve Mobile Numbers

User retrieve mobile number request

curl https://api.rehive.com/3/user/mobiles/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.mobiles.get(numberId).then(function(res){
    ...
},function(err){
    ...
})
rehive.user.mobiles.get("{number_id}")

User mobile numbers response

{
    "status": "success",
    "data": {
        "id": 1,
        "number": "+00000000000",
        "primary": true,
        "verified": true,
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 1,
    "number": "+00000000000",
    "primary": true,
    "verified": true,
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 1,
    "number": "+00000000000",
    "primary": true,
    "verified": true,
    "created": 1516281408895,
    "updated": 1528454842365
}

Retrieve a user’s mobile number.

Endpoint

https://api.rehive.com/3/user/mobiles/

Update Mobile Number

User update mobile number request

curl https://api.rehive.com/3/user/mobiles/{number_id}
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"primary": true}'
rehive.user.mobiles.update(numberId, data).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.mobiles.update(
    "{number_id}",
    primary=True
)

# Quick method for setting primary
rehive.user.mobiles.make_primary(
   "{number_id}"
)

User update mobile number response

{
    "status": "success",
    "data": {
        "id": 1,
        "number": "+00000000000",
        "primary": true,
        "verified": true,
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": 1,
    "number": "+00000000000",
    "primary": true,
    "verified": true,
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": 1,
    "number": "+00000000000",
    "primary": true,
    "verified": true,
    "created": 1516281408895,
    "updated": 1528454842365
}

Update a user’s mobile number. The number can be changed to be the user’s primary mobile number. The actual number cannot be updated and a new one should be created instead.

Endpoint

https://api.rehive.com/3/user/mobiles/{number_id}

Optional Fields

Field Description Default
primary is a primary user email false

Delete Mobile Number

User delete mobile number request

curl https://api.rehive.com/3/user/mobiles/{id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.user.mobiles.delete(numberId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.user.mobiles.delete(
    {id}
)

User delete mobile number response

{
    "status": "success"
}
{}
{
    "status": "success"
}

Endpoint

https://api.rehive.com/3/user/mobiles/{id}/

Transactions

Rehive offers 2 standard transaction types: debit and credit. Debit transactiosn deduct from a user’s account and credit transaction add to a user’s account. There is also an additional “transfer” endpoint that can be used in order to automtically trigger a debit followed by a credit on the specified accounts.

List Transactions

User transactions request

curl https://api.rehive.com/3/transactions/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
var filters = {
    tx_type: "credit",
    currency:'ZAR'
};

rehive.transactions.get({filters: filters}).then(function(res){
    ...
},function(err){
    ...
})
# Filters are not required
filters = {
    "tx_type": "credit",
    "currency": "ZAR"
}

rehive.transactions.get(
    filters=filters
)

User transactions response

 {
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": "000000000000000000000",
                "tx_type": "credit",
                "subtype": null,
                "note": "",
                "metadata": {},
                "status": "Pending",
                "reference": "",
                "amount": 500,
                "fee": 0,
                "balance": 0,
                "account": "0000000000",
                "label": "Credit",
                "company": "rehive",
                "total_amount":100,
                "currency": {
                    "description": "Rand",
                    "code": "ZAR",
                    "symbol": "R",
                    "unit": "rand",
                    "divisibility": 2
                },
                "source_transaction": null,
                "destination_transaction": null,
                "created": 1496135465218,
                "updated": 1496135465287
            }
        ]
    }
}
 {
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "000000000000000000000",
            "tx_type": "credit",
            "subtype": null,
            "note": "",
            "metadata": {},
            "status": "Pending",
            "reference": "",
            "amount": 500,
            "fee": 0,
            "balance": 0,
            "account": "0000000000",
            "label": "Credit",
            "company": "rehive",
            "total_amount":100,
            "currency": {
                "description": "Rand",
                "code": "ZAR",
                "symbol": "R",
                "unit": "rand",
                "divisibility": 2
            },
            "source_transaction": null,
            "destination_transaction": null,
            "created": 1496135465218,
            "updated": 1496135465287
        }
    ]
 }
 [
    {
        "id": "000000000000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": "",
        "amount": 500,
        "fee": 0,
        "balance": 0,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "total_amount":100,
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "source_transaction": null,
        "destination_transaction": null,
        "created": 1496135465218,
        "updated": 1496135465287
    }
]

Get a a user’s transaction list.

Filtering

Field Type
id string
tx_type boolean
subtype string
status string
account string
source_transaction boolean
destination_transaction boolean
created millsecond timestamp
updated millsecond timestamp
metadata any

Endpoint

https://api.rehive.com/3/transactions/

Total Transactions

User total transactions request

curl https://api.rehive.com/3/transactions/totals/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

rehive.transactions.totals.get().then(function(res){
    ...
},function(err){
    ...
})
rehive.transactions.get_totals()

User total transactions response

{
    "status": "success",
    "data": {
        "amount": 500,
        "fees": 0,
        "count": 1,
        "currency": "ZAR"
    }
}
{
    "amount": 1000,
    "count": 2,
    "currency": "ZAR",
    "fees": 0
}
{
    "amount": 500,
    "fees": 0,
    "count": 1,
    "currency": "ZAR"
}

Get a user’s total transaction details. This is a summary of transaction details like: amount totals, fee totals, and the total number of transactions.

Filtering

See Transaction List filtering above.

Create Credit

User credit request

curl https://api.rehive.com/3/transactions/credit/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"amount": 500, "currency": "ZAR"}'
rehive.transactions.createCredit(
{
    amount: 500,
    currency: "ZAR"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.transactions.create_credit(
    amount=500,
    currency="ZAR"
)

User credit response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": null,
        "amount": 500,
        "fee": 0,
        "total_amount": 500,
        "balance": 0,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}

Create a credit transaction.

Endpoint

https://api.rehive.com/3/transactions/credit/

Required Fields

Field Description Default
amount amount null
currency currency code null

Optional Fields

Field Description Default
reference optional credit reference blank
subtype a custom defined subtype null
account account reference code null
note user’s note or message blank
metadata custom metadata {}

Create Debit

User debit request

curl https://api.rehive.com/3/transactions/debit/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"amount": 500, "currency": "ZAR"}'
rehive.transactions.createDebit(
{
    amount: 500,
    currency: "ZAR"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.transactions.create_debit(
    amount=500,
    currency="ZAR"
)

User debit response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "tx_type": "debit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": null,
        "amount": -500,
        "fee": 0,
        "total_amount": -500,
        "balance": 0,
        "account": "0000000000",
        "label": "Debit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}

Create a debit transaction.

Endpoint

https://api.rehive.com/3/transactions/debit/

Required Fields

Field Description Default
amount amount null
currency currency code null

Optional Fields

Field Description Default
reference optional debit reference blank
subtype a custom defined subtype null
account account reference code null
note user’s note or message blank
metadata custom metadata {}

Create Transfer

User transfer request

curl https://api.rehive.com/3/transactions/transfer/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"amount": 500,
       "currency": "ZAR",
       "recipient": "susan@rehive.com"}'
rehive.transactions.createTransfer(
{
    amount: 500,
    recipient: "susan@rehive.com"
}).then(function(res){
    ...
},function(err){
    ...
})
rehive.transactions.create_transfer(
    amount=500,
    recipient="susan@rehive.com"
)

User transfer response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "tx_type": "debit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Complete",
        "reference": null,
        "amount": -500,
        "fee": 0,
        "total_amount": -500,
        "balance": 0,
        "account": "0000000000",
        "label": "Debit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "source_transaction": null,
        "destination_transaction": {
            "id": "00000000-0000-0000-0000-000000000000",
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Susan",
                "last_name": "Brown",
                "email": "susan@rehive.com",
                "username": "",
                "mobile": "+27850000000",
                "profile": null
            }
        },
        "messages": [],
        "fees": [],
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Complete",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": {
        "id": "00000000-0000-0000-0000-000000000000",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Susan",
            "last_name": "Brown",
            "email": "susan@rehive.com",
            "username": "",
            "mobile": "+27850000000",
            "profile": null
        }
    },
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Complete",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": {
        "id": "00000000-0000-0000-0000-000000000000",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Susan",
            "last_name": "Brown",
            "email": "susan@rehive.com",
            "username": "",
            "mobile": "+27850000000",
            "profile": null
        }
    },
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}

Create a transfer transaction. This will transfer currency from one user/account to another. If the recipient reference does not exist as a user in Rehive and the reference is an email address or mobile number then an invitation message will be sent to the recipient informing them thay have an unclaimed transaction.

Endpoint

https://api.rehive.com/3/transactions/transfer/

Required Fields

Required Fields

Field Description Default
amount amount null
  • recipient
  • and/or
  • credit_account
  • email, mobile number, or unique id
  • account reference code
null
currency currency code null

Optional Fields

Field Description Default
debit_subtype a custom defined subtype null
debit_account account reference code null
debit_note user’s note or message blank
debit_metadata custom metadata {}
debit_reference optional debit reference string
credit_subtype a custom defined subtype null
credit_account account reference code null
credit_note user’s note or message blank
credit_metadata custom metadata {}
credit_reference optional credit reference string

Retrieve Transaction

Retrieve transaction request

curl https://api.rehive.com/3/transactions/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.transactions.get({id: transactionId}).then(function(res){
    ...
},function(err){
    ...
})
rehive.transactions.get(
   "{id}"
)

Retrieve transaction response

{
    "status": "success",
    "data":  {
        "id": "000000000000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": null,
        "amount": 500,
        "fee": 0,
        "total_amount": 500,
        "balance": 0,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "000000000000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": "",
    "amount": 500,
    "fee": 0,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "total_amount":-300,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "created": 1496135465218,
    "updated": 1496135465287
}
{
    "id": "000000000000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "created": 1476691969394,
    "updated": 1496135465287
}

Get transaction details for a spcific transactions.

Endpoint

https://api.rehive.com/3/transactions/{id}/

Accounts

List Accounts

User list accounts request

curl https://api.rehive.com/3/accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.accounts.get({filters: filters}).then(function(res){
    ...
},function(err){
    ...
})

https://api.rehive.com/3/ python rehive.accounts.get( filters=filters )

User list accounts response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "name": "default",
                "reference": "0000000000",
                "primary": true,
                "currencies": [
                    {
                        "balance": 10000,
                        "available_balance": 10000,
                        "currency": {
                            "code": "XBT",
                            "description": "bitcoin",
                            "symbol": "฿",
                            "unit": "bitcoin",
                            "divisibility": 8
                        },
                        "limits": [],
                        "fees": [],
                        "settings": {
                            "allow_transactions": true,
                            "allow_debit_transactions": true,
                            "allow_credit_transactions": true
                        },
                        "active": true
                    }
                ],
                "created": 1464858068745,
                "updated": 1464858068745
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "name": "default",
            "reference": "0000000000",
            "currencies": [
                {
                    "balance": 10000,
                    "currency": {
                        "code": "XBT",
                        "description": "bitcoin",
                        "symbol": "฿",
                        "unit": "bitcoin",
                        "divisibility": 8
                    },
                    "fees":[],
                    "limits":[],
                    "settings": {
                        "allow_transactions": true,
                        "allow_debit_transactions": true,
                        "allow_credit_transactions": true
                    },
                    "active": true
                }
            ],
            "primary":false,
            "created": 1464858068745,
            "updated": 1464858068745
        }
    ]

}
[
    {
        "name": "default",
        "reference": "0000000000",
        "primary": true,
        "currencies": [
            {
                "balance": 10000,
                "available_balance": 10000,
                "currency": {
                    "code": "XBT",
                    "description": "bitcoin",
                    "symbol": "฿",
                    "unit": "bitcoin",
                    "divisibility": 8
                },
                "limits": [],
                "fees": [],
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                },
                "active": true
            }
        ],
        "created": 1464858068745,
        "updated": 1464858068745
    }
]

Get a list of accounts belonging to a user.

Filtering

Field Type
reference string
name string
active boolean
primary boolean

Endpoint

https://api.rehive.com/3/accounts/

Create Account

User create account request

curl https://api.rehive.com/3/accounts/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"name": "savings"}'
rehive.accounts.create({
    name: 'savings'
}).then(function (res) {
    ...
}, function (err) {
    ...
})
rehive.accounts.create(
    name="savings"
)

User create account response

{
    "status": "success",
    "data": {
        "name": "savings",
        "reference": "0000000000",
        "primary": false,
        "currencies": [],
        "created": 1501145581365,
        "updated": 1501145581370
    },
}
{
    "name": "savings",
    "reference": "0000000000",
    "primary": true,
    "currencies": [],
    "created": 1501145581365,
    "updated": 1501145581370
}
{
    "name": "savings",
    "reference": "0000000000",
    "primary": false,
    "currencies": [],
    "created": 1501145581365,
    "updated": 1501145581370
}

Create a account for a user.

Endpoint

https://api.rehive.com/3/accounts/

Required Fields

Field Description Default
name account name null

Optional Fields

Field Description Default
label label for an account false

Retrieve Account

User retrieve account request

curl https://api.rehive.com/3/accounts/{reference}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

rehive.accounts.get({reference: reference}).then(function(res){
    ...
},function(err){
    ...
})
rehive.accounts.get(
    "{reference}"
)

User retrieve account response

{
    "status": "success",
    "data": {
        "name": "default",
        "reference": "0000000000",
        "primary": true,
        "currencies": [
            {
                "balance": 10000,
                "available_balance": 10000,
                "currency": {
                    "code": "XBT",
                    "description": "bitcoin",
                    "symbol": "฿",
                    "unit": "bitcoin",
                    "divisibility": 8
                },
                "limits": [],
                "fees": [],
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                },
                "active": true
            }
        ],
        "created": 1464858068745,
        "updated": 1464858068745
    }
}
{
    "name": "default",
    "reference": "0000000000",
    "currencies": [
        {
            "balance": 10000,
            "currency": {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "฿",
                "unit": "bitcoin",
                "divisibility": 8
            },
            "fees":[],
            "limits":[],
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            }
            "active": true
        }
    ],
    "primary":false,
    "created": 1464858068745,
    "updated": 1464858068
}
{
    "name": "default",
    "reference": "0000000000",
    "primary": true,
    "currencies": [
        {
            "balance": 10000,
            "available_balance": 10000,
            "currency": {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "฿",
                "unit": "bitcoin",
                "divisibility": 8
            },
            "limits": [],
            "fees": [],
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            },
            "active": true
        }
    ],
    "created": 1464858068745,
    "updated": 1464858068745
}

Retrieve an account belonging to a user.

Filtering

Field Type
active boolean

Endpoint

https://api.rehive.com/3/accounts/{reference}/

List Account Currencies

User list account currencies request

curl https://api.rehive.com/3/accounts/{reference}/currencies/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

rehive.accounts.currencies.get(reference).then(function(res){
    ...
},function(err){
    ...
})
rehive.accounts.obj("{reference}").currencies.get()

User list account currencies response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "balance": 10000,
                "available_balance": 10000,
                "currency": {
                    "code": "XBT",
                    "description": "bitcoin",
                    "symbol": "฿",
                    "unit": "bitcoin",
                    "divisibility": 8
                },
                "limits": [],
                "fees": [],
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                },
                "active": true,
                "created": 1464858068745,
                "updated": 1464858068745
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "balance": 10000,
            "available_balance": 10000,
            "currency": {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "฿",
                "unit": "bitcoin",
                "divisibility": 8
            },
            "limits": [],
            "fees": [],
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            },
            "active": true,
            "created": 1464858068745,
            "updated": 1464858068745
        }
    ]

}
[
    {
        "balance": 10000,
        "available_balance": 10000,
        "currency": {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "฿",
            "unit": "bitcoin",
            "divisibility": 8
        },
        "limits": [],
        "fees": [],
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "active": true,
        "created": 1464858068745,
        "updated": 1464858068745
    }
]

Get a list of currencies for an account belonging to a user.

Filtering

Field Type
active boolean

Endpoint

https://api.rehive.com/3/accounts/{reference}/currencies/

Retrieve Account Currency

User retrieve account currency request

curl https://api.rehive.com/3/accounts/{reference}/currencies/{code}
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.accounts.currencies.get(reference,{code: code}).then(function(res){
    ...
},function(err){
    ...
})
rehive.accounts.obj("{reference}").currencies.get(
    "{code}"
)

User retrieve account currency response

{
    "status": "success",
    "data": {
        "balance": 10000,
        "available_balance": 10000,
        "currency": {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "฿",
            "unit": "bitcoin",
            "divisibility": 8
        },
        "limits": [],
        "fees": [],
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "active": true,
        "created": 1464858068745,
        "updated": 1464858068745
    }
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "฿",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "active": true,
    "created": 1464858068745,
    "updated": 1464858068745
}

```python
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "฿",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "active": true,
    "created": 1464858068745,
    "updated": 1464858068745
}

Retrieve an account’s currency belonging to a user.

Endpoint

https://api.rehive.com/3/accounts/{reference}/currencies/{code}

Update Account Currency

User update account currency request

curl https://api.rehive.com/3/accounts/{reference}/currencies/{code}
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"active": true}'
rehive.accounts.currencies.update(reference,currencyCode,{active: true}).then(function(res){
    ...
},function(err){
    ...
})
rehive.accounts.obj("{reference}").currencies.update(
    "{code}",
    active=True
)

# Quick method for setting active
rehive.accounts.obj("{reference}").currencies.make_active_currency(
    "{code}"
)

User update account currency response

{
    "status": "success",
    "data": {
        "balance": 10000,
        "available_balance": 10000,
        "currency": {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "฿",
            "unit": "bitcoin",
            "divisibility": 8
        },
        "limits": [],
        "fees": [],
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "active": true,
        "created": 1464858068745,
        "updated": 1464858068745
    }
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "฿",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "active": true,
    "created": 1464858068745,
    "updated": 1464858068745
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "฿",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "active": true,
    "created": 1464858068745,
    "updated": 1464858068745
}

Update the active status of an account currency. Activating an account’s currency will result in that currency getting used by default for all transactions if no other account/currency is specified.

Endpoint

https://api.rehive.com/3/accounts/{reference}/currencies/{code}

Optional Fields

Field Description Default
active is active currency false

Company

Retrieve Company Details

User retrieve company details request

curl https://api.rehive.com/3/company/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.company.get().then(function(res){
    ...
},function(err){
    ...
})
rehive.company.get()

User retrieve company details response

{
    "data": {
        "id": "rehive",
        "name": "Rehive",
        "description": "Wallets for everyone.",
        "website": "http://www.rehive.com",
        "email": null,
        "logo": "https://path.to.file.com/image.png",
        "address": {
            "line_1": "1 First Avenue",
            "line_2": "",
            "city": "Cape Town",
            "state_province": "Western Cape",
            "country": "ZA",
            "postal_code": "8001"
        },
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true,
            "require_verification": false,
            "allow_registrations": true,
            "allow_overdrafts": false,
            "allow_session_durations": false,
            "require_terms_and_conditions": false,
            "default_transaction_status": "Pending",
            "password_reset_url": "",
            "password_set_url": "",
            "email_confirmation_url": "",
            "nationalities": []
        },
        "created": 1516281408895,
        "updated": 1528454842365
    },
    "status": "success"
}
{
    "id": "rehive",
    "name": "Rehive",
    "description": "Wallets for everyone.",
    "website": "http://www.rehive.com",
    "email": null,
    "logo": "https://path.to.file.com/image.png",
    "address": {
        "line_1": "1 First Avenue",
        "line_2": "",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"
    },
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": false,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "default_transaction_status": "Pending",
        "password_reset_url": "",
        "password_set_url": "",
        "email_confirmation_url": "",
        "nationalities": []
    },
    "created": 1516281408895,
    "updated": 1528454842365
}
{
    "id": "rehive",
    "name": "Rehive",
    "description": "Wallets for everyone.",
    "website": "http://www.rehive.com",
    "email": null,
    "logo": "https://path.to.file.com/image.png",
    "address": {
        "line_1": "1 First Avenue",
        "line_2": "",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"
    },
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": false,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "default_transaction_status": "Pending",
        "password_reset_url": "",
        "password_set_url": "",
        "email_confirmation_url": "",
        "nationalities": []
    },
    "created": 1516281408895,
    "updated": 1528454842365
}

Retrieve current user’s company details.

Endpoint

https://api.rehive.com/3/company/

List Company Currencies

User list company currencies request

curl https://api.rehive.com/3/company/currencies/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.company.currencies.get().then(function(res){
    ...
},function(err){
    ...
})
rehive.company.currencies.get()

User list company currencies response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "฿",
                "unit": "bitcoin",
                "divisibility": 8,
                "created": 1516281408895,
                "updated": 1528454842365
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "฿",
            "unit": "bitcoin",
            "divisibility": 8,
            "created": 1516281408895,
            "updated": 1528454842365
        }
    ]
}
[
    {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "฿",
        "unit": "bitcoin",
        "divisibility": 8,
        "created": 1516281408895,
        "updated": 1528454842365
    }
]

Get a list of available currencies for the current user’s company.

Endpoint

https://api.rehive.com/3/company/currencies/

List Company Banks

User list company banks request

curl https://api.rehive.com/3/company/bank-accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

User list company banks response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": 1,
                "name": "Rehive",
                "number": "xxxxxxxx",
                "type": "Cheque",
                "bank_name": "Barclays",
                "bank_code": "xxxx",
                "branch_code": "xxxxx",
                "swift": "",
                "iban": "",
                "bic": ""
                "currencies": [
                    {
                        "code": "ZAR",
                        "description": "Rand",
                        "symbol": "R",
                        "unit": "rand",
                        "divisibility": 2
                    }
                ],
                "created": 1516281408895,
                "updated": 1528454842365
            }
        ]
    }
}

List company banks for the current user’s company.

Filtering

Field Type
currency string

Endpoint

https://api.rehive.com/3/company/bank-accounts/

Administration

Rehive includes a set of admin-only endpoints that provide adminsitration level functionality to all Rehive resources.

Users

Users Overview

Admin users overview request

curl https://api.rehive.com/3/admin/users/overview/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.overview.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.overview.get()

Admin list users overview response

{
    "data": {
        "total": 1,
        "archived": 1,
        "active": 1
    },
    "status": "success"
}
{
    "total": 1,
    "archived": 1,
    "active": 1
}
{
    "total": 1,
    "archived": 1,
    "active": 1
}

Get an overview of users belonging to a company.

Endpoint

https://api.rehive.com/3/admin/users/overview/

List Users

Admin list users request

curl https://api.rehive.com/3/admin/users/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.get()

Admin list users response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "id_number": "",
                "birth_date": "2000-01-01",
                "profile": null,
                "currency": {
                    "description": "Rand",
                    "code": "ZAR",
                    "symbol": "R",
                    "unit": "rand",
                    "divisibility": 2
                },
                "company": "rehive",
                "language": "en",
                "nationality": "ZA",
                "metadata": null,
                "mobile": "+27840000000",
                "timezone": "Asia/Dhaka",
                "verified": true,
                "verification": {
                    "email": true,
                    "mobile": true
                },
                "kyc": {
                    "updated": 1509539801040,
                    "status": "pending"
                },
                "status": "pending",
                "groups": [],
                "created": 1464912953000,
                "updated": 1464912953000,
                "last_login": null,
                "archived": false
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "id_number": "",
            "birth_date": "2000-01-01",
            "profile": null,
            "currency": {
                "description": "Rand",
                "code": "ZAR",
                "symbol": "R",
                "unit": "rand",
                "divisibility": 2
            },
            "company": "rehive",
            "language": "en",
            "nationality": "ZA",
            "metadata": null,
            "mobile": "+27840000000",
            "timezone": "Asia/Dhaka",
            "verified": true,
            "verification": {
                "email": true,
                "mobile": true
            },
            "kyc": {
                "updated": 1509539801040,
                "status": "pending"
            },
            "status": "pending",
            "groups": [],
            "created": 1464912953000,
            "updated": 1464912953000,
            "last_login": null,
            "archived": false
        }
    ]
}
[
    {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "id_number": "",
        "birth_date": "2000-01-01",
        "profile": null,
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": null,
        "mobile": "+27840000000",
        "timezone": "Asia/Dhaka",
        "verified": true,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "last_login": null,
        "archived": false
    }
]

Get a list of users belonging to a company.

Filtering

Field Type
id string
user string
email string
mobile string
first_name string
last_name string
username string
id_number string
language string
nationality string
status string
currency string
created millisecond timestamp
updated millisecond timestamp
last_login millisecond timestamp
archived boolean

Endpoint

https://api.rehive.com/3/admin/users/

Create User

Admin create user request

curl https://api.rehive.com/3/admin/users/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"first_name": "Joe",
       "last_name": "Soap",
       "mobile": "+27840000000",
       "email": "joe@rehive.com"}'
var fileSelected = document.getElementById("userProfile").files[0],
        formData = new FormData;

formData.append('profile', fileSelected);
formData.append('first_name', first_name);
formData.append('last_name', last_name);
formData.append('email', email);
formData.append('id_number', id_number);
formData.append('language', language);
formData.append('nationality', nationality);
formData.append('metadata', metadata);
formData.append('mobile', mobile);
formData.append('timezone', timezone);

rehive.admin.users.create(formData).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.create(
    first_name="Joe",
    last_name="Soap",
    mobile="+27840000000",
    email="joe@rehive.com"
)

Admin create user response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "id_number": "",
        "birth_date": "2000-01-01",
        "profile": null,
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": null,
        "mobile": "+27840000000",
        "timezone": "Asia/Dhaka",
        "verified": true,
        "verification": {
            "email": true,
            "mobile": true
        },
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "last_login": null,
        "archived": false
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": null,
    "id_number": "",
    "birth_date": "2000-01-01",
    "profile": null,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": null,
    "mobile": "+27840000000",
    "timezone": "Asia/Dhaka",
    "verified": true,
    "verification": {
        "email": true,
        "mobile": true
    },
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "last_login": null,
    "archived": false
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": null,
    "id_number": "",
    "birth_date": "2000-01-01",
    "profile": null,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": null,
    "mobile": "+27840000000",
    "timezone": "Asia/Dhaka",
    "verified": true,
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "last_login": null,
    "archived": false
}

Create a user.

Endpoint

https://api.rehive.com/3/admin/users/

Optional Fields

Field Description Default
id unique id (cannot be changed once set) string (uuid)
username unique username (cannot be changed once set) null
first_name first name blank
last_name last name blank
email email address null
mobile mobile number null
id_number ID number blank
profile profile image blank
language language code (af, en etc.) blank
nationality nationality code (ZA, UK etc.) blank
metadata custom metadata {}
mobile mobile number blank
timezone timezone blank
birth_date birth date blank
archived boolean false

Retrieve User

Admin retrieve user request

curl https://api.rehive.com/3/admin/users/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.get({id: id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.get(
    "{id}"
)

Admin retrieve user response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "id_number": "",
        "birth_date": "2000-01-01",
        "profile": null,
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": null,
        "mobile": "+27840000000",
        "timezone": "Asia/Dhaka",
        "verified": true,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "last_login": null,
        "archived": false
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": null,
    "id_number": "",
    "birth_date": "2000-01-01",
    "profile": null,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": null,
    "mobile": "+27840000000",
    "timezone": "Asia/Dhaka",
    "verified": true,
    "verification": {
        "email": true,
        "mobile": true
    },
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "last_login": null,
    "archived": false
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": null,
    "id_number": "",
    "birth_date": "2000-01-01",
    "profile": null,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": null,
    "mobile": "+27840000000",
    "timezone": "Asia/Dhaka",
    "verified": true,
    "verification": {
        "email": true,
        "mobile": true
    },
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "last_login": null,
    "archived": false
}

Retrieve a company’s user.

Endpoint

https://api.rehive.com/3/admin/users/{id}/

Update User

Admin update user request

curl https://api.rehive.com/3/admin/users/{id}/`
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"first_name": "Joe"}'
var fileSelected = document.getElementById("userUpdateProfile").files[0],
    formData = new FormData,
    data = {first_name: 'Joe'};

if(fileSelected){
    formData.append('profile', fileSelected);
}

for (var key in data) {
    if (data[key]) {
        formData.append(key, data[key]);
    }
}

rehive.admin.users.update(id, formData).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.update(
    "{id}",
    first_name="Joe"
)

Admin update user response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "id_number": "",
        "birth_date": "2000-01-01",
        "profile": null,
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "company": "rehive",
        "language": "en",
        "nationality": "ZA",
        "metadata": null,
        "mobile": "+27840000000",
        "timezone": "Asia/Dhaka",
        "verified": true,
        "verification": {
            "email": true,
            "mobile": true
        },
        "kyc": {
            "updated": 1509539801040,
            "status": "pending"
        },
        "status": "pending",
        "groups": [],
        "permissions": [],
        "created": 1464912953000,
        "updated": 1464912953000,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "last_login": null,
        "archived": false
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": null,
    "id_number": "",
    "birth_date": "2000-01-01",
    "profile": null,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": null,
    "mobile": "+27840000000",
    "timezone": "Asia/Dhaka",
    "verified": true,
    "verification": {
        "email": true,
        "mobile": true
    },
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "last_login": null,
    "archived": false
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "first_name": "Joe",
    "last_name": "Soap",
    "email": "joe@rehive.com",
    "username": null,
    "id_number": "",
    "birth_date": "2000-01-01",
    "profile": null,
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "company": "rehive",
    "language": "en",
    "nationality": "ZA",
    "metadata": null,
    "mobile": "+27840000000",
    "timezone": "Asia/Dhaka",
    "verified": true,
    "verification": {
        "email": true,
        "mobile": true
    },
    "kyc": {
        "updated": 1509539801040,
        "status": "pending"
    },
    "status": "pending",
    "groups": [],
    "permissions": [],
    "created": 1464912953000,
    "updated": 1464912953000,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "last_login": null,
    "archived": false
}

Update a user’s details.

Endpoint

https://api.rehive.com/3/admin/users/{id}/

Optional Fields

Field Description Default
first_name first name blank
last_name last name blank
id_number ID number blank
profile profile image blank
language language code (af, en etc.) blank
nationality nationality code (ZA, UK etc.) blank
metadata custom metadata {}
mobile mobile number blank
timezone timezone blank
birth_date birth date blank
status status pending
archived boolean false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Retrieve User Settings

Admin retrieve user settings request

curl https://api.rehive.com/3/admin/users/{id}/settings/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.settings.get(id).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.obj('2fba8a20-3d4b-41db-994d-ddc86159316f').settings.get()

Admin retrieve user settings response

{
    "status": "success",
    "data": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}

Retrieve a company’s user settings.

Endpoint

https://api.rehive.com/3/admin/users/{id}/settings/

Update User Settings

Admin update user settings request

curl https://api.rehive.com/3/admin/users/{id}/settings/`
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"allow_transactions": true}'
rehive.admin.users.settings.update(id, {allow_transactions: true}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.obj('{id}').settings.update(
    allow_transactions=True
)

Admin update user settings response

{
    "status": "success",
    "data": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}

Update a user’s settings.

Endpoint

https://api.rehive.com/3/admin/users/{id}/settings/

Optional Fields

Field Description Default
allow_transactions Allow transactions true
allow_debit_transactions Allow debit transactions true
allow_credit_transactions Allow credit transactions true,

Retrieve User KYC

Admin retrieve user kyc request

curl https://api.rehive.com/3/admin/users/{id}/kyc/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

Admin retrieve user kyc response

{
    "status": "success",
    "data": {
        "status": "pending",
        "updated": 1520929665311
    }
}

Retrieve a company’s user kyc details.

Endpoint

https://api.rehive.com/3/admin/users/{id}/kyc/

Update User KYC

Admin update user kyc request

curl https://api.rehive.com/3/admin/users/{id}/kyc/`
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"status": "verified"}'

Admin update user kyc response

{
    "status": "success",
    "data": {
        "status": "verified",
        "updated": 1520929665311
    }
}

Update a user’s kyc.

Endpoint

https://api.rehive.com/3/admin/users/{id}/kyc/

Optional Fields

Field Description Default
status kyc status true

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

List Addresses

List Addresses request

curl https://api.rehive.com/3/admin/users/addresses/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.addresses.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.addresses.get()

List Addresses response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": 2,
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "line_1": "1 Main Street",
                "line_2": "East City",
                "city": "Cape Town",
                "state_province": "Western Cape",
                "country": "ZA",
                "postal_code": "8001"
                "status": "pending",
                "archived": false,
                "created": 1520929665311,
                "updated": 1520929665311
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 2,
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "line_1": "1 Main Street",
            "line_2": "East City",
            "city": "Cape Town",
            "state_province": "Western Cape",
            "country": "ZA",
            "postal_code": "8001"
            "status": "pending",
            "archived": false,
            "created": 1520929665311,
            "updated": 1520929665311
        }
    ]
}
[
    {
        "id": 2,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
]

Filtering

Field Type
user string
status string

Endpoint

https://api.rehive.com/3/admin/users/addresses/

Create Address

Create Address request

curl https://api.rehive.com/3/admin/users/addresses/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001",
        "user": "joe@rehive.com"}'
rehive.admin.users.addresses.create(
{
    user: "joe@rehive.com",
    line_1: "1 Main Street",
    line_2: "East City",
    city: "Cape Town",
    state_province: "Western Cape",
    country: "ZA",
    postal_code: "8001",
    status: "pending"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.addresses.create(
    line_1="1 Main Street",
    line_2="East City",
    city="Cape Town",
    state_province="Western Cape",
    country="ZA",
    postal_code="8001",
    user="joe@rehive.com"
)

Create Address response

{
    "status": "success",
    "data": {
        "id": 2,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001"
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001"
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/addresses/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null

Optional Fields

Field Description Default
line_1 address line one blank
line_2 address line 2 blank
city city blank
state_province state or province blank
country country code blank
postal_code postal or zip code) blank
status account status “pending”
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Retrieve Address

Retrieve Address request

curl https://api.rehive.com/3/admin/users/addresses/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.addresses.get({id: id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.addresses.get(
   {id}
)

Retrieve Address response

{
    "status": "success",
    "data": {
        "id": 2,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001"
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001"
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/addresses/{id}/

Update Address

Update Address request

curl https://api.rehive.com/3/admin/users/addresses/{id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"line_1": "1 Main Street"}'
rehive.admin.users.addresses.update(id,{
    line_1: '1 Main Street',
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.addresses.update(
    {id},
    line_1="1 Main Street"
)

Update Address response

{
    "status": "success",
    "data": {
        "id": 2,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "line_1": "1 Main Street",
        "line_2": "East City",
        "city": "Cape Town",
        "state_province": "Western Cape",
        "country": "ZA",
        "postal_code": "8001"
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001"
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "line_1": "1 Main Street",
    "line_2": "East City",
    "city": "Cape Town",
    "state_province": "Western Cape",
    "country": "ZA",
    "postal_code": "8001"
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/addresses/{id}/

Optional Fields

Field Description Default
line_1 address line one blank
line_2 address line 2 blank
city city blank
state_province state or province blank
country country code blank
postal_code postal or zip code) blank
status account status “pending”
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Delete Address

Delete address request

curl https://api.rehive.com/3/admin/users/addresses/{id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.addresses.delete(id).then(function (res) {
   ...
}, function (err) {
   ...
});
rehive.admin.users.addresses.delete(
    {id}
)

Delete address response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Endpoint

https://api.rehive.com/3/admin/users/addresses/{id}/

List Bank Accounts

List Bank Accounts request

curl https://api.rehive.com/3/admin/users/bank-accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.bankAccounts.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.banks_accounts.get()

List Bank Accounts response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": 1,
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "name": "Bank Account",
                "number": "12341234",
                "type": "Cheque",
                "bank_name": "Bank",
                "bank_code": "1234",
                "branch_code": "1234",
                "swift": null,
                "iban": null,
                "bic": null,
                "code": "bank_account_000000000000",
                "status": "pending",
                "archived": false,
                "created": 1520929665311,
                "updated": 1520929665311
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "name": "Bank Account",
            "number": "12341234",
            "type": "Cheque",
            "bank_name": "Barclays",
            "bank_code": "1234",
            "branch_code": "1234",
            "swift": null,
            "iban": null,
            "bic": null,
            "code": "bank_account_000000000000",
            "status": "pending",
            "archived": false,
            "created": 1520929665311,
            "updated": 1520929665311
        }
    ]
}
[
    {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "name": "Bank Account",
        "number": "12341234",
        "type": "Cheque",
        "bank_name": "Bank",
        "bank_code": "1234",
        "branch_code": "1234",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
]

Endpoint

https://api.rehive.com/3/admin/users/bank-accounts/

Create Bank Account

Create Bank Account request

curl https://api.rehive.com/3/admin/users/bank-accounts/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"name": "Bank Account",
        "number": "12341234",
        "type": "Cheque",
        "bank_name": "Bank",
        "bank_code": "1234",
        "branch_code": "1234",
        "user": "joe@rehive.com"}'
rehive.admin.users.bankAccounts.create({
    user: "joe@rehive.com",
    name: "Bank",
    number: "23434",
    type: "cash",
    bank_name: "bank name",
    bank_code: 234342,
    branch_code: 2343,
    swift: "",
    iban: "",
    bic: "",
    status: "verified"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.bank_accounts.create(
    name="Bank Account",
    number="12341234",
    type="Cheque",
    bank_name="Bank",
    bank_code="1234",
    branch_code="1234",
    user=joe@rehive.com
)

Create Bank Account response

{
    "status": "success",
    "data": {
        "id": 2,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "name": "Bank Account",
        "number": "12341234",
        "type": "Cheque",
        "bank_name": "Bank",
        "bank_code": "1234",
        "branch_code": "1234",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "name": "Bank Account",
    "number": "12341234",
    "type": "Cheque",
    "bank_name": "Barclays",
    "bank_code": "1234",
    "branch_code": "1234",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
 {
    "id": 2,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "name": "Bank Account",
    "number": "12341234",
    "type": "Cheque",
    "bank_name": "Bank",
    "bank_code": "1234",
    "branch_code": "1234",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/bank-accounts/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null

Optional Fields

Field Description Default
name Account Name blank
number Account Number blank
type Account Type blank
bank_name Bank Name blank
bank_code Bank Code blank
branch_code Branch Code blank
status account status “pending”
swift swift blank
iban iban blank
bic bic blank
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Retrieve Bank Account

Retrieve Bank Account request

curl https://api.rehive.com/3/admin/users/bank-accounts/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.bankAccounts.get({id: id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.bank_accounts.get("{id}")

Retrieve Bank Account response

{
    "status": "success",
    "data": {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "name": "Bank Account",
        "number": "12341234",
        "type": "Cheque",
        "bank_name": "Bank",
        "bank_code": "1234",
        "branch_code": "1234",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "name": "Bank Account",
    "number": "12341234",
    "type": "Cheque",
    "bank_name": "Barclays",
    "bank_code": "1234",
    "branch_code": "1234",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "name": "Bank Account",
    "number": "12341234",
    "type": "Cheque",
    "bank_name": "Bank",
    "bank_code": "1234",
    "branch_code": "1234",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/bank-accounts/{id}/

Update Bank Account

Update Bank Account request

curl https://api.rehive.com/3/admin/users/bank-accounts/{id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"name": "New account name"}'
rehive.admin.users.bankAccounts.update(id,{
    name: 'New account name'
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.bank_accounts.update(
    "{id}",
    name="New account name"
)

Update Bank Account response

{
    "status": "success",
    "data": {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "name": "New account name",
        "number": "12341234",
        "type": "Cheque",
        "bank_name": "Bank",
        "bank_code": "1234",
        "branch_code": "1234",
        "swift": null,
        "iban": null,
        "bic": null,
        "code": "bank_account_000000000000",
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "name": "Bank Account",
    "number": "12341234",
    "type": "Cheque",
    "bank_name": "Barclays",
    "bank_code": "1234",
    "branch_code": "1234",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "name": "New account name",
    "number": "12341234",
    "type": "Cheque",
    "bank_name": "Bank",
    "bank_code": "1234",
    "branch_code": "1234",
    "swift": null,
    "iban": null,
    "bic": null,
    "code": "bank_account_000000000000",
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/bank-accounts/{id}/

Optional Fields

Field Description Default
name Account Name blank
number Account Number blank
type Account Type blank
bank_name Bank Name blank
bank_code Bank Code blank
branch_code Branch Code blank
status account status “pending”
swift swift blank
iban iban blank
bic bic blank
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Delete Bank Account

Delete Bank Account request

curl https://api.rehive.com/3/admin/users/bank-accounts/{id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.bankAccounts.delete(id).then(function (res) {
   ...
}, function (err) {
   ...
});
rehive.admin.users.bank_accounts.delete(
    {id}
)

Delete Bank Account response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Endpoint

https://api.rehive.com/3/admin/users/bank-accounts/{id}/

List Crypto Accounts

Admin list crypto accounts request

curl https://api.rehive.com/3/admin/users/crypto-accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.cryptoAccounts.get().then(function (res) {
    ...
}, function (err) {
    ...
});

rehive.admin.users.crypto_accounts.get()

Admin list crypto accounts response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": 1,
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "address": "0000000000000000000000000000000000",
                "code": "crypto_account_000000000000",
                "crypto_type": "bitcoin",
                "metadata": {},
                "status": "pending",
                "archived": false,
                "created": 1520929665311,
                "updated": 1520929665311
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "address": "0000000000000000000000000000000000",
            "code": "crypto_account_000000000000",
            "crypto_type": "bitcoin",
            "metadata": {},
            "status": "pending",
            "archived": false,
            "created": 1520929665311,
            "updated": 1520929665311
        }
    ]
}
[
    {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
]

List a user’s cryptocurrency addresses.

Filtering

Field Type
user string
status string

Endpoint

https://api.rehive.com/3/admin/users/crypto-accounts/

Create Crypto Account

Admin create crypto account request

curl https://api.rehive.com/3/admin/users/crypto-accounts/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"address": "0000000000000000000000000000000000",
        "user": "joe@rehive.com"}'
rehive.admin.users.cryptoAccounts.create(
{
    user: 'joe@rehive.com',
    crypto_type: 'ethereum',
    address: '3242342343223dewwrewrw',
    metadata: {},
    status: 'incomplete'
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.crypto_accounts.create(
    address="0000000000000000000000000000000000",
    type="bitcoin",
    user="joe@rehive.com"
)

Admin create crypto account response

{
    "status": "success",
    "data": {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Create a crypto account for a user.

Endpoint

https://api.rehive.com/3/admin/users/crypto-accounts/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null
address full bitcoin address null

Optional Fields

Field Description Default
crypto_type string type (bitcoin, ethereum, other) bitcoin
metadata custom metadata {}
status string status ‘pending’
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Retrieve Crypto Account

Retrieve Crypto Account request

curl https://api.rehive.com/3/admin/users/crypto-accounts/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.cryptoAccounts.get({id: id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.crypto_accounts.get(
    {id}
)

Retrieve Crypto Account response

{
    "status": "success",
    "data": {
        "id": {account_id},
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": {account_id},
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": {account_id},
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/crypto-accounts/{id}/

Update Crypto Account

Admin update crypto account request

curl https://api.rehive.com/3/admin/users/crypto-accounts/{account_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"address": "0000000000000000000000000000000000"}'
rehive.admin.users.cryptoAccounts.update(id,
{
    address: "0000000000000000000000000000000000"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.crypto_accounts.update(
    {account_id},
    address="0000000000000000000000000000000000"
)

Admin update crypto account response

{
    "status": "success",
    "data": {
        "id": {account_id},
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "address": "0000000000000000000000000000000000",
        "code": "crypto_account_000000000000",
        "crypto_type": "bitcoin",
        "metadata": {},
        "status": "pending",
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": {account_id},
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": {account_id},
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "address": "0000000000000000000000000000000000",
    "code": "crypto_account_000000000000",
    "crypto_type": "bitcoin",
    "metadata": {},
    "status": "pending",
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Update a user’s crypto account.

Endpoint

https://api.rehive.com/3/admin/users/crypto-accounts/{account_id}/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null
address full bitcoin address null

Optional Fields

Field Description Default
crypto_type string type (bitcoin, ethereum, other) bitcoin
metadata custom metadata {}
status string status 'pending’
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Delete Crypto Account

Admin delete crypto account request

curl https://api.rehive.com/3/admin/users/crypto-accounts/{account_id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.cryptoAccounts.delete(id).then(function (res) {
   ...
}, function (err) {
   ...
});
rehive.admin.users.crypto_accounts.delete(
    {id}
)

Admin delete crypto account response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Delete a user’s crypto account.

Endpoint

https://api.rehive.com/3/admin/users/crypto-accounts/{account_id}/

List Documents

Admin list documents request

curl https://api.rehive.com/3/admin/users/documents/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.documents.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.documents.get()

Admin list documents response

{
    "status": "success",
    "data": {
        "count": 0,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": 1,
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "file": "https://url.to/file.pdf",
                "document_category": "other",
                "document_type": "other",
                "metadata": {},
                "status": "pending",
                "note": null,
                "archived": false,
                "created": 1520929665311,
                "updated": 1520929665311
            }
        ]
    }
}
{
    "count": 0,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "file": "https://url.to/file.pdf",
            "document_category": "other",
            "document_type": "other",
            "metadata": {},
            "status": "pending",
            "note": null,
            "archived": false,
            "created": 1520929665311,
            "updated": 1520929665311
        }
    ]
}
[
    {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "pending",
        "note": null,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
]

Get a list of users’ documents.

Filtering

Field Type
user string
status string

Endpoint

https://api.rehive.com/3/admin/users/documents/

Create Document

Admin documents request

curl https://api.rehive.com/3/admin/documents/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: multipart/form-data"
  -F file=@localfilename
var fileSelected = document.getElementById("adminUserDocument").files[0],
        formData = new FormData();

formData.append('file', fileSelected);
formData.append('user', user);
formData.append('document_type', document_type);
formData.append('metadata', JSON.stringify(metadata));
formData.append('note', note);
formData.append('status', status);

rehive.admin.users.documents.create(formData).then(function (res) {
    ...
}, function (err) {
    ...
});
# File argument should be the fullpath to the file
rehive.admin.documents.upload(
    document_type="other",
    file={localfilename}
)

Admin documents response

{
    "status": "success",
    "data": {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "pending",
        "note": null,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Upload user document.

Endpoint

https://api.rehive.com/3/admin/document/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null
file a document file null

Optional Fields

Field Description Default
document_category The document category other
document_type The type of docuemnt other
metadata custom metadata {}
status document status pending
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

Retrieve Document

Retrieve Document request

curl https://api.rehive.com/3/admin/users/documents/{document_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.documents.get({id: document_id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.documents.get(
    {document_id}
)

Retrieve Document response

{
    "status": "success",
    "data": {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "pending",
        "note": null,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "pending",
    "note": null,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Endpoint

https://api.rehive.com/3/admin/users/documents/{document_id}/

Update Document

Update document request

curl https://api.rehive.com/3/admin/users/documents/{document_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: multipart/form-data"
  -F file=@localfilename
var fileSelected = document.getElementById("updateAdminUserDocument").files[0],
        formData = new FormData(),
        data = {first_name: 'Joe'};

if(fileSelected) {
    formData.append('file', fileSelected);
}

for (var key in data) {
    if (data[key]) {
        formData.append(key, data[key]);
    }
}

rehive.admin.users.documents.update(id, formData).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.documents.update(
    document_type="other"
)

Admin update crypto account response

{
    "status": "success",
    "data": {
        "id": 1,
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "file": "https://url.to/file.pdf",
        "document_category": "other",
        "document_type": "other",
        "metadata": {},
        "status": "verified",
        "note": null,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "verified",
    "note": null,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "id": 1,
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "file": "https://url.to/file.pdf",
    "document_category": "other",
    "document_type": "other",
    "metadata": {},
    "status": "verified",
    "note": null,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Update a user’s document.

Endpoint

https://api.rehive.com/3/admin/users/documents/{document_id}/

Required Fields

Field Description Default
file a document file null

Optional Fields

Field Description Default
document_category The document category other
document_type The type of docuemnt other
metadata custom metadata {}
status document status pending
archived archived state false

Statuses

Value Description
obsolete Obsolete
declined Declined
pending Pending
incomplete Incomplete
verified Verified

List Emails

Admin list emails request

curl https://api.rehive.com/3/admin/users/emails/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.emails.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.emails.get()

Admin list emails response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "id": 1,
                "email": "joe@rehive.com",
                "primary": true,
                "verified": true
            },
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "id": 1,
            "email": "joe@rehive.com",
            "primary": true,
            "verified": true
        },
    ]
}```

```python
[
    {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    },
]

Get a list of emails belonging to a company.

Filtering

Field Type
user string

Endpoint

https://api.rehive.com/3/admin/users/emails/

Create Email

Admin create email request

curl https://api.rehive.com/3/admin/users/emails/`
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"user": 00000000-0000-0000-0000-000000000000,
       "verified": true,
       "primary": true,
       "email": "joe@rehive.com"}'
rehive.admin.users.emails.create({
    user: '00000000-0000-0000-0000-000000000000',
    email: 'joe@rehive.com',
    primary: true,
    verified: true
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.emails.create(
    user="00000000-0000-0000-0000-000000000000",
    verified=True,
    primary=True,
    email="joe@rehive.com"
)

Admin create email response

{
    "status": "success",
    "data": {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}

Create an email address for a user.

Endpoint

https://api.rehive.com/3/admin/users/emails/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null
email email address null

Optional Fields

Field Description Default
verified verified status false
primary primary status false

Retrieve Email

Admin retrieve email request

curl https://api.rehive.com/3/admin/users/emails/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.emails.get({id: id).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.emails.get(
    "{id}"
)

Admin retrieve email response

{
    "status": "success",
    "data": {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}

Retrieve a company’s email.

Endpoint

https://api.rehive.com/3/admin/users/emails/{id}/

Update Email

Admin update email request

curl https://api.rehive.com/3/admin/users/emails/{id}/`
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"verified": true}'
rehive.admin.users.emails.update(id,{verified: true}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.emails.update(
    "{id}",
    verified=True
)

Admin update email response

{
    "status": "success",
    "data": {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "email": "joe@rehive.com",
        "primary": true,
        "verified": true
    }
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "joe@rehive.com",
    "primary": true,
    "verified": true
}

Update a user’s email.

Endpoint

https://api.rehive.com/3/admin/users/emails/{id}/

Optional Fields

Field Description Default
verified verified status false
primary primary status false

Delete Email

Admin delete email request

curl https://api.rehive.com/3/admin/users/emails/{id}/`
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.emails.delete(id).then(function (res) {
   ...
}, function (err) {
   ...
});
rehive.admin.users.emails.delete(
    {id}
)

Admin delete email response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Delete a user’s email.

Endpoint

https://api.rehive.com/3/admin/users/emails/{id}/

List Mobiles

Admin list mobiles request

curl https://api.rehive.com/3/admin/users/mobiles/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.mobiles.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.mobiles.get()

Admin list mobiles response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "id": 1,
                "number": "+27840000000",
                "primary": true,
                "verified": true,
                "archived": false,
                "created": 1520929665311,
                "updated": 1520929665311
            },
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "id": 1,
            "number": "+27840000000",
            "primary": true,
            "verified": true,
            "archived": false,
            "created": 1520929665311,
            "updated": 1520929665311
        },
    ]
}
[
    {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "number": "+27840000000",
        "primary": true,
        "verified": true,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    },
]

Get a list of mobile numbers belonging to a company.

Filtering

Field Type
user string

Endpoint

https://api.rehive.com/3/admin/users/mobiles/

Create Mobile

Admin create mobile request

curl https://api.rehive.com/3/admin/users/mobiles/`
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"user": 00000000-0000-0000-0000-000000000000,
       "verified": true,
       "primary": true,
       "number": "+27840000000"}'
rehive.admin.users.mobiles.create({
   user: 00000000-0000-0000-0000-000000000000,
   verified: true,
   primary: true,
   number: "+27840000000"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.mobiles.create(
    user="00000000-0000-0000-0000-000000000000",
    verified=True,
    primary=True,
    number="+27840000000"
)

Admin create mobile response

{
    "status": "success",
    "data": {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "email": "+27840000000",
        "primary": true,
        "verified": true,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "+27840000000",
    "primary": true,
    "verified": true,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "email": "+27840000000",
    "primary": true,
    "verified": true,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Create a mobile number for a user.

Endpoint

https://api.rehive.com/3/admin/users/mobiles/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null
mobile mobile number null

Optional Fields

Field Description Default
verified verified status false
primary primary status false
archived archived state false

Retrieve Mobile

Admin retrieve mobile request

curl https://api.rehive.com/3/admin/users/mobiles/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.mobiles.get({id: id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.mobiles.get(
    "{id}"
)

Admin retrieve mobile response

{
    "status": "success",
    "data": {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "number": "+27840000000",
        "primary": true,
        "verified": true,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "number": "+27840000000",
    "primary": true,
    "verified": true,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "number": "+27840000000",
    "primary": true,
    "verified": true,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Retrieve a company’s mobile.

Endpoint

https://api.rehive.com/3/admin/users/mobiles/{id}/

Update Mobile

Admin update mobile request

curl https://api.rehive.com/3/admin/users/mobiles/{id}/`
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"verified": true}'
rehive.admin.users.mobiles.update(id,{
    verified: true
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.users.mobiles.update(
    "{id}",
    verified=True
)

Admin update mobile response

{
    "status": "success",
    "data": {
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "id": 1,
        "number": "+27840000000",
        "primary": true,
        "verified": true,
        "archived": false,
        "created": 1520929665311,
        "updated": 1520929665311
    }
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "number": "+27840000000",
    "primary": true,
    "verified": true,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}
{
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "id": 1,
    "number": "+27840000000",
    "primary": true,
    "verified": true,
    "archived": false,
    "created": 1520929665311,
    "updated": 1520929665311
}

Update a user’s mobile.

Endpoint

https://api.rehive.com/3/admin/users/mobiles/{id}/

Optional Fields

Field Description Default
verified verified status false
primary primary status false
archived archived state false

Delete Mobile

Admin delete mobile request

curl https://api.rehive.com/3/admin/users/mobiles/{id}/`
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.users.mobiles.delete(id).then(function (res) {
   ...
}, function (err) {
   ...
});
rehive.admin.users.mobiles.delete(
    "{id}"
)

Admin delete mobile response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Delete a user’s mobile.

Endpoint

https://api.rehive.com/3/admin/users/mobiles/{id}/

Transactions

List Transactions

Admin transactions request

curl https://api.rehive.com/3/admin/transactions/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.transactions.get().then(function (res) {
    ...
}, function (err) {
    ...
});

// Paginations is handled internally by the SDK
rehive.admin.transactions.getNext()
rehive.admin.transactions.getPrevious()
rehive.admin.transactions.get()

# Paginations is handled internally by the SDK
rehive.admin.transactions.get_next()
rehive.admin.transactions.get_previous()

Admin transactions response

 {
    "status": "success",
    "data": {
        "count": 2,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": "000000000000000000000",
                "tx_type": "credit",
                "subtype": null,
                "note": "",
                "metadata": {},
                "status": "Pending",
                "reference": "",
                "amount": 500,
                "fee": 0,
                "total_amount": 500,
                "balance": 0,
                "account": "0000000000",
                "label": "Credit",
                "company": "rehive",
                "currency": {
                    "description": "Rand",
                    "code": "ZAR",
                    "symbol": "R",
                    "unit": "rand",
                    "divisibility": 2
                },
                "user": {
                    "id": "00000000-0000-0000-0000-000000000000",
                    "first_name": "Joe",
                    "last_name": "Soap",
                    "email": "joe@rehive.com",
                    "username": null,
                    "mobile": "+27840000000",
                    "profile": null
                },
                "source_transaction": null,
                "destination_transaction": null,
                "archived": false,
                "created": 1509618707485,
                "updated": 1509618708277
            }
        ]
    }
}
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "000000000000000000000",
            "tx_type": "credit",
            "subtype": null,
            "note": "",
            "metadata": {},
            "status": "Pending",
            "reference": "",
            "amount": 500,
            "fee": 0,
            "total_amount": 500,
            "balance": 0,
            "account": "0000000000",
            "label": "Credit",
            "company": "rehive",
            "currency": {
                "description": "Rand",
                "code": "ZAR",
                "symbol": "R",
                "unit": "rand",
                "divisibility": 2
            },
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Joe",
                "last_name": "Soap",
                "email": "joe@rehive.com",
                "username": null,
                "mobile": "+27840000000",
                "profile": null
            },
            "source_transaction": null,
            "destination_transaction": null,
            "archived": false,
            "created": 1509618707485,
            "updated": 1509618708277
        }
    ]
}
[
    {
        "id": "000000000000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": "",
        "amount": 500,
        "fee": 0,
        "total_amount": 500,
        "balance": 0,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "source_transaction": null,
        "destination_transaction": null,
        "archived": false,
        "created": 1509618707485,
        "updated": 1509618708277
    }
]

Get a company’s transaction list.

Filtering

Field Type
id string
tx_type boolean
subtype string
status string
account string
user string
source_transaction boolean
destination_transaction boolean
created millsecond timestamp
updated millsecond timestamp
metadata any
archived boolean

Endpoint

https://api.rehive.com/3/admin/transactions/

Total Transactions

Admin total transactions request

curl https://api.rehive.com/3/admin/transactions/totals/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.transactions.totals.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.transactions.get_totals()

Admin total transactions response

{
    "status": "success",
    "data": {
        "amount": 1000,
        "fees": 0,
        "count": 2,
        "currency": "ZAR"
    }
}
{
    "amount": 1000,
    "fees": 0,
    "count": 2,
    "currency": "ZAR"
}
{
    "amount": 1000,
    "fees": 0,
    "count": 2,
    "currency": "ZAR"
}

Get a company’s total transaction details. This is a summary of transaction details like: amount totals, fee totals, and the total number of transactions.

Filtering

See Transaction List filtering above.

Endpoint

https://api.rehive.com/3/admin/transactions/totals/

Retrieve Transaction

Retrieve transaction request

curl https://api.rehive.com/3/admin/transactions/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.transactions.get({id: id}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.transactions.get(
    "{id}"
)

Retrieve transaction response

{
    "status": "success",
    "data":  {
        "id": "000000000000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": "",
        "amount": 500,
        "fee": 0,
        "total_amount": 500,
        "balance": 0,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "archived": false,
        "created": 1509618707485,
        "updated": 1509618708277
    }
}
{
    "id": "000000000000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": "",
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1509618707485,
    "updated": 1509618708277
}
{
    "id": "000000000000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": "",
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1509618707485,
    "updated": 1509618708277
}

Get transaction details for a spcific transactions.

Endpoint

https://api.rehive.com/3/admin/transactions/{id}/

Create Credit

Admin credit request

curl https://api.rehive.com/3/admin/transactions/credit/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"user": "joe@rehive.com",
       "amount": 500,
       "currency": "ZAR"}'
rehive.admin.transactions.createCredit(
{
    user: "joe@rehive.com",
    amount: 500,
    currency: "ZAR"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.transactions.create_credit(
    user="joe@rehive.com",
    amount=500,
    currency="ZAR"
)

Admin credit response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": null,
        "amount": 500,
        "fee": 0,
        "total_amount": 500,
        "balance": 0,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "archived": false,
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1476691969394,
    "updated": 1496135465287
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 0,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1476691969394,
    "updated": 1496135465287
}

Create a credit transaction on behalf of a user.

Endpoint

https://api.rehive.com/3/admin/transactions/credit/

Required Fields

Field Description Default
user email, mobile number, username, or unique id null
amount amount null
currency currency code null

Optional Fields

Field Description Default
id unique id (cannot be changed once set) string (uuid)
reference optional credit reference blank
subtype a custom defined subtype null
account account reference code null
note user’s note or message blank
metadata custom metadata {}
status status to transition to Pending
archived archived state false

Create Debit

Admin debit request

curl https://api.rehive.com/3/admin/transactions/debit/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"user": "joe@rehive.com",
       "amount": 500,
       "currency": "ZAR"}'
rehive.admin.transactions.createDebit(
{
    user: "joe@rehive.com",
    amount: 500,
    currency: "ZAR"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.transactions.create_debit(
    user="joe@rehive.com",
    amount=500,
    currency="ZAR"
)

Admin debit response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "tx_type": "debit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": null,
        "amount": -500,
        "fee": 0,
        "total_amount": -500,
        "balance": 0,
        "account": "0000000000",
        "label": "Debit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "archived": false,
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1476691969394,
    "updated": 1496135465287
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1476691969394,
    "updated": 1496135465287
}

Create a debit transaction on behalf of a user.

Endpoint

https://api.rehive.com/3/admin/transactions/debit/

Required Fields

Field Description Default
user mail, mobile number, username, or unique id null
amount amount null
currency currency code null

Optional Fields

Field Description Default
id unique id (cannot be changed once set) string (uuid)
reference optional debit reference blank
subtype a custom defined subtype null
account account reference code null
note user’s note or message blank
metadata custom metadata {}
status status to transition to Pending
archived archived state false

Create Transfer

Admin transfer request

curl https://api.rehive.com/3/admin/transactions/transfer/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"user": "joe@rehive.com",
       "amount": 500,
       "currency": "ZAR",
       "recipient": "susan@rehive.com"}'
rehive.admin.transactions.createTransfer(
{
    user: "joe@rehive.com",
    amount: 500,
    currency: "ZAR",
    recipient: "susan@rehive.com"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.transactions.create_transfer(
    user="joe@rehive.com",
    amount=500,
    currency="ZAR",
    recipient="susan@rehive.com"
)

Admin transfer response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "tx_type": "debit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Pending",
        "reference": null,
        "amount": -500,
        "fee": 0,
        "total_amount": -500,
        "balance": 0,
        "account": "0000000000",
        "label": "Debit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "source_transaction": null,
        "destination_transaction": {
            "id": "00000000-0000-0000-0000-000000000000",
            "user": {
                "id": "00000000-0000-0000-0000-000000000000",
                "first_name": "Susan",
                "last_name": "Brown",
                "email": "susan@rehive.com",
                "username": null,
                "mobile": "+27850000000",
                "profile": null
            }
        },
        "messages": [],
        "fees": [],
        "archived": false,
        "created": 1476691969394,
        "updated": 1496135465287
    }
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": {
        "id": "00000000-0000-0000-0000-000000000000",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Susan",
            "last_name": "Brown",
            "email": "susan@rehive.com",
            "username": null,
            "mobile": "+27850000000",
            "profile": null
        }
    },
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1476691969394,
    "updated": 1496135465287
}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "tx_type": "debit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Pending",
    "reference": null,
    "amount": -500,
    "fee": 0,
    "total_amount": -500,
    "balance": 0,
    "account": "0000000000",
    "label": "Debit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": {
        "id": "00000000-0000-0000-0000-000000000000",
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Susan",
            "last_name": "Brown",
            "email": "susan@rehive.com",
            "username": null,
            "mobile": "+27850000000",
            "profile": null
        }
    },
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1476691969394,
    "updated": 1496135465287
}

Create a transfer transaction on behalf of a user. This will transfer currency from one user to another. If the recipient reference does not exist as a user in Rehive and the reference is an email address or mobile number then an invitation message will be sent to the recipient informing them they have an unclaimed transaction.

Endpoint

https://api.rehive.com/3/admin/transactions/transfer/

Required Fields

Field Description Default
user mail, mobile number, username, or unique id null
amount amount null
  • recipient
  • and/or
  • credit_account
  • email, mobile number, username, or unique id
  • account reference code
null
currency currency code null

Optional Fields

Field Description Default
debit_subtype a custom defined subtype null
debit_account account reference code null
debit_note user’s note or message blank
debit_metadata custom metadata {}
debit_reference optional debit reference string
credit_subtype a custom defined subtype null
credit_account account reference code null
credit_note user’s note or message blank
credit_metadata custom metadata {}
credit_reference optional credit reference string
archived archived state false

Update Transaction

Admin update transaction request

curl https://api.rehive.com/3/admin/transactions/{id}/
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"status": "Complete"}'
rehive.admin.transactions.update(id, {status: "Complete"}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.transactions.update(
    "{id}",
    status="Complete"
)

# Quick methods for updating
rehive.admin.transactions.confirm("{id}")
rehive.admin.transactions.fail("{id}")
rehive.admin.transactions.delete("{id}")

Admin update transaction response

{
    "status": "success",
    "data":  {
        "id": "000000000000000000000",
        "tx_type": "credit",
        "subtype": null,
        "note": "",
        "metadata": {},
        "status": "Complete",
        "reference": "",
        "amount": 500,
        "fee": 0,
        "total_amount": 500,
        "balance": 500,
        "account": "0000000000",
        "label": "Credit",
        "company": "rehive",
        "currency": {
            "description": "Rand",
            "code": "ZAR",
            "symbol": "R",
            "unit": "rand",
            "divisibility": 2
        },
        "user": {
            "id": "00000000-0000-0000-0000-000000000000",
            "first_name": "Joe",
            "last_name": "Soap",
            "email": "joe@rehive.com",
            "username": null,
            "mobile": "+27840000000",
            "profile": null
        },
        "source_transaction": null,
        "destination_transaction": null,
        "messages": [],
        "fees": [],
        "archived": false,
        "created": 1509618707485,
        "updated": 1509618708277
    }
}
{
    "id": "000000000000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Complete",
    "reference": "",
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 500,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1509618707485,
    "updated": 1509618708277
}
{
    "id": "000000000000000000000",
    "tx_type": "credit",
    "subtype": null,
    "note": "",
    "metadata": {},
    "status": "Complete",
    "reference": "",
    "amount": 500,
    "fee": 0,
    "total_amount": 500,
    "balance": 500,
    "account": "0000000000",
    "label": "Credit",
    "company": "rehive",
    "currency": {
        "description": "Rand",
        "code": "ZAR",
        "symbol": "R",
        "unit": "rand",
        "divisibility": 2
    },
    "user": {
        "id": "00000000-0000-0000-0000-000000000000",
        "first_name": "Joe",
        "last_name": "Soap",
        "email": "joe@rehive.com",
        "username": null,
        "mobile": "+27840000000",
        "profile": null
    },
    "source_transaction": null,
    "destination_transaction": null,
    "messages": [],
    "fees": [],
    "archived": false,
    "created": 1509618707485,
    "updated": 1509618708277
}

Update a transaction. This endpoint can be used to transition a transaction to any state. The following states transitions are permitted: Pending, Complete, Failed, Deleted.

In addition, you can update the transaction metadata and add messages to the transaction message logs.

Messsages

Custom messages can be attached to transactions by including a message attribute in an update request. The message attribute should be a JSON object with 2 attributes level and message.

  1. level : The message log level, this can be info, warning, or error.
  2. message: The message text detail.

Each message added to a transaction will be stored in a list. Rehive will also add messages to this list when erorrs occur during processing.

Endpoint

https://api.rehive.com/3/admin/transactions/{id}/

Optional Fields

Field Description Default
status update action/status (Pending, Complete, Failed) null
metadata custom metadata {}
message message object {}
archived archived state false

Endpoint

https://api.rehive.com/3/admin/transactions/webhooks/{id}/

List Transaction Sets

Admin list transaction sets request

curl https://api.rehive.com/3/admin/transactions/sets/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

Admin list transaction sets response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "id": "00000000-0000-0000-0000-000000000000",
                "type": "transaction",
                "query": {},
                "status": "complete",
                "progress": 100,
                "count": 5000,
                "page_size": 5000,
                "archived": false,
                "created": 1530102672434,
                "updated": 1530102672474
            },
        ]
    }
}

Get a list of transaction sets.

Filtering

Field Type
status string (pending, complete, failed)

Endpoint

https://api.rehive.com/3/admin/transactions/sets/

Create Transaction Set

Admin create transaction sets request

curl https://api.rehive.com/3/admin/transactions/sets/`
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"page_size": 5000}'

Admin create transaction set response

{
    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "type": "transaction",
        "query": {},
        "status": "complete",
        "progress": 100,
        "count": 5000,
        "page_size": 5000,
        "pages": [
            {
                "count": 5000,
                "page": 1,
                "status": "complete",
                "file": "https://path.to.file.com/file.json"
            }
        ],
        "archived": false,
        "created": 1530102672434,
        "updated": 1530102672474
    }
}

Create a transaction set.

Endpoint

https://api.rehive.com/3/admin/transactions/sets/

Optional Fields

Field Description Default
page_size number of results per page 5000
query key value object containing query filters {}

Query Filtering

All filters available on the admin transaction list endpoint aare also available on the create transaction set endpoint. Simply include them in the query object like: {"status": "complete"}.

Retrieve Transaction Set

Admin retrieve transaction set request

curl https://api.rehive.com/3/admin/transactions/sets/{id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

Admin retrieve transaction set response

    "status": "success",
    "data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "type": "transaction",
        "query": {},
        "status": "complete",
        "progress": 100,
        "count": 5000,
        "page_size": 5000,
        "pages": [
            {
                "count": 5000,
                "page": 1,
                "status": "complete",
                "file": "https://path.to.file.com/file.json"
            }
        ],
        "archived": false,
        "created": 1530102672434,
        "updated": 1530102672474
    }

Retrieve a transaction set.

Endpoint

https://api.rehive.com/3/admin/transactions/sets/{id}/

Delete Transaction Set

Admin delete transaction set request

curl https://api.rehive.com/3/admin/transactions/sets/{id}/`
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"

Admin delete transaction set response

{
    "status": "success",
}

Delete a transaction set.

Endpoint

https://api.rehive.com/3/admin/transactions/sets/{id}/

Accounts

List Accounts

Admin list accounts request

curl https://api.rehive.com/3/admin/accounts/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.get()

Admin list accounts response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "name": "default",
                "reference": "0000000000",
                "user": "joe@rehive.com",
                "currencies": [
                    {
                        "balance": 10000,
                        "available_balance": 10000,
                        "currency": {
                            "code": "XBT",
                            "description": "bitcoin",
                            "symbol": "???",
                            "unit": "bitcoin",
                            "divisibility": 8
                        },
                        "limits": [],
                        "fees": [],
                        "settings": {
                            "allow_transactions": true,
                            "allow_debit_transactions": true,
                            "allow_credit_transactions": true
                        },
                        "active": true
                    }
                ],
                "archived": false,
                "created": 1464858068745,
                "updated": 1464858068745
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "name": "default",
            "reference": "0000000000",
            "user": "joe@rehive.com",
            "currencies": [
                {
                    "balance": 10000,
                    "available_balance": 10000,
                    "currency": {
                        "code": "XBT",
                        "description": "bitcoin",
                        "symbol": "???",
                        "unit": "bitcoin",
                        "divisibility": 8
                    },
                    "limits": [],
                    "fees": [],
                    "settings": {
                        "allow_transactions": true,
                        "allow_debit_transactions": true,
                        "allow_credit_transactions": true
                    },
                    "active": true
                }
            ],
            "archived": false,
            "created": 1464858068745,
            "updated": 1464858068745
        }
    ]
}
[
    {
        "name": "default",
        "reference": "0000000000",
        "user": "joe@rehive.com",
        "currencies": [
            {
                "balance": 10000,
                "available_balance": 10000,
                "currency": {
                    "code": "XBT",
                    "description": "bitcoin",
                    "symbol": "???",
                    "unit": "bitcoin",
                    "divisibility": 8
                },
                "limits": [],
                "fees": [],
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                },
                "active": true
            }
        ],
        "archived": false,
        "created": 1464858068745,
        "updated": 1464858068745
    }
]

Get a list of accounts belonging to users in a company.

Filtering

Field Type
reference string
name string
active boolean
primary boolean
user string

Endpoint

https://api.rehive.com/3/admin/accounts/

Create Account

Admin create account request

curl https://api.rehive.com/3/admin/accounts/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"name": "savings",
       "user": "joe@rehive.com",}'
rehive.admin.accounts.create(
{
    name: "savings",
    user: "joe@rehive.com"
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.create(
    name="savings",
    user="joe@rehive.com"
)

Admin create account response

{
    "status": "success",
    "data": {
        "name": "savings",
        "reference": "0000000000",
        "primary": true,
        "currencies": [],
        "archived": false,
        "created": 1501145581365,
        "updated": 1501145581370
    },
}
{
    "name": "savings",
    "reference": "0000000000",
    "primary": true,
    "currencies": [],
    "archived": false,
    "created": 1501145581365,
    "updated": 1501145581370
}
{
    "name": "savings",
    "reference": "0000000000",
    "primary": true,
    "currencies": [],
    "archived": false,
    "created": 1501145581365,
    "updated": 1501145581370
}

Create a account for a user.

Endpoint

https://api.rehive.com/3/admin/accounts/

Required Fields

Field Description Default
name account name null
user account user null

Optional Fields

Field Description Default
reference account reference 10 random chars
primary account primary status false
archived archived state false

Retrieve Account

Admin retrieve account request

curl https://api.rehive.com/3/admin/accounts/{reference}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.get({reference: reference}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.get(
    "{reference}"
)

Admin retrieve account response

{
    "status": "success",
    "data": {
        "name": "default",
        "reference": "0000000000",
        "user": "joe@rehive.com",
        "currencies": [
            {
                "balance": 10000,
                "available_balance": 10000,
                "currency": {
                    "code": "XBT",
                    "description": "bitcoin",
                    "symbol": "???",
                    "unit": "bitcoin",
                    "divisibility": 8
                },
                "limits": [],
                "fees": [],
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                },
                "active": true
            }
        ],
        "archived": false,
        "created": 1464858068745,
        "updated": 1464858068745
    }
}
{
    "name": "default",
    "reference": "0000000000",
    "user": "joe@rehive.com",
    "currencies": [
        {
            "balance": 10000,
            "available_balance": 10000,
            "currency": {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "???",
                "unit": "bitcoin",
                "divisibility": 8
            },
            "limits": [],
            "fees": [],
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            },
            "active": true
        }
    ],
    "archived": false,
    "created": 1464858068745,
    "updated": 1464858068745
}
{
    "name": "default",
    "reference": "0000000000",
    "user": "joe@rehive.com",
    "currencies": [
        {
            "balance": 10000,
            "available_balance": 10000,
            "currency": {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "???",
                "unit": "bitcoin",
                "divisibility": 8
            },
            "limits": [],
            "fees": [],
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            },
            "active": true
        }
    ],
    "archived": false,
    "created": 1464858068745,
    "updated": 1464858068745
}

Retrieve an account belonging to a company.

Filtering

Field Type
active boolean

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/

Update Account

Admin update account request

curl https://api.rehive.com/3/admin/accounts/{reference}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"name": "savings"}'
rehive.admin.accounts.update(reference, {name: "savings"}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.update(
    "{reference}",
    name="savings"
)

Admin update account response

{
    "status": "success",
    "data": {
        "name": "savings",
        "reference": "0000000000",
        "primary": true,
        "currencies": [],
        "archived": false,
        "created": 1501145581365,
        "updated": 1501145581370
    },
}
{
    "name": "savings",
    "reference": "0000000000",
    "primary": true,
    "currencies": [],
    "archived": false,
    "created": 1501145581365,
    "updated": 1501145581370
}
{
    "name": "savings",
    "reference": "0000000000",
    "primary": true,
    "currencies": [],
    "archived": false,
    "created": 1501145581365,
    "updated": 1501145581370
}

Update an account for a user.

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/

Required Fields

Field Description Default
name account name null
user account user null

Optional Fields

Field Description Default
reference account reference 10 random chars
primary account primary status false
archived archived state false

List Account Currencies

Admin list account currencies request

curl https://api.rehive.com/3/accounts/{reference}/currencies/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.get(reference).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.get()

Admin list account currencies response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "balance": 10000,
                "available_balance": 10000,
                "currency": {
                    "code": "XBT",
                    "description": "bitcoin",
                    "symbol": "???",
                    "unit": "bitcoin",
                    "divisibility": 8
                },
                "limits": [],
                "fees": [],
                "active": false,
                "settings": {
                    "allow_transactions": true,
                    "allow_debit_transactions": true,
                    "allow_credit_transactions": true
                },
                "archived": false,
                "created": 1464858068732,
                "updated": 1464858068732
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "balance": 10000,
            "available_balance": 10000,
            "currency": {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "???",
                "unit": "bitcoin",
                "divisibility": 8
            },
            "limits": [],
            "fees": [],
            "active": false,
            "settings": {
                "allow_transactions": true,
                "allow_debit_transactions": true,
                "allow_credit_transactions": true
            },
            "archived": false,
            "created": 1464858068732,
            "updated": 1464858068732e": true
        }
    ]
}
[
    {
        "balance": 10000,
        "available_balance": 10000,
        "currency": {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "???",
            "unit": "bitcoin",
            "divisibility": 8
        },
        "limits": [],
        "fees": [],
        "active": false,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "archived": false,
        "created": 1464858068732,
        "updated": 1464858068732
    }
]

Get a list of currencies for an account belonging to a company.

Filtering

Field Type
active boolean

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/

Retrieve Account Currency

Admin retrieve account currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.get(reference, {code: code}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.get(
    "{code}"
)

Admin retrieve account currency response

{
    "status": "success",
    "data": {
        "balance": 10000,
        "available_balance": 10000,
        "currency": {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "???",
            "unit": "bitcoin",
            "divisibility": 8
        },
        "limits": [],
        "fees": [],
        "active": false,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "archived": false,
        "created": 1464858068732,
        "updated": 1464858068732
    }
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "active": false,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "archived": false,
    "created": 1464858068732,
    "updated": 1464858068732
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "active": false,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "archived": false,
    "created": 1464858068732,
    "updated": 1464858068732
}

Retrieve an account’s currency belonging to a company.

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}

Update Account Currency

Admin retrieve account currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"active": true}'
rehive.admin.accounts.currencies.update(reference, code, {active: true}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.update(
    "{code}",
    active=True
)

Admin retrieve account currency response

{
    "status": "success",
    "data": {
        "balance": 10000,
        "available_balance": 10000,
        "currency": {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "???",
            "unit": "bitcoin",
            "divisibility": 8
        },
        "limits": [],
        "fees": [],
        "active": false,
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true
        },
        "archived": false,
        "created": 1464858068732,
        "updated": 1464858068732
    }
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "active": false,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "archived": false,
    "created": 1464858068732,
    "updated": 1464858068732
}
{
    "balance": 10000,
    "available_balance": 10000,
    "currency": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8
    },
    "limits": [],
    "fees": [],
    "active": false,
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    },
    "archived": false,
    "created": 1464858068732,
    "updated": 1464858068732
}

Update the active status of an account currency. Activating an account’s currency will result in that currency getting used by default for all transactions if no other account/currency is specified.

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/

Optional Fields

Field Description Default
active is active currency false

Retrieve Account Currency Settings

Admin retrieve account currency settings request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/settings/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.settings.get(reference,code).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj({code}).settings.get()

Admin retrieve account currency settings response

{
    "status": "success",
    "data": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}

Retrieve an account’s currency’s settings.

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/settings/

Update Account Currency Settings

Admin update account currency settings request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/settings/
  -X PUT
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"allow_transactions": true}'
rehive.admin.accounts.currencies.settings.update(reference, code, {allow_transactions: true}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj({code}).settings.update(
    allow_credit_transactions=True
)

Admin retrieve account currency settings response

{
    "status": "success",
    "data": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true
    }
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true
}

Update the settings of an acocunt currency.

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/settings/

Optional Fields

Field Description Default
allow_transactions Allow transactions true
allow_debit_transactions Allow debit transactions true
allow_credit_transactions Allow credit transactions true

List Account Currency Limits

List all Limits related to am account currency.

List Account Currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.limits.get(reference, code).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").limits.get()

List Account Currency Limits response

{
    "data": [
        {
            "id": 1,
            "value": 1000,
            "type": "Maximum",
            "tx_type": "credit",
            "subtype": null,
            "archived": false,
            "created": 1497428787920,
            "updated": 1497428787921
        }
    ],
    "status": "success"
}
[
    {
        "id": 1,
        "value": 1000,
        "type": "Maximum",
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497428787920,
        "updated": 1497428787921
    }
]
[
    {
        "id": 1,
        "value": 1000,
        "type": "Maximum",
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497428787920,
        "updated": 1497428787921
    }
]

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/

Create Account Currency Limit

Create a new limit related to an account currency.

Create Account Currency Limit request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"value": 1000,
       "type": "max",
       "tx_type": "credit"}'
rehive.admin.accounts.currencies.limits.create(reference, code, {
    tx_type: tx_type,
    value: value,
    type: type,
    subtype: subtype
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").limits.create(
    value=1000,
    type="max",
    tx_type="credit"
)

Create Account Currency response

{
    "data": {
        "id": 1,
        "value": 1000,
        "type": "Maximum",
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497428787920,
        "updated": 1497428787921
    },
    "status": "success"
}
{
    "id": 1,
    "value": 1000,
    "type": "Maximum",
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497428787920,
    "updated": 1497428787921
}
{
    "id": 1,
    "value": 1000,
    "type": "Maximum",
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497428787920,
    "updated": 1497428787921
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/

Required Fields

Field Description Default
value Limit value 0
type Limit Type
tx_type Transaction type limits are applied

Optional Fields

Field Description Default
subtype Transaction subtype name null
archived archived state false

Limit Types

Value Description
max Maximum
day_max Maximum per day
month_max Maximum per month
min Minimum
overdraft Overdraft

Transaction Types

Value Description
credit Credit
debit Debit

Retrieve Account Currency Limit

Retrieve a specific requirement related to an account currency.

Retrieve Account Currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/{limit_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.limits.get(reference, code, {id: limitId}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").limits.get(
    "{limit_id}"
)

Retrieve Account Currency Limit response

{
    "data": {
        "id": 1,
        "value": 1000,
        "type": "Maximum",
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497428787920,
        "updated": 1497428787921
    },
    "status": "success"
}
{
    "id": 1,
    "value": 1000,
    "type": "Maximum",
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497428787920,
    "updated": 1497428787921
}
 {
    "id": 1,
    "value": 1000,
    "type": "Maximum",
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497428787920,
    "updated": 1497428787921
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/{limit_id}/

Update Account Currency Limit

Update a specific limits related to an account currency.

Update Account Currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/{limit_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"value": 5000,
       "type": "min"}'
rehive.admin.accounts.currencies.limits.update(reference, code, limitId,
{
    value: 5000,
    type: "min"
}).then(function (res) {
   ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").limits.update(
    "{limit_id}",
    value=500,
    type="min"
)

Update Account Currency response

{
    "status": "success",
    "data": {
        "id": 1,
        "value": 5000,
        "type": "Minimum",
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497428787920,
        "updated": 1497429648948
    }
}
{
    "id": 1,
    "value": 5000,
    "type": "Minimum",
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497428787920,
    "updated": 1497429648948
}
{
    "id": 1,
    "value": 5000,
    "type": "Minimum",
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497428787920,
    "updated": 1497429648948
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/{limit_id}/

Required Fields

Field Description Default
value Limit value 0
type Limit Type
tx_type Transaction type limits are applied

Optional Fields

Field Description Default
subtype Transaction subtype name null
archived archived state false

Limit Types

Value Description
max Maximum
day_max Maximum per day
month_max Maximum per month
min Minimum
overdraft Overdraft

Transaction Types

Value Description
credit Credit
debit Debit

Delete Account Currency Limit

Delete a specific limits related to an account currency.

Delete Account Currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/{limit_id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.limits.delete(reference, code, limitId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").limits.delete(
    "{limit_id}"
)

Delete Account Currency response

{
    "status": "success",
}
{}
{
    "status": "success",
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/limits/{limit_id}/

List Account Currency Fees

List all fees related to am account currency.

List Account Currency Fees request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.fees.get(reference, code).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").fees.get()

List Account Currency Fees response

{
    "data": [
        {
            "id": 1,
            "value": 1000,
            "percentage": null,
            "tx_type": "credit",
            "subtype": null,
            "archived": false,
            "created": 1497431721587,
            "updated": 1497431721587
        }
    ],
    "status": "success"
}
[
    {
        "id": 1,
        "value": 1000,
        "percentage": null,
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431721587
    }
]
[
    {
        "id": 1,
        "value": 1000,
        "percentage": null,
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431721587
    }
]

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/

Create Account Currency Fee

Create a new fee related to an account currency.

Create Account Currency Fee request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"value": 1000,
       "tx_type": "credit"}'
rehive.admin.accounts.currencies.fees.create(reference, code, {
    tx_type: "credit",
    value: 1000
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").fees.create(
    value=1000,
    tx_type="credit"
)

Create Account Currency Fee response

{
    "data": {
        "id": 1,
        "value": 1000,
        "percentage": null,
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431721587
    },
    "status": "success"
}
{
    "id": 1,
    "value": 1000,
    "percentage": null,
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431721587
}
{
    "id": 1,
    "value": 1000,
    "percentage": null,
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431721587
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/

Required Fields

Field Description Default
tx_type Transaction type fees are applied

Optional Fields

Field Description Default
value Fee amount 0
percentage Percentage amount
subtype Transaction subtype name null
archived archived state false

Transaction Types

Value Description
credit Credit
debit Debit

Retrieve Account Currency fee

Retrieve a specific requirement related to an account currency.

Retrieve Account Currency Fee request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/{fee_id}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.fees.get(reference, code, {id: feeId}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").fees.get(
    "{fee_id}"
)

Retrieve Account Currency fee response

{
    "data": {
        "id": 1,
        "value": 1000,
        "percentage": null,
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431721587
    },
    "status": "success"
}
{
    "id": 1,
    "value": 1000,
    "percentage": null,
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431721587
}
{
    "id": 1,
    "value": 1000,
    "percentage": null,
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431721587
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/{fee_id}/

Update Account Currency Fee

Update a specific fees related to an account currency.

Update Account Currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/{fee_id}/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"value": 5000}'
rehive.admin.accounts.currencies.fees.update(reference, code, feeId, data).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").fees.update(
    "{fee_id}",
    value=5000
)

Update Account Currency response

{
    "data": {
        "id": 1,
        "value": 5000,
        "percentage": null,
        "tx_type": "credit",
        "subtype": null,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431938971
    },
    "status": "success"
}
{
    "id": 1,
    "value": 5000,
    "percentage": null,
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}
{
    "id": 1,
    "value": 5000,
    "percentage": null,
    "tx_type": "credit",
    "subtype": null,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/{fee_id}/

Required Fields

Field Description Default
tx_type Transaction type fees are applied

Optional Fields

Field Description Default
value Fee amount 0
percentage Percentage amount
subtype Transaction subtype name null
archived archived state false

Transaction Types

Value Description
credit Credit
debit Debit

Delete Account Currency Fee

Delete a specific fees related to an account currency.

Delete Account Currency request

curl https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/{fee_id}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.accounts.currencies.fees.delete(reference, code, feeId).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.accounts.obj("{reference}").currencies.obj("{code}").fees.delete(
    "{fee_id}"
)

Delete Account Currency response

{
    "status": "success"
}
{}
{
    "status": "success"
}

Endpoint

https://api.rehive.com/3/admin/accounts/{reference}/currencies/{code}/fees/{fee_id}/

Currencies

List Currencies

Admin list currencies request

curl https://api.rehive.com/3/admin/currencies/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.currencies.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.currencies.get()

Admin list currencies response

{
    "status": "success",
    "data": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
            {
                "code": "XBT",
                "description": "bitcoin",
                "symbol": "???",
                "unit": "bitcoin",
                "divisibility": 8,
                "archived": false,
                "created": 1497431721587,
                "updated": 1497431938971
            }
        ]
    }
}
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "code": "XBT",
            "description": "bitcoin",
            "symbol": "???",
            "unit": "bitcoin",
            "divisibility": 8,
            "archived": false,
            "created": 1497431721587,
            "updated": 1497431938971
        }
    ]
}
[
    {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431938971
    }
]

Get a list of all existing currencies. This includes default Rehive currencies as well as any currencies added by the company.

Endpoint

https://api.rehive.com/3/admin/currencies/

Create Currency

Admin create currency request

curl https://api.rehive.com/3/admin/currencies/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8}'
rehive.admin.currencies.create(
{
    code: "XBT",
    description: "bitcoin",
    symbol: "???",
    unit: "bitcoin",
    divisibility: 8
}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.currencies.create(
    code="XBT",
    description="bitcoin",
    symbol="???",
    unit="satoshi",
    divisibility=8
)

Admin create currency response

 {
    "status": "success",
    "data": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431938971
    }
}
{
    "code": "XBT",
    "description": "bitcoin",
    "symbol": "???",
    "unit": "bitcoin",
    "divisibility": 8,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}
{
    "code": "XBT",
    "description": "bitcoin",
    "symbol": "???",
    "unit": "bitcoin",
    "divisibility": 8,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}

Create a custom currency.

Endpoint

https://api.rehive.com/3/admin/currencies/

Required Fields

Field Description Default
code currency code null
description name of currency null
symbol currency symbol null
unit unit, like dollar null
divisibility number of decimal places 0
archived archived state false

Retrieve Currency

Admin retrieve currency request

curl https://api.rehive.com/3/admin/currencies/{code}/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.currencies.get({code: code}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.currencies.get("{code}")

Admin retrieve currency response

{
    "status": "success",
    "data": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431938971
    }
}
{
    "code": "XBT",
    "description": "bitcoin",
    "symbol": "???",
    "unit": "bitcoin",
    "divisibility": 8,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}
{
    "code": "XBT",
    "description": "bitcoin",
    "symbol": "???",
    "unit": "bitcoin",
    "divisibility": 8,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}

Retrieve a currencies details.

Endpoint

https://api.rehive.com/3/admin/currencies/{code}/

Update Currency

Admin update currency request

curl https://api.rehive.com/3/admin/currencies/{code}/
  -X POST
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -d '{"unit": "bitcoin"}'
rehive.admin.currencies.update(code, {unit: "bitcoin"}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.currencies.update(
    "{code}",
    unit="bitcoin"
)

Admin update currency response

 {
    "status": "success",
    "data": {
        "code": "XBT",
        "description": "bitcoin",
        "symbol": "???",
        "unit": "bitcoin",
        "divisibility": 8,
        "archived": false,
        "created": 1497431721587,
        "updated": 1497431938971
    }
}
{
    "code": "XBT",
    "description": "bitcoin",
    "symbol": "???",
    "unit": "bitcoin",
    "divisibility": 8,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}
{
    "code": "XBT",
    "description": "bitcoin",
    "symbol": "???",
    "unit": "bitcoin",
    "divisibility": 8,
    "archived": false,
    "created": 1497431721587,
    "updated": 1497431938971
}

This endpoint can be used to enable an existing currency or if it is a custom currency, edit its details.

Endpoint

https://api.rehive.com/3/admin/currencies/{code}/

Required Fields

Field Description Default
code currency code null
description name of currency null
symbol currency symbol null
unit unit, like dollar null
divisibility number of decimal places 0
archived archived state false

Delete Currency

Admin delete currency request

curl https://api.rehive.com/3/admin/currencies/{code}/
  -X DELETE
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.currencies.delete(code).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.currencies.delete(
    "{code}"
)

Admin delete currency response

{
    "status": "success"
}
{}
{
    "status": "success"
}

This endpoint can be used to delete custom currencies.

Endpoint

https://api.rehive.com/3/admin/currencies/{code}/

Currency Overview

Admin currency overview request

curl https://api.rehive.com/3/admin/currencies/{code}/overview/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.currencies.overview.get(code).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.currencies.obj({code}).overview.get()

Admin currency overview response

{
    "data": {
        "balance_total": 0,
        "available_balance_total": 0,
        "balance_24h": 0,
        "count_total": 0,
        "count_24h": 0,
        "count_debits_pending": 0,
        "count_debits_complete": 0,
        "count_credits_pending": 0,
        "count_credits_complete": 0,
        "sum_debits_pending": 0,
        "sum_debits_complete": 0,
        "sum_credits_pending": 0,
        "sum_credits_complete": 0,
        "sum_24h_debits_pending": 0,
        "sum_24h_debits_complete": 0,
        "sum_24h_credits_pending": 0,
        "sum_24h_credits_complete": 0
    },
    "status": "success"
}
{
    "balance_total": 0,
    "available_balance_total": 0,
    "balance_24h": 0,
    "count_total": 0,
    "count_24h": 0,
    "count_debits_pending": 0,
    "count_debits_complete": 0,
    "count_credits_pending": 0,
    "count_credits_complete": 0,
    "sum_debits_pending": 0,
    "sum_debits_complete": 0,
    "sum_credits_pending": 0,
    "sum_credits_complete": 0,
    "sum_24h_debits_pending": 0,
    "sum_24h_debits_complete": 0,
    "sum_24h_credits_pending": 0,
    "sum_24h_credits_complete": 0
}
{
    "balance_total": 0,
    "available_balance_total": 0,
    "balance_24h": 0,
    "count_total": 0,
    "count_24h": 0,
    "count_debits_pending": 0,
    "count_debits_complete": 0,
    "count_credits_pending": 0,
    "count_credits_complete": 0,
    "sum_debits_pending": 0,
    "sum_debits_complete": 0,
    "sum_credits_pending": 0,
    "sum_credits_complete": 0,
    "sum_24h_debits_pending": 0,
    "sum_24h_debits_complete": 0,
    "sum_24h_credits_pending": 0,
    "sum_24h_credits_complete": 0
}

Get an overview of the selected currency’s transactions.

Endpoint

https://api.rehive.com/3/admin/currencies/{code}/overview/

Company

Retrieve Company

View the company info

curl https://api.rehive.com/3/admin/company/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.company.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.company.get()

Company info response

{
    "status": "success",
    "data": {
        "id": "rehive",
        "name": "Rehive",
        "description": "Wallets for everyone.",
        "website": "http://www.rehive.com",
        "email": null,
        "logo": "https://path.to.file.com/image.png",
        "address": {
            "line_1": "1 First Avenue",
            "line_2": "",
            "city": "Cape Town",
            "state_province": "Western Cape",
            "country": "ZA",
            "postal_code": "8001"
        },
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true,
            "require_verification": false,
            "allow_registrations": true,
            "allow_overdrafts": false,
            "allow_session_durations": false,
            "require_terms_and_conditions": false,
            "default_transaction_status": "Pending",
            "password_reset_url": "",
            "password_set_url": "",
            "email_confirmation_url": "",
            "nationalities": []
        },
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": "test_company",
    "name": "Test Company 1",
    "description": "A Test Company.",
    "website": "http://www.test_company.com",
    "logo": "https://www.test_company.com/logo.jpg",
    "address": {
        // ...
    },
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": true,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "auto_complete_transactions": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "password_reset_url": null,
        "email_confirmation_url": null,
        "nationalities": []
    },
    "created": 1497431721587,
    "updated": 1497431938971
}
{
    "id": "test_company",
    "name": "Test Company 1",
    "description": "A Test Company.",
    "website": "http://www.test_company.com",
    "logo": "https://www.test_company.com/logo.jpg",
    "address": {
        # ...
    },
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": true,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "auto_complete_transactions": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "password_reset_url": null,
        "email_confirmation_url": null,
        "nationalities": []
    },
    "created": 1497431721587,
    "updated": 1497431938971
}

Retrieve the company info.

Endpoint

https://api.rehive.com/3/admin/company/

Update Company

Update company info

curl https://api.rehive.com/3/admin/company/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"description": "A new description"}'
rehive.admin.company.update({description: "A new description"}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.company.update(
    description="A new description"
)

Update company info response

{
    "status": "success",
    "data": {
        "id": "rehive",
        "name": "Rehive",
        "description": "Wallets for everyone.",
        "website": "http://www.rehive.com",
        "email": null,
        "logo": "https://path.to.file.com/image.png",
        "address": {
            "line_1": "1 First Avenue",
            "line_2": "",
            "city": "Cape Town",
            "state_province": "Western Cape",
            "country": "ZA",
            "postal_code": "8001"
        },
        "settings": {
            "allow_transactions": true,
            "allow_debit_transactions": true,
            "allow_credit_transactions": true,
            "require_verification": false,
            "allow_registrations": true,
            "allow_overdrafts": false,
            "allow_session_durations": false,
            "require_terms_and_conditions": false,
            "default_transaction_status": "Pending",
            "password_reset_url": "",
            "password_set_url": "",
            "email_confirmation_url": "",
            "nationalities": []
        },
        "created": 1516281408895,
        "updated": 1528454842365
    }
}
{
    "id": "test_company",
    "name": "Test Company 1",
    "description": "A Test Company.",
    "website": "http://www.test_company.com",
    "logo": "https://www.test_company.com/logo.jpg",
    "address": {
        // ...
    },
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": true,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "auto_complete_transactions": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "password_reset_url": null,
        "email_confirmation_url": null,
        "nationalities": []
    },
    "created": 1497431721587,
    "updated": 1497431938971
}
{
    "id": "test_company",
    "name": "Test Company 1",
    "description": "A new description",
    "website": "http://www.test_company.com",
    "logo": "https://www.test_company.com/logo.jpg",
    "address": {
        // ...
    },
    "settings": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": true,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "auto_complete_transactions": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "password_reset_url": null,
        "email_confirmation_url": null,
        "nationalities": []
    },
    "created": 1497431721587,
    "updated": 1497431938971
}

Retrieve the company info.

Endpoint

https://api.rehive.com/3/admin/company/

Optional Fields

Field Description Default
name Company Name blank
description Company Description blank
website Company website URL blank
logo Company logo URL blank

Company Settings

Retrieve Company Settings

View the company settings

curl https://api.rehive.com/3/admin/company/settings/
  -X GET
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
rehive.admin.company.settings.get().then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.company.settings.get()

Company settings response

{
    "status": "success",
    "data": {
        "allow_transactions": true,
        "allow_debit_transactions": true,
        "allow_credit_transactions": true,
        "require_verification": true,
        "allow_registrations": true,
        "allow_overdrafts": false,
        "auto_complete_transactions": false,
        "allow_session_durations": false,
        "require_terms_and_conditions": false,
        "password_reset_url": null,
        "email_confirmation_url": null,
        "nationalities": []
    }
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true,
    "require_verification": true,
    "allow_registrations": true,
    "allow_overdrafts": false,
    "auto_complete_transactions": false,
    "allow_session_durations": false,
    "require_terms_and_conditions": false,
    "password_reset_url": null,
    "email_confirmation_url": null,
    "nationalities": []
}
{
    "allow_transactions": true,
    "allow_debit_transactions": true,
    "allow_credit_transactions": true,
    "require_verification": true,
    "allow_registrations": true,
    "allow_overdrafts": false,
    "auto_complete_transactions": false,
    "allow_session_durations": false,
    "require_terms_and_conditions": false,
    "password_reset_url": null,
    "email_confirmation_url": null,
    "nationalities": []
}

Retrieve the company settings.

Endpoint

https://api.rehive.com/3/admin/company/settings/

Update Company Settings

Update company settings

curl https://api.rehive.com/3/admin/company/settings/
  -X PATCH
  -H "Authorization: Token {token}"
  -H "Content-Type: application/json"
  -D '{"allow_transactions": true}'
rehive.admin.company.settings.update({allow_transactions: true}).then(function (res) {
    ...
}, function (err) {
    ...
});
rehive.admin.company.settings.update(
    allow_transactions=True
)

Update company settings response

{
    "allow_transactions": true,
    "allow_debit_transactio