NAV navbar
logo

Tokes Payments API Documentation

version 0.0.1
baseUri https://payments.tokesplatform.org/api
protocols HTTPS
mediaType application/json

Tokes Payments API

Tokes Payments API documentation

The Payments API is the primary method to use Tokes Payments processing services. Tokes Payments facilitates transactions using digital assets, by:

  • Price conversion from USD to e.g. BTC, LTC, Dash, Waves, TKS and other digital assets,
  • Trade processing based on your digital asset portfolio allocation settings,

Tokes Payments API is accessible directly or through the various interfaces, in the form of: a Point-Of-Sale software, a web components, a mobile Wallet, transaction explorer, API clients. Read more about integration below.

Quick Start

To start using Tokes Payments API, complete these steps:

  1. Obtain an API key through Tokes Gateway
  2. Pass the KYC review process, either via the Gateway or direct API calls
  3. Start processing payments!

Authentication

Access to these endpoints are enabled by activating API Access from the Accounting subview while logged into your account through the Tokes Merchant Gateway.

You will be provided a Secret API Key to use for all requests (Header { accesskey: Secret Key }).

POST calls require an application/json format.

Server: https://payments.tokesplatform.org/api

Integrating Payments-API to process payments

You can integrate with Payments-API in multiple ways:

  1. Calling the API directly
  2. Using the npm module (for browser and Node.js)
  3. Using the web component, which can be integrated into any front-end app
  4. Using a dedicated module for external products, like the Shopify module

Integration schema

Payment Requests

Generate orders, payment addresses, lookup order states or account data.

Receipts

Receipts are simple text fields, used as references to the products that are being paid for

Orders

Payment requests can be bundled with receipts. Such a bundle is represented as an Order.

Types

User


Properties

TYPE DEFINITION

{
  "name": "User",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "name": "id",
      "displayName": "id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "id"
    },
    "tenant_id": {
      "type": "string",
      "name": "tenant_id",
      "displayName": "tenant_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "tenant_id"
    },
    "first_name": {
      "type": "string",
      "name": "first_name",
      "displayName": "first_name",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "first_name"
    },
    "last_name": {
      "type": "string",
      "name": "last_name",
      "displayName": "last_name",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "last_name"
    },
    "email": {
      "type": "string",
      "name": "email",
      "displayName": "email",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "email"
    },
    "withdrawal_address": {
      "type": "string",
      "name": "withdrawal_address",
      "displayName": "withdrawal_address",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "withdrawal_address"
    },
    "api_key": {
      "type": "string",
      "name": "api_key",
      "displayName": "api_key",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "api_key"
    },
    "api_seed": {
      "type": "string",
      "name": "api_seed",
      "displayName": "api_seed",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "api_seed"
    },
    "api_enabled": {
      "type": "boolean",
      "name": "api_enabled",
      "displayName": "api_enabled",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "api_enabled"
    }
  }
}

TYPE EXAMPLE

{
  "id": "5bcb6bb75423c8001fb95fd2",
  "tenant_id": "5bcb6bb75423c8001fb95fd2",
  "email": "test@test.com",
  "first_name": "Test",
  "last_name": "User",
  "withdrawal_address": "3PGAv1cZXN93UHd4oZy24WQ9j8GGiVs8HJU",
  "api_key": "83f20b4d1e91f22b678264815f42x413ae84d13b9a2ec01261a6b0ff530f",
  "api_seed": "1540058039624",
  "api_enabled": true
}

UserCreate


Properties

TYPE DEFINITION

{
  "name": "UserCreate",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "name": "success",
      "displayName": "success",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "success"
    },
    "message": {
      "type": "string",
      "name": "message",
      "displayName": "message",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "message"
    },
    "user_id": {
      "type": "string",
      "name": "user_id",
      "displayName": "user_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "user_id"
    },
    "api_key": {
      "type": "string",
      "name": "api_key",
      "displayName": "api_key",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "api_key"
    }
  }
}

TYPE EXAMPLE

{
  "success": true,
  "user_id": "5bcb6bb75423c8001fb95fd2",
  "api_key": "83f20b4d1e91f22b678264815f42x413ae84d13b9a2ec01261a6b0ff530f",
  "message": "Successfully created merchant"
}

Payment


Properties

TYPE DEFINITION

{
  "name": "Payment",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "name": "id",
      "displayName": "id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "id"
    },
    "order_id": {
      "type": "string",
      "name": "order_id",
      "displayName": "order_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "order_id"
    },
    "payment_status_id": {
      "type": "number",
      "name": "payment_status_id",
      "displayName": "payment_status_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "payment_status_id"
    },
    "payee_id": {
      "type": "string",
      "name": "payee_id",
      "displayName": "payee_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "payee_id"
    },
    "gross_amount": {
      "type": "number",
      "name": "gross_amount",
      "displayName": "gross_amount",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "gross_amount"
    },
    "payment_address": {
      "type": "string",
      "name": "payment_address",
      "displayName": "payment_address",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "payment_address"
    }
  }
}

TYPE EXAMPLE

{
  "id": "5bc572971e93c9002a5a28ea",
  "order_id": "5bc572961e93c9002a5a28e9",
  "payment_status_id": 0,
  "payee_id": "5bc4ef442f7727001f5ed168",
  "gross_amount": 2184167,
  "payment_address": "3PFBuqcdhYG42MpJ5iUdBiHjymp12JxV8LV"
}

Order


Properties

TYPE DEFINITION

{
  "name": "Order",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "name": "id",
      "displayName": "id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "id"
    },
    "user_id": {
      "type": "string",
      "name": "user_id",
      "displayName": "user_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "user_id"
    },
    "order_status_id": {
      "type": "number",
      "name": "order_status_id",
      "displayName": "order_status_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "order_status_id"
    },
    "total": {
      "type": "number",
      "name": "total",
      "displayName": "total",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "total"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": []
      },
      "name": "items",
      "displayName": "items",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "items"
    },
    "subtotal": {
      "type": "number",
      "name": "subtotal",
      "displayName": "subtotal",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "subtotal"
    },
    "tax": {
      "type": "number",
      "name": "tax",
      "displayName": "tax",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "tax"
    },
    "reference_id": {
      "type": "string",
      "name": "reference_id",
      "displayName": "reference_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "reference_id"
    },
    "total_tks": {
      "type": "string",
      "name": "total_tks",
      "displayName": "total_tks",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "total_tks"
    },
    "total_btc": {
      "type": "string",
      "name": "total_btc",
      "displayName": "total_btc",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "total_btc"
    },
    "from_currency": {
      "type": "string",
      "name": "from_currency",
      "displayName": "from_currency",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "from_currency"
    },
    "to_currency": {
      "type": "string",
      "name": "to_currency",
      "displayName": "to_currency",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "to_currency"
    }
  }
}

TYPE EXAMPLE

{
  "id": "5bc572961e93c9002a5a28e9",
  "user_id": "5bc4ef442f7727001f5ed168",
  "order_status_id": 1,
  "total": 0.01,
  "items": [
      {
          "name": "Example Product",
          "price": 0.01
      }
  ],
  "subtotal": 0.01,
  "tax": 0,
  "reference_id": "66703781696224718505978432442928",
  "total_tks": "0.02184167",
  "total_btc": "0.00000149",
  "from_currency": "USD",
  "to_currency": "TKS"
}

OrderCreate


Properties

TYPE DEFINITION

{
  "name": "OrderCreate",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "name": "success",
      "displayName": "success",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "success"
    },
    "message": {
      "type": "string",
      "name": "message",
      "displayName": "message",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "message"
    },
    "order": {
      "type": "object",
      "properties": [
        {
          "type": "string",
          "name": "id",
          "displayName": "id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "id"
        },
        {
          "type": "string",
          "name": "user_id",
          "displayName": "user_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "user_id"
        },
        {
          "type": "number",
          "name": "order_status_id",
          "displayName": "order_status_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "order_status_id"
        },
        {
          "type": "number",
          "name": "total",
          "displayName": "total",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "total"
        },
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": []
          },
          "name": "items",
          "displayName": "items",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "items"
        },
        {
          "type": "number",
          "name": "subtotal",
          "displayName": "subtotal",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "subtotal"
        },
        {
          "type": "number",
          "name": "tax",
          "displayName": "tax",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "tax"
        },
        {
          "type": "string",
          "name": "reference_id",
          "displayName": "reference_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "reference_id"
        },
        {
          "type": "string",
          "name": "total_tks",
          "displayName": "total_tks",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "total_tks"
        },
        {
          "type": "string",
          "name": "total_btc",
          "displayName": "total_btc",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "total_btc"
        },
        {
          "type": "string",
          "name": "from_currency",
          "displayName": "from_currency",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "from_currency"
        },
        {
          "type": "string",
          "name": "to_currency",
          "displayName": "to_currency",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "to_currency"
        }
      ],
      "name": "order",
      "displayName": "order",
      "typePropertyKind": "INPLACE",
      "additionalProperties": true,
      "required": true,
      "examples": [
        {
          "value": "{\n  \"id\": \"5bc572961e93c9002a5a28e9\",\n  \"user_id\": \"5bc4ef442f7727001f5ed168\",\n  \"order_status_id\": 1,\n  \"total\": 0.01,\n  \"items\": [\n      {\n          \"name\": \"Example Product\",\n          \"price\": 0.01\n      }\n  ],\n  \"subtotal\": 0.01,\n  \"tax\": 0,\n  \"reference_id\": \"66703781696224718505978432442928\",\n  \"total_tks\": \"0.02184167\",\n  \"total_btc\": \"0.00000149\",\n  \"from_currency\": \"USD\",\n  \"to_currency\": \"TKS\"\n}\n",
          "strict": true,
          "name": null,
          "structuredValue": {
            "id": "5bc572961e93c9002a5a28e9",
            "user_id": "5bc4ef442f7727001f5ed168",
            "order_status_id": 1,
            "total": 0.01,
            "items": [
              {
                "name": "Example Product",
                "price": 0.01
              }
            ],
            "subtotal": 0.01,
            "tax": 0,
            "reference_id": "66703781696224718505978432442928",
            "total_tks": "0.02184167",
            "total_btc": "0.00000149",
            "from_currency": "USD",
            "to_currency": "TKS"
          }
        }
      ],
      "key": "order"
    },
    "payment": {
      "type": "object",
      "properties": [
        {
          "type": "string",
          "name": "id",
          "displayName": "id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "id"
        },
        {
          "type": "string",
          "name": "order_id",
          "displayName": "order_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "order_id"
        },
        {
          "type": "number",
          "name": "payment_status_id",
          "displayName": "payment_status_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "payment_status_id"
        },
        {
          "type": "string",
          "name": "payee_id",
          "displayName": "payee_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "payee_id"
        },
        {
          "type": "number",
          "name": "gross_amount",
          "displayName": "gross_amount",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "gross_amount"
        },
        {
          "type": "string",
          "name": "payment_address",
          "displayName": "payment_address",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "payment_address"
        }
      ],
      "name": "payment",
      "displayName": "payment",
      "typePropertyKind": "INPLACE",
      "additionalProperties": true,
      "required": true,
      "examples": [
        {
          "value": "{\n  \"id\": \"5bc572971e93c9002a5a28ea\",\n  \"order_id\": \"5bc572961e93c9002a5a28e9\",\n  \"payment_status_id\": 0,\n  \"payee_id\": \"5bc4ef442f7727001f5ed168\",\n  \"gross_amount\": 2184167,\n  \"payment_address\": \"3PFBuqcdhYG42MpJ5iUdBiHjymp12JxV8LV\"\n}\n",
          "strict": true,
          "name": null,
          "structuredValue": {
            "id": "5bc572971e93c9002a5a28ea",
            "order_id": "5bc572961e93c9002a5a28e9",
            "payment_status_id": 0,
            "payee_id": "5bc4ef442f7727001f5ed168",
            "gross_amount": 2184167,
            "payment_address": "3PFBuqcdhYG42MpJ5iUdBiHjymp12JxV8LV"
          }
        }
      ],
      "key": "payment"
    }
  }
}

Receipt


Properties

TYPE DEFINITION

{
  "name": "Receipt",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "name": "success",
      "displayName": "success",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "success"
    },
    "order": {
      "type": "object",
      "properties": [
        {
          "type": "string",
          "name": "id",
          "displayName": "id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "id"
        },
        {
          "type": "string",
          "name": "user_id",
          "displayName": "user_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "user_id"
        },
        {
          "type": "number",
          "name": "order_status_id",
          "displayName": "order_status_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "order_status_id"
        },
        {
          "type": "number",
          "name": "total",
          "displayName": "total",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "total"
        },
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": []
          },
          "name": "items",
          "displayName": "items",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "items"
        },
        {
          "type": "number",
          "name": "subtotal",
          "displayName": "subtotal",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "subtotal"
        },
        {
          "type": "number",
          "name": "tax",
          "displayName": "tax",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "tax"
        },
        {
          "type": "string",
          "name": "reference_id",
          "displayName": "reference_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "reference_id"
        },
        {
          "type": "string",
          "name": "total_tks",
          "displayName": "total_tks",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "total_tks"
        },
        {
          "type": "string",
          "name": "total_btc",
          "displayName": "total_btc",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "total_btc"
        },
        {
          "type": "string",
          "name": "from_currency",
          "displayName": "from_currency",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "from_currency"
        },
        {
          "type": "string",
          "name": "to_currency",
          "displayName": "to_currency",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "to_currency"
        }
      ],
      "name": "order",
      "displayName": "order",
      "typePropertyKind": "INPLACE",
      "additionalProperties": true,
      "required": true,
      "examples": [
        {
          "value": "{\n  \"id\": \"5bc572961e93c9002a5a28e9\",\n  \"user_id\": \"5bc4ef442f7727001f5ed168\",\n  \"order_status_id\": 1,\n  \"total\": 0.01,\n  \"items\": [\n      {\n          \"name\": \"Example Product\",\n          \"price\": 0.01\n      }\n  ],\n  \"subtotal\": 0.01,\n  \"tax\": 0,\n  \"reference_id\": \"66703781696224718505978432442928\",\n  \"total_tks\": \"0.02184167\",\n  \"total_btc\": \"0.00000149\",\n  \"from_currency\": \"USD\",\n  \"to_currency\": \"TKS\"\n}\n",
          "strict": true,
          "name": null,
          "structuredValue": {
            "id": "5bc572961e93c9002a5a28e9",
            "user_id": "5bc4ef442f7727001f5ed168",
            "order_status_id": 1,
            "total": 0.01,
            "items": [
              {
                "name": "Example Product",
                "price": 0.01
              }
            ],
            "subtotal": 0.01,
            "tax": 0,
            "reference_id": "66703781696224718505978432442928",
            "total_tks": "0.02184167",
            "total_btc": "0.00000149",
            "from_currency": "USD",
            "to_currency": "TKS"
          }
        }
      ],
      "key": "order"
    },
    "payment": {
      "type": "object",
      "properties": [
        {
          "type": "string",
          "name": "id",
          "displayName": "id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "id"
        },
        {
          "type": "string",
          "name": "order_id",
          "displayName": "order_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "order_id"
        },
        {
          "type": "number",
          "name": "payment_status_id",
          "displayName": "payment_status_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "payment_status_id"
        },
        {
          "type": "string",
          "name": "payee_id",
          "displayName": "payee_id",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "payee_id"
        },
        {
          "type": "number",
          "name": "gross_amount",
          "displayName": "gross_amount",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "gross_amount"
        },
        {
          "type": "string",
          "name": "payment_address",
          "displayName": "payment_address",
          "typePropertyKind": "TYPE_EXPRESSION",
          "required": true,
          "key": "payment_address"
        }
      ],
      "name": "payment",
      "displayName": "payment",
      "typePropertyKind": "INPLACE",
      "additionalProperties": true,
      "required": true,
      "examples": [
        {
          "value": "{\n  \"id\": \"5bc572971e93c9002a5a28ea\",\n  \"order_id\": \"5bc572961e93c9002a5a28e9\",\n  \"payment_status_id\": 0,\n  \"payee_id\": \"5bc4ef442f7727001f5ed168\",\n  \"gross_amount\": 2184167,\n  \"payment_address\": \"3PFBuqcdhYG42MpJ5iUdBiHjymp12JxV8LV\"\n}\n",
          "strict": true,
          "name": null,
          "structuredValue": {
            "id": "5bc572971e93c9002a5a28ea",
            "order_id": "5bc572961e93c9002a5a28e9",
            "payment_status_id": 0,
            "payee_id": "5bc4ef442f7727001f5ed168",
            "gross_amount": 2184167,
            "payment_address": "3PFBuqcdhYG42MpJ5iUdBiHjymp12JxV8LV"
          }
        }
      ],
      "key": "payment"
    }
  }
}

Test


Properties

TYPE DEFINITION

{
  "name": "Test",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "name": "success",
      "displayName": "success",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "success"
    },
    "message": {
      "type": "string",
      "name": "message",
      "displayName": "message",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "message"
    }
  }
}

TYPE EXAMPLE

{
  "success": true,
  "message": "Valid API key"
}

Allocation


Properties

TYPE DEFINITION

{
  "name": "Allocation",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "name": "_id",
      "displayName": "_id",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "_id"
    },
    "currency": {
      "type": "string",
      "name": "currency",
      "displayName": "currency",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "currency"
    },
    "percentage": {
      "type": "number",
      "name": "percentage",
      "displayName": "percentage",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "percentage"
    }
  }
}

TYPE EXAMPLE

{
  "_id": "5d02ecdb39bcc3001434b48b",
  "currency": "BTC",
  "percentage": 44
}

AllocationCreate


Properties

TYPE DEFINITION

{
  "name": "AllocationCreate",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "name": "success",
      "displayName": "success",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "success"
    },
    "updatedAllocations": {
      "type": "array",
      "items": {
        "type": "any"
      },
      "name": "updatedAllocations",
      "displayName": "updatedAllocations",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "updatedAllocations"
    }
  }
}

TYPE EXAMPLE

{
  "success": true,
  "updatedAllocations": [
    {
      "_id": "5d02d295c6d6cc07691d24a1",
      "currency": "TKS",
      "percentage": 12
    },
    {
      "_id": "5d07c5cb39bcc3001434b48f",
      "percentage": 44,
      "currency": "BTC"
    }
  ]
}

AllocationToggle


Properties

TYPE DEFINITION

{
  "name": "AllocationToggle",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "name": "success",
      "displayName": "success",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "success"
    },
    "message": {
      "type": "string",
      "name": "message",
      "displayName": "message",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "message"
    },
    "portfolio_active": {
      "type": "boolean",
      "name": "portfolio_active",
      "displayName": "portfolio_active",
      "typePropertyKind": "TYPE_EXPRESSION",
      "required": true,
      "key": "portfolio_active"
    }
  }
}

TYPE EXAMPLE

{
  "success": true,
  "message": "Portfolio allocations toggled",
  "portfolio_active": true
}

/test


/test get

GET: /test

simply test connection and API key


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/test get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/test"

RESPONSE BODY

200

{
  "success": true,
  "message": "Valid API key"
}
Type
object

/account


/account get

GET: /account

simply test connection and API key


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/account get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/account"

RESPONSE BODY

Type
string


/{table_name} post

POST: /account/{table_name}

Create new account


URI Parameters

table_name

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{table_name} post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/account/{table_name}" \
	-d @request_body

RESPONSE BODY

Type
string


/{id} get

GET: /account/{table_name}/{id}

Retrieve account by id


URI Parameters

table_name

PropertyValue
requiredtrue
typestring

id

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{id} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/account/{table_name}/{id}"

RESPONSE BODY

Type
string

/{id} put

PUT: /account/{table_name}/{id}

Edit account


URI Parameters

table_name

PropertyValue
requiredtrue
typestring

id

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{id} put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/account/{table_name}/{id}" \
	-d @request_body

RESPONSE BODY

Type
string

/merchant


/merchant post

POST: /merchant

Creates a new Merchant account, generates and responds with key to use for locked requests


Header Parameters

appkey

Rotating Shared Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/merchant post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/merchant" \
	-d @request_body

REQUEST BODY

{
  "id": "5bcb6bb75423c8001fb95fd2",
  "tenant_id": "5bcb6bb75423c8001fb95fd2",
  "email": "test@test.com",
  "first_name": "Test",
  "last_name": "User",
  "withdrawal_address": "3PGAv1cZXN93UHd4oZy24WQ9j8GGiVs8HJU",
  "api_key": "83f20b4d1e91f22b678264815f42x413ae84d13b9a2ec01261a6b0ff530f",
  "api_seed": "1540058039624",
  "api_enabled": true
}
Type
object

RESPONSE BODY

200

{
  "success": true,
  "user_id": "5bcb6bb75423c8001fb95fd2",
  "api_key": "83f20b4d1e91f22b678264815f42x413ae84d13b9a2ec01261a6b0ff530f",
  "message": "Successfully created merchant"
}
Type
object


/key post

POST: /merchant/key

Replaces a merchant's API Secret Key with a newly created one


Header Parameters

appkey

Rotating Shared Key

PropertyValue
requiredtrue
typestring

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/key post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/merchant/key" \
	-d @request_body

RESPONSE BODY

200

{
  "success": true,
  "key": "83f20b4d1e91f22b678264815f42x413ae84d13b9a2ec01261a6b0ff530f",
  "message": "API Key renewed"
}
Type
any


/address get

GET: /merchant/address

Retrieve the currently assigned withdrawal address where the system will transfer Tokes/Waves assets


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/address get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/address"

RESPONSE BODY

Type
string

/address put

PUT: /merchant/address


/address put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/merchant/address" \
	-d @request_body


/{currency} get

GET: /merchant/address/{currency}

Retrieve the currently assigned withdrawal address where the system will transfer assets of {currency} to


URI Parameters

currency

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{currency} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/address/{currency}"

RESPONSE BODY

Type
string

/{currency} put

PUT: /merchant/address/{currency}


URI Parameters

currency

PropertyValue
requiredtrue
typestring

/{currency} put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/merchant/address/{currency}" \
	-d @request_body

/{currency} delete

DELETE: /merchant/address/{currency}


URI Parameters

currency

PropertyValue
requiredtrue
typestring

/{currency} delete

CURL EXAMPLE

curl -X DELETE "https://payments.tokesplatform.org/api/merchant/address/{currency}"


/records get

GET: /merchant/records


/records get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/records"


/orders get

GET: /merchant/orders

Lookup paged order history


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/orders get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/orders"

RESPONSE BODY

200

{
  "id": "5bc572961e93c9002a5a28e9",
  "user_id": "5bc4ef442f7727001f5ed168",
  "order_status_id": 1,
  "total": 0.01,
  "items": [
      {
          "name": "Example Product",
          "price": 0.01
      }
  ],
  "subtotal": 0.01,
  "tax": 0,
  "reference_id": "66703781696224718505978432442928",
  "total_tks": "0.02184167",
  "total_btc": "0.00000149",
  "from_currency": "USD",
  "to_currency": "TKS"
}
Type
object

/orders post

POST: /merchant/orders

Build order ticket without attaching a payment request


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/orders post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/merchant/orders" \
	-d @request_body

REQUEST BODY

{
  "id": "5bc572961e93c9002a5a28e9",
  "user_id": "5bc4ef442f7727001f5ed168",
  "order_status_id": 1,
  "total": 0.01,
  "items": [
      {
          "name": "Example Product",
          "price": 0.01
      }
  ],
  "subtotal": 0.01,
  "tax": 0,
  "reference_id": "66703781696224718505978432442928",
  "total_tks": "0.02184167",
  "total_btc": "0.00000149",
  "from_currency": "USD",
  "to_currency": "TKS"
}
Type
object

RESPONSE BODY

Type
object


/{id} get

GET: /merchant/orders/{id}


URI Parameters

id

PropertyValue
requiredtrue
typestring

/{id} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/orders/{id}"

/{id} put

PUT: /merchant/orders/{id}


URI Parameters

id

PropertyValue
requiredtrue
typestring

/{id} put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/merchant/orders/{id}" \
	-d @request_body


/payments post

POST: /merchant/payments

Primary function to create a payment request with market pricing to match


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/payments post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/merchant/payments" \
	-d @request_body

REQUEST BODY

{
  "id": "5bc572961e93c9002a5a28e9",
  "user_id": "5bc4ef442f7727001f5ed168",
  "order_status_id": 1,
  "total": 0.01,
  "items": [
      {
          "name": "Example Product",
          "price": 0.01
      }
  ],
  "subtotal": 0.01,
  "tax": 0,
  "reference_id": "66703781696224718505978432442928",
  "total_tks": "0.02184167",
  "total_btc": "0.00000149",
  "from_currency": "USD",
  "to_currency": "TKS"
}
Type
object

RESPONSE BODY

Type
object


/{paymentId} get

GET: /merchant/payments/{paymentId}

Lookup all relevant payment data for a specific payment


URI Parameters

paymentId

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{paymentId} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/payments/{paymentId}"

RESPONSE BODY

200

{
  "id": "5bc572971e93c9002a5a28ea",
  "order_id": "5bc572961e93c9002a5a28e9",
  "payment_status_id": 0,
  "payee_id": "5bc4ef442f7727001f5ed168",
  "gross_amount": 2184167,
  "payment_address": "3PFBuqcdhYG42MpJ5iUdBiHjymp12JxV8LV"
}
Type
object


/{currency} post

POST: /merchant/payments/{currency}

Create a payment request for a specific currency


URI Parameters

currency

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{currency} post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/merchant/payments/{currency}" \
	-d @request_body

REQUEST BODY

{
  "id": "5bc572961e93c9002a5a28e9",
  "user_id": "5bc4ef442f7727001f5ed168",
  "order_status_id": 1,
  "total": 0.01,
  "items": [
      {
          "name": "Example Product",
          "price": 0.01
      }
  ],
  "subtotal": 0.01,
  "tax": 0,
  "reference_id": "66703781696224718505978432442928",
  "total_tks": "0.02184167",
  "total_btc": "0.00000149",
  "from_currency": "USD",
  "to_currency": "TKS"
}
Type
object

RESPONSE BODY

Type
object


/stats get

GET: /merchant/stats


/stats get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/stats"


/{id} get

GET: /merchant/receipt/{id}

Get full receipt for a payment id, including payment and order details


URI Parameters

id

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{id} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/receipt/{id}"

RESPONSE BODY

Type
object


/{id} get

GET: /merchant/refs/{id}

Get full receipt for an order reference id, including payment and order details


URI Parameters

id

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{id} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/merchant/refs/{id}"

RESPONSE BODY

Type
object


/webhooks put

PUT: /merchant/webhooks

Update your webhook URL for external payment verification


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/webhooks put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/merchant/webhooks" \
	-d @request_body

RESPONSE BODY

200

{
  "success": true,
  "message": "Updated webhook URL to ..."
}
Type
any


/{id} put

PUT: /merchant/rate/{id}

Handler - update order rate


URI Parameters

id

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{id} put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/merchant/rate/{id}" \
	-d @request_body

RESPONSE BODY

Type
string


/allocations post

POST: /merchant/allocations

Create or update merchant portfolio allocation entries


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/allocations post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/merchant/allocations" \
	-d @request_body

REQUEST BODY

{
  "_id": "5d02ecdb39bcc3001434b48b",
  "currency": "BTC",
  "percentage": 44
}
Type
object

RESPONSE BODY

200

{
  "success": true,
  "updatedAllocations": [
    {
      "_id": "5d02d295c6d6cc07691d24a1",
      "currency": "TKS",
      "percentage": 12
    },
    {
      "_id": "5d07c5cb39bcc3001434b48f",
      "percentage": 44,
      "currency": "BTC"
    }
  ]
}
Type
object

/allocations delete

DELETE: /merchant/allocations

Remove a merchant portfolio allocation entry


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/allocations delete

CURL EXAMPLE

curl -X DELETE "https://payments.tokesplatform.org/api/merchant/allocations"

REQUEST BODY

{
  "_id": "5d02ecdb39bcc3001434b48b",
  "currency": "BTC",
  "percentage": 44
}
Type
object

RESPONSE BODY

200

{
  "success": true,
  "updatedAllocations": [
    {
      "_id": "5d02d295c6d6cc07691d24a1",
      "currency": "TKS",
      "percentage": 12
    },
    {
      "_id": "5d07c5cb39bcc3001434b48f",
      "percentage": 44,
      "currency": "BTC"
    }
  ]
}
Type
object

/allocations put

PUT: /merchant/allocations

Toggle merchant portfolio allocations portfolio_active status


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/allocations put

CURL EXAMPLE

curl -X PUT "https://payments.tokesplatform.org/api/merchant/allocations" \
	-d @request_body

RESPONSE BODY

200

{
  "success": true,
  "message": "Portfolio allocations toggled",
  "portfolio_active": true
}
Type
object

/markets


/rate get

GET: /markets/{currency}/rate

Get currency rate in USD


URI Parameters

currency

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/rate get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/markets/{currency}/rate"

RESPONSE BODY

Type
string

/kyc


/contacts post

POST: /kyc/contacts

Submit new contact data for KYC


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/contacts post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/kyc/contacts" \
	-d @request_body

RESPONSE BODY

Type
string


/{id} get

GET: /kyc/contacts/{id}

Retrieve KYC status by contact id


URI Parameters

id

PropertyValue
requiredtrue
typestring

Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/{id} get

CURL EXAMPLE

curl -X GET "https://payments.tokesplatform.org/api/kyc/contacts/{id}"

RESPONSE BODY

Type
string


/status post

POST: /kyc/status

Allow incoming KYC status updates


Header Parameters

accesskey

API Secret Key

PropertyValue
requiredtrue
typestring

Possible Responses

200


/status post

CURL EXAMPLE

curl -X POST "https://payments.tokesplatform.org/api/kyc/status" \
	-d @request_body

RESPONSE BODY

Type
string