Wallet API

Public Wallet API Reference

This website documents the public API for PlasmaPay Public Wallet

You can view code examples in the dark area to the right; switch the programming language of the examples with the tabs in the top right.

Webhook

Shell
JS
Shell
ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/webhooks'
POST 'https://app.plasmapay.com/business/api/v1/wallet/webhooks'
DELETE 'https://app.plasmapay.com/business/api/v1/wallet/webhooks'
JS
ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/webhooks'
POST 'https://app.plasmapay.com/business/api/v1/wallet/webhooks'
DELETE 'https://app.plasmapay.com/business/api/v1/wallet/webhooks'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /webhooks

Get all webhooks

Shell
JS
Shell
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/webhooks
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/webhooks',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

Shell
JS
Shell
200 Ok
Content-Type: application/json
JS
200 Ok
Content-Type: application/json

BODY

Shell
JS
Shell
[{
"id": "{ID}",
"username": "{USERNAME}",
"url": "{URL}",
}]
JS
[{
"id": "{ID}",
"username": "{USERNAME}",
"url": "{URL}",
}]

In order to get all webhooks from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/webhooks

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/webhooks

EXAMPLE RESPONSE

[{
"id": "5d2ea0dea7f3cd480a973b5e",
"username": "testusername",
"url": "https://your-site.com/webhook/test",
}]

POST /webhooks

Create a webhook by sending data via post

Shell
JS
Shell
curl
-X POST
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/webhooks
-d '{"username": "{USERNAME}", "url": "{URL}" }'
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/webhooks',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: {
"username": "{USERNAME}",
"url": "{URL}"
}
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"id": "{ID}",
"username": "{USERNAME}",
"url": "{URL}",
}

In order to create a new webhook on the server you must make a POST request to

POST https://app.plasmapay.com/business/api/v1/wallet/webhooks

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

Parameter

Meaning

username={USERNAME}

Plasma network account (required)

url={URL}

URL for webhooks sending (required)

EXAMPLE REQUEST

POST https://app.plasmapay.com/business/api/v1/wallet/webhooks
{
"username": "testaccount",
"url": "https://site.com/test"
}

EXAMPLE RESPONSE

{
"id": "5d2ea0dea7f3cd480a973b5e",
"username": "testusername",
"url": "https://your-site.com/webhook/test",
}

Receiving data via webhooks

POST to provided url

After setting new webhook you will be available to receive 3 types of events about transactions from plasma blockchain:

1. New Plasma transaction (pending state)

EXAMPLE BODY 1

Shell
JS
Shell
{
"eventType": "new",
"tx": {
"type": "withdraw",
"from": "testacc22222",
"to": "plasma.coin",
"quantity": 0.9999,
"currency": "RUBP",
"actionId": "b4ca93c86297d983f1c156882439fa156c26fdc7ec35956735b7fbf44dfa2de1",
"fee": {
"quantity": 0.0001,
"currency": "RUBP"
},
"blockNum": 21643484,
"timestamp": "2019-10-01T12:51:16.000",
"blockId": "014a40dcb8aea7bb0e2e47fccde0cf0eb50619b0baa0c38c3da22a5a034b6b74",
"mainAction": {
"actionId": "1e0d89edf2bc33f29f8554751f1bf9bbe1e5e95cef123f1fe2a5d2da521be40a",
"name": "withdraw",
"account": "rubp",
"data": {
"account": "testacc22222",
"quantity": "1000000000000000000",
"paySysCms": 0
},
"txId": "ceb8c5a1f94dc3fea09aa0f05ed7fdcbad46365728ed5d748fb6ba11756120f6"
"console": " Taking fee from amount 1.000000000000000000 RUBP. Converted to 0.020932000000000000 PLASMA from 1.000000000000000000 RUBP mult 20932 div 1000000. Fee is 1/100 % - 0.000100000000000000 RUBP. Fee is 1/100 % - 0.000002093200000000 PLASMA. Calculated fee amount is 0.000100000000000000 RUBP.",
"actors": [
"testacc22222"
]
}
}
}
JS
{
"eventType": "new",
"tx": {
"type": "withdraw",
"from": "testacc22222",
"to": "plasma.coin",
"quantity": 0.9999,
"currency": "RUBP",
"actionId": "b4ca93c86297d983f1c156882439fa156c26fdc7ec35956735b7fbf44dfa2de1",
"fee": {
"quantity": 0.0001,
"currency": "RUBP"
},
"blockNum": 21643484,
"timestamp": "2019-10-01T12:51:16.000",
"blockId": "014a40dcb8aea7bb0e2e47fccde0cf0eb50619b0baa0c38c3da22a5a034b6b74",
"mainAction": {
"actionId": "1e0d89edf2bc33f29f8554751f1bf9bbe1e5e95cef123f1fe2a5d2da521be40a",
"name": "withdraw",
"account": "rubp",
"data": {
"account": "testacc22222",
"quantity": "1000000000000000000",
"paySysCms": 0
},
"txId": "ceb8c5a1f94dc3fea09aa0f05ed7fdcbad46365728ed5d748fb6ba11756120f6"
"console": " Taking fee from amount 1.000000000000000000 RUBP. Converted to 0.020932000000000000 PLASMA from 1.000000000000000000 RUBP mult 20932 div 1000000. Fee is 1/100 % - 0.000100000000000000 RUBP. Fee is 1/100 % - 0.000002093200000000 PLASMA. Calculated fee amount is 0.000100000000000000 RUBP.",
"actors": [
"testacc22222"
]
}
}
}

Where tx.type can be one of these options: 'withdraw', 'transfer', 'newaccount', 'permissions', 'issue', 'exchange'

tx.tx contains all the data about transaction in blockchain network

2. Confirmation of Plasma transaction (success state)

EXAMPLE BODY 2

Shell
JS
Shell
{
"eventType": "confirm",
"tx": {
"type": "withdraw",
"from": "testacc22222",
"to": "plasma.coin",
"quantity": 0.9999,
"currency": "RUBP",
"actionId": "b4ca93c86297d983f1c156882439fa156c26fdc7ec35956735b7fbf44dfa2de1",
"fee": {
"quantity": 0.0001,
"currency": "RUBP"
},
"blockNum": 21643484,
"timestamp": "2019-10-01T12:51:16.000",
"blockId": "014a40dcb8aea7bb0e2e47fccde0cf0eb50619b0baa0c38c3da22a5a034b6b74",
"mainAction": {
"actionId": "1e0d89edf2bc33f29f8554751f1bf9bbe1e5e95cef123f1fe2a5d2da521be40a",
"name": "withdraw",
"account": "rubp",
"data": {
"account": "testacc22222",
"quantity": "1000000000000000000",
"paySysCms": 0
},
"txId": "ceb8c5a1f94dc3fea09aa0f05ed7fdcbad46365728ed5d748fb6ba11756120f6"
"console": " Taking fee from amount 1.000000000000000000 RUBP. Converted to 0.020932000000000000 PLASMA from 1.000000000000000000 RUBP mult 20932 div 1000000. Fee is 1/100 % - 0.000100000000000000 RUBP. Fee is 1/100 % - 0.000002093200000000 PLASMA. Calculated fee amount is 0.000100000000000000 RUBP.",
"actors": [
"testacc22222"
]
}
}
}
JS
{
"eventType": "confirm",
"tx": {
"type": "withdraw",
"from": "testacc22222",
"to": "plasma.coin",
"quantity": 0.9999,
"currency": "RUBP",
"actionId": "b4ca93c86297d983f1c156882439fa156c26fdc7ec35956735b7fbf44dfa2de1",
"fee": {
"quantity": 0.0001,
"currency": "RUBP"
},
"blockNum": 21643484,
"timestamp": "2019-10-01T12:51:16.000",
"blockId": "014a40dcb8aea7bb0e2e47fccde0cf0eb50619b0baa0c38c3da22a5a034b6b74",
"mainAction": {
"actionId": "1e0d89edf2bc33f29f8554751f1bf9bbe1e5e95cef123f1fe2a5d2da521be40a",
"name": "withdraw",
"account": "rubp",
"data": {
"account": "testacc22222",
"quantity": "1000000000000000000",
"paySysCms": 0
},
"txId": "ceb8c5a1f94dc3fea09aa0f05ed7fdcbad46365728ed5d748fb6ba11756120f6"
"console": " Taking fee from amount 1.000000000000000000 RUBP. Converted to 0.020932000000000000 PLASMA from 1.000000000000000000 RUBP mult 20932 div 1000000. Fee is 1/100 % - 0.000100000000000000 RUBP. Fee is 1/100 % - 0.000002093200000000 PLASMA. Calculated fee amount is 0.000100000000000000 RUBP.",
"actors": [
"testacc22222"
]
}
}
}

3. Cancelling of Plasma transaction (canceled state)

EXAMPLE BODY 3

Shell
JS
Shell
{
"eventType": "cancel",
"tx": {
"type": "withdraw",
"from": "testacc22222",
"to": "plasma.coin",
"quantity": 0.9999,
"currency": "RUBP",
"actionId": "b4ca93c86297d983f1c156882439fa156c26fdc7ec35956735b7fbf44dfa2de1",
"fee": {
"quantity": 0.0001,
"currency": "RUBP"
},
"blockNum": 21643484,
"timestamp": "2019-10-01T12:51:16.000",
"blockId": "014a40dcb8aea7bb0e2e47fccde0cf0eb50619b0baa0c38c3da22a5a034b6b74",
"mainAction": {
"actionId": "1e0d89edf2bc33f29f8554751f1bf9bbe1e5e95cef123f1fe2a5d2da521be40a",
"name": "withdraw",
"account": "rubp",
"data": {
"account": "testacc22222",
"quantity": "1000000000000000000",
"paySysCms": 0
},
"txId": "ceb8c5a1f94dc3fea09aa0f05ed7fdcbad46365728ed5d748fb6ba11756120f6"
"console": " Taking fee from amount 1.000000000000000000 RUBP. Converted to 0.020932000000000000 PLASMA from 1.000000000000000000 RUBP mult 20932 div 1000000. Fee is 1/100 % - 0.000100000000000000 RUBP. Fee is 1/100 % - 0.000002093200000000 PLASMA. Calculated fee amount is 0.000100000000000000 RUBP.",
"actors": [
"testacc22222"
]
}
}
}
JS
{
"eventType": "cancel",
"tx": {
"type": "withdraw",
"from": "testacc22222",
"to": "plasma.coin",
"quantity": 0.9999,
"currency": "RUBP",
"actionId": "b4ca93c86297d983f1c156882439fa156c26fdc7ec35956735b7fbf44dfa2de1",
"fee": {
"quantity": 0.0001,
"currency": "RUBP"
},
"blockNum": 21643484,
"timestamp": "2019-10-01T12:51:16.000",
"blockId": "014a40dcb8aea7bb0e2e47fccde0cf0eb50619b0baa0c38c3da22a5a034b6b74",
"mainAction": {
"actionId": "1e0d89edf2bc33f29f8554751f1bf9bbe1e5e95cef123f1fe2a5d2da521be40a",
"name": "withdraw",
"account": "rubp",
"data": {
"account": "testacc22222",
"quantity": "1000000000000000000",
"paySysCms": 0
},
"txId": "ceb8c5a1f94dc3fea09aa0f05ed7fdcbad46365728ed5d748fb6ba11756120f6"
"console": " Taking fee from amount 1.000000000000000000 RUBP. Converted to 0.020932000000000000 PLASMA from 1.000000000000000000 RUBP mult 20932 div 1000000. Fee is 1/100 % - 0.000100000000000000 RUBP. Fee is 1/100 % - 0.000002093200000000 PLASMA. Calculated fee amount is 0.000100000000000000 RUBP.",
"actors": [
"testacc22222"
]
}
}
}

DELETE /webhooks/{id}

Delete a webhook by sending data via delete

Shell
JS
Shell
curl
-X DELETE
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/webhooks/{id}
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/webhooks/{id}',
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
success: {SUCCESS}
}

In order to delete a webhook on the server you must make a DELETE request to

DELETE https://app.plasmapay.com/business/api/v1/wallet/webhooks/{id}

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

DELETE https://app.plasmapay.com/business/api/v1/wallet/webhooks?id=5d2ea0dea7f3cd480a973b5e

EXAMPLE RESPONSE

{
"success": true
}

Rates

ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/rates/{pair}'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /rates/{pair}

Get rate of one currency to another

Shell
JS
Shell
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/rates/{pair}
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/rates/{pair}',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"pair": "{PAIR}",
"rate": "{RATE}",
}

In order to get rates from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/rates/{pair}

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/rates/PLASMA-USDP

EXAMPLE RESPONSE

{
"pair": "PLASMA-USDP",
"rate": "1.1",
}

Currency code

Currency

Code

US Dollar

USDP

Euro

EURP

Pound Sterling

GPBP

Chinese Yuan

CYNP

Russian Ruble

RUBP

Czech Republic Koruna

CZKP

Singapore Dollar

SGDP

Hong Kong Dollar

HKDP

South Korean Won

KRW

Hungarian Forint

HUFP

Israeli New Sheqel

ILSP

Norwegian Krone

NOKP

Kenyan Shilling

KESP

Philippine Peso

PHPP

Indian Rupee

INRP

Pakistani Rupee

PKRP

Argentine Peso

ARSP

Australian dollar

AUDP

Belarusian Ruble

BYNP

Indonesian Rupiah

IDRP

Danish Krone

DKKP

Thai Baht

THBP

Mexican Peso

MXNP

Swedish Krona

SEKP

Japanese Yen

JPYP

Chilean Peso

CLPP

Azerbaijani Manat

AZNP

Armenian Dram

AMDP

Brazilian Real

BRLP

Swiss Franc

CHFP

New Taiwan Dollar

TWDP

Nigerian Naira

NGNP

Canadian Dollar

CADP

Turkish Lira

TRYP

Kazakhstani Tenge

KZTP

New Zealand Dollar

NZDP

Malaysian Ringgit

MYRP

Omani Rial

OMRP

Vietnamese Dong

VNDP

South African Rand

ZARP

Polish Zloty

PLNP

Ukraine Hryvnia

UAHP

Fees

ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/fees/{tokenCode}'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /fees/{tokenCode}

Get fees from plasma blockchain network

Shell
JS
Shell
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/fees/{tokenCode}
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/fees/{tokenCode}',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"plasma": {
"balance": "{BALANCE}",
"minFee": "{MINER_FEE}",
"decimals": "{DECIMALS}",
"currencyRate": "{CURRENCY_RATE}",
"feePercents": "{FEE_PERCENTS}",
"exchangeFeePercents": "{EXCHANGE_FEE_PERCENTS}"
},
"currency": {
"balance": "{BALANCE}",
"minFee": "{MINER_FEE}",
"decimals": "{DECIMALS}",
"currencyRate": "{CURRENCY_RATE}",
"feePercents": "{FEE_PERCENTS}",
"exchangeFeePercents": "{EXCHANGE_FEE_PERCENTS}"
}
}

In order to get fees from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/fees/{tokenCode}

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/fees/RUBP

EXAMPLE RESPONSE

{
"plasma": {
"balance": "0",
"minFee": 1,
"decimals": 18,
"currencyRate": 49.345366,
"feePercents": 0.00005,
"exchangeFeePercents": 0.001
},
"currency": {
"balance": "500000000000000000000",
"minFee": 1,
"plasmaRate": 0.020265,
"decimals": 18,
"feePercents": 0.0001,
"exchangeFeePercents": 0.001
}
}

Accounts

ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/accounts/{account}/available'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /accounts/{account}/available

Check if account exist and available in the plasma blockchain network

Bash
JS
Bash
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/accounts/{account}/available
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/accounts/{account}/available',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"available": "{AVAILABLE}"
}

In order to check if account exist and available from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/accounts/{account}/available

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/accounts/testaccount/available

EXAMPLE RESPONSE

{
"available": true
}

Balances

ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/balances/{username}'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /balances/{username}

Get balances for plasma account

Shell
JS
Shell
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/balances/{username}
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/balances/{username}',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

[{
"account": "{ACCOUNT}",
"balance": "{BALANCE}",
}]

In order to get balances from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/balances/{username}

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/balances/testaccount

EXAMPLE RESPONSE

[
{
"account": "testaccount",
"balance": 200,
"currency": "RUBP"
},
{
"account": "testaccount",
"balance": 3,
"currency": "USDP"
}
]

Transactions

ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/transactions/{txId}'
POST 'https://app.plasmapay.com/business/api/v1/wallet/transactions'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /transactions/{txId}

Get transaction details from blockchain by hash (txId)

Shell
JS
Shell
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/transactions/{txId}
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/transactions/{txId}',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"id": "{ID}",
"blockNum": "{BLOCK_NUM}",
"blockTime": "{BLOCK_TIME}",
"blockId": "{BLOCK_ID}",
"actions": "{ACTIONS}"
"events": "{EVENTS}"
"legacyEvents": "{LEGACY_EVENTS}"
}

You can pass query parameter ?needRaw=1 to get raw transaction object.

In this query you should use hash of transaction as txId parameter. You can get hash (txId) of created transactions in other transaction routes by using referenceId field in response.

In order to get transaction from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/transactions/{txId}

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/transactions/c0d0039ab93284389e2cbbc47ebe21d9effe1a0eb1249f822a44cd6ecd94e18a

EXAMPLE RESPONSE

{
"id": "c0d0039ab93284389e2cbbc47ebe21d9effe1a0eb1249f822a44cd6ecd94e18a",
"blockNum": 12183438,
"blockTime": "2019-08-07T13:29:05.000",
"blockId": "00b9e78e8cf17c4e5896dcb580664e2065bda48b4a35f929129dfb7d73cff053",
"actions": [
{
"actionId": "321bb8fd4476c6a25870ee9892e6add18ebfe60d2a508eb9069fe92733196e5c",
"name": "issue",
"account": "rubp",
"data": {
"to": "testaccount",
"quantity": "50000000000000000000",
"paySysCms": 0,
"memo": ""
},
"console": "",
"actors": [
"plasma.coin"
],
"subactions": [
{
"actionId": "93863bbde210a10faf49e58b871cf7265fb64e7bebccbc68269eff4e37823079",
"name": "issue",
"account": "plasma.token",
"data": {
"to": "testaccount",
"quantity": "50.000000000000000000 RUBP",
"memo": ""
},
"console": "",
"actors": [
"plasma.coin"
],
"subactions": [],
"events": []
}
],
"events": [
{
"type": "issue",
"from": "plasma.token",
"to": "testaccount",
"quantity": 50,
"currency": "RUBP",
"actionId": "93863bbde210a10faf49e58b871cf7265fb64e7bebccbc68269eff4e37823079",
"fee": {
"quantity": 0,
"currency": "PLASMA"
}
}
]
}
],
"events": [
{
"type": "issue",
"from": "plasma.token",
"to": "testaccount",
"quantity": 50,
"currency": "RUBP",
"actionId": "93863bbde210a10faf49e58b871cf7265fb64e7bebccbc68269eff4e37823079",
"fee": {
"quantity": 0,
"currency": "PLASMA"
},
"mainAction": {
"actionId": "321bb8fd4476c6a25870ee9892e6add18ebfe60d2a508eb9069fe92733196e5c",
"name": "issue",
"account": "rubp",
"data": {
"to": "testaccount",
"quantity": "50000000000000000000",
"paySysCms": 0,
"memo": ""
},
"console": "",
"actors": [
"plasma.coin"
]
},
"blockNum": 12183438,
"timestamp": "2019-08-07T13:29:05.000",
"blockId": "00b9e78e8cf17c4e5896dcb580664e2065bda48b4a35f929129dfb7d73cff053",
"txId": "c0d0039ab93284389e2cbbc47ebe21d9effe1a0eb1249f822a44cd6ecd94e18a"
}
],
"legacyEvents": [
{
"type": "issue",
"from": "plasma.token",
"to": "testaccount",
"currency": "RUBP",
"actionNum": 0,
"txId": "c0d0039ab93284389e2cbbc47ebe21d9effe1a0eb1249f822a44cd6ecd94e18a",
"blockNum": 12183438,
"blockId": "00b9e78e8cf17c4e5896dcb580664e2065bda48b4a35f929129dfb7d73cff053",
"timestamp": "2019-08-07T13:29:05.000",
"feePlasma": 0,
"feeCurrency": 0,
"quantity": 50
}
]
}

POST /transactions

Create new transaction in plasma for money transfer

Shell
JS
Shell
curl
-X POST
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/transactions
-d '{"amount": "{AMOUNT}", "address": "{ADDRESS}", "note": "{NOTE}", "feePayer": "{FEE_PAYER}", "tokenCode": "{TOKEN_CODE}" }'
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/transactions',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: {
"amount": "{AMOUNT}",
"address": "{ADDRESS}"
"note": "{NOTE}"
"feePayer": "{FEE_PAYER}"
"tokenCode": "{TOKEN_CODE}"
}
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"id": "{ID}",
"amount": "{AMOUNT}",
"processedAmount": "{PROCESSED_AMOUNT}",
"currencyCode": "{CURRENCY_CODE}",
"state": "{STATE}",
"type": "{TYPE}",
"isSmart": "{IS_SMART}",
"createdAt": "{CREATED_AT}",
"priority": "{PRIORITY}",
"feePayer": "{FEE_PAYER}",
"minerFeeAmount": "{MINER_FEE_AMOUNT}",
"plasmaFeeAmount": "{PLASMA_FEE_AMOUNT}",
"toAddress": "{TO_ADDRESS}",
"withdrawal": "{WITHDRAWAL}",
"link": "{LINK}",
"confirmations": "{CONFIRMATIONS}",
"tokensAmount": "{TOKENS_AMOUNT}",
"tokenSymbol": "{TOKEN_SYMBOL}",
"plasmaFeeTokensAmount": "{PLASMA_FEE_TOKENS_AMOUNT}",
"instruction": {
"id": "{ID}",
"amount": "{AMOUNT}",
"currencyCode": "{CURRENCY_CODE}",
"state": "{STATE}",
"type": "{TYPE}",
"note": "{NOTE}",
"contactId": "{CONTACT_ID}",
"createdAt": "{CREATED_AT}",
"extendedData": "{EXTENDED_DATA}"
},
"toWallet": null,
"wallet": {
"id": "{ID}",
"type": "{TYPE}",
"currencyCode": "{CURRENCY_CODE}",
"networkType": "{NETWORK_TYPE}",
"username": "{USERNAME}"
}
}

In order to create new plasma transaction on the server you must make a POST request to

POST https://app.plasmapay.com/business/api/v1/wallet/transactions

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

Parameter

Meaning

amount={AMOUNT}

Amount of transaction (required)

address={ADDRESS}

Plasma network Address (account) for receiving amount (required)

feePayer={FEE_PAYER}

Payer of fees: "myself" or "receiver" (required)

note={NOTE}

Note for transfer

tokenCode={TOKEN_CODE}

Token code (USDP, EURP, RUBP, etc.). PLASMA will be used if this parameter is not passed

EXAMPLE REQUEST

POST https://app.plasmapay.com/business/api/v1/wallet/transactions
{
"amount": "2",
"address": "testaccount"
"feePayer": "myself"
"tokenCode": "USDP"
}

EXAMPLE RESPONSE

{
"id": "5d810446f15d5d4dac1c392f",
"amount": 0,
"processedAmount": 0,
"currencyCode": "PLASMA",
"state": "tmp",
"type": "debit",
"isSmart": true,
"createdAt": "2019-09-17T16:05:26.985Z",
"priority": null,
"feePayer": "myself",
"minerFeeAmount": 0,
"plasmaFeeAmount": 0,
"toAddress": "testaccount",
"withdrawal": null,
"link": "http://dlt.plasmapay.com/transactions/undefined",
"confirmations": 0,
"tokensAmount": -2,
"tokenSymbol": "USDP",
"referenceId": null,
"plasmaFeeTokensAmount": 0.0002,
"instruction": {
"id": "5d810446f15d5ddb971c392d",
"amount": 0,
"currencyCode": "PLASMA",
"state": "new",
"type": "debit",
"note": null,
"contactId": null,
"createdAt": "2019-09-17T16:05:26.975Z",
"extendedData": null
},
"toWallet": null,
"wallet": {
"id": "5d80c92ce94fb6523db9472d",
"type": "client_plasma",
"currencyCode": "PLASMA",
"networkType": "main",
"username": "testaccount"
}
}

SEND RAW POST /transactions/{id}/send-raw

Send already created transaction in plasma and signed by yourself for money transfer

Shell
JS
Shell
curl
-X POST
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send-raw
-d '{"rawTx": "{RAW_TX}", "signatures": "{SIGNATURES}"}'
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send-raw',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: {
"rawTx": "{RAW_TX}",
"signatures": "{SIGNATURES}"
}
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"id": "{ID}",
"amount": "{AMOUNT}",
"processedAmount": "{PROCESSED_AMOUNT}",
"currencyCode": "{CURRENCY_CODE}",
"state": "{STATE}",
"type": "{TYPE}",
"isSmart": "{IS_SMART}",
"createdAt": "{CREATED_AT}",
"priority": "{PRIORITY}",
"feePayer": "{FEE_PAYER}",
"minerFeeAmount": "{MINER_FEE_AMOUNT}",
"plasmaFeeAmount": "{PLASMA_FEE_AMOUNT}",
"toAddress": "{TO_ADDRESS}",
"withdrawal": "{WITHDRAWAL}",
"link": "{LINK}",
"confirmations": "{CONFIRMATIONS}",
"tokensAmount": "{TOKENS_AMOUNT}",
"tokenSymbol": "{TOKEN_SYMBOL}",
"plasmaFeeTokensAmount": "{PLASMA_FEE_TOKENS_AMOUNT}",
"instruction": {
"id": "{ID}",
"amount": "{AMOUNT}",
"currencyCode": "{CURRENCY_CODE}",
"state": "{STATE}",
"type": "{TYPE}",
"note": "{NOTE}",
"contactId": "{CONTACT_ID}",
"createdAt": "{CREATED_AT}",
"extendedData": "{EXTENDED_DATA}"
},
"toWallet": null,
"wallet": {
"id": "{ID}",
"type": "{TYPE}",
"currencyCode": "{CURRENCY_CODE}",
"networkType": "{NETWORK_TYPE}",
"username": "{USERNAME}"
}
}

In order to send already created transaction in plasma and signed by yourself you must make a POST request to

POST https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send-raw

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

Parameter

Meaning

rawTx={RAW_TX}

Raw string of transaction (required)

signatures={SIGNATURES}

Signatures of signed transaction (required)

EXAMPLE REQUEST

POST https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send-raw
{
"rawTx": [141,237,120,93,190,127,150,63,114,92,0,0,0,0,1,0,0,0,0,0,80,19,214,0,0,0,87,45,60,205,205,1,16,66,8,33,120,197,174,194,0,0,0,0,168,237,50,50,38,16,66,8,33,120,197,174,194,96,49,198,24,99,140,42,198,19,50,48,48,48,50,48,48,48,50,48,48,48,50,48,48,48,48,48,48,0,0,3],
"signatures": "SIG_K1_KaUjYZrRtAaG95qDUK4VDV4KQYXyE9Xv4HXUX5UH15ZNBjaGY98DFq48RPN9ar4QRAdAXbYZpdcVMiQC2FLa77ZUvnh96L"
}

EXAMPLE RESPONSE

{
"id": "5d810446f15d5d4dac1c392f",
"amount": 0,
"processedAmount": 0,
"currencyCode": "PLASMA",
"state": "new",
"type": "debit",
"isSmart": true,
"createdAt": "2019-09-17T16:05:26.985Z",
"priority": null,
"feePayer": "myself",
"minerFeeAmount": 0,
"plasmaFeeAmount": 0,
"toAddress": "testaccount",
"withdrawal": null,
"link": "http://dlt.plasmapay.com/transactions/2d871y2d87128dy1827dy1827dy",
"confirmations": 0,
"tokensAmount": -2,
"referenceId": "1od87yo78yfo187fyo81",
"tokenSymbol": "USDP",
"plasmaFeeTokensAmount": 0.0002,
"instruction": {
"id": "5d810446f15d5ddb971c392d",
"amount": 0,
"currencyCode": "PLASMA",
"state": "new",
"type": "debit",
"note": null,
"contactId": null,
"createdAt": "2019-09-17T16:05:26.975Z",
"extendedData": null
},
"toWallet": null,
"wallet": {
"id": "5d80c92ce94fb6523db9472d",
"type": "client_plasma",
"currencyCode": "PLASMA",
"networkType": "main",
"username": "testaccount"
}
}

SEND POST /transactions/{id}/send

Send already created transaction in plasma to plasma blockchain network

Shell
JS
Shell
curl
-X POST
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send
-d '{}'
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

{
"id": "{ID}",
"amount": "{AMOUNT}",
"processedAmount": "{PROCESSED_AMOUNT}",
"currencyCode": "{CURRENCY_CODE}",
"state": "{STATE}",
"type": "{TYPE}",
"isSmart": "{IS_SMART}",
"createdAt": "{CREATED_AT}",
"priority": "{PRIORITY}",
"feePayer": "{FEE_PAYER}",
"minerFeeAmount": "{MINER_FEE_AMOUNT}",
"plasmaFeeAmount": "{PLASMA_FEE_AMOUNT}",
"toAddress": "{TO_ADDRESS}",
"withdrawal": "{WITHDRAWAL}",
"link": "{LINK}",
"confirmations": "{CONFIRMATIONS}",
"tokensAmount": "{TOKENS_AMOUNT}",
"tokenSymbol": "{TOKEN_SYMBOL}",
"plasmaFeeTokensAmount": "{PLASMA_FEE_TOKENS_AMOUNT}",
"instruction": {
"id": "{ID}",
"amount": "{AMOUNT}",
"currencyCode": "{CURRENCY_CODE}",
"state": "{STATE}",
"type": "{TYPE}",
"note": "{NOTE}",
"contactId": "{CONTACT_ID}",
"createdAt": "{CREATED_AT}",
"extendedData": "{EXTENDED_DATA}"
},
"toWallet": null,
"wallet": {
"id": "{ID}",
"type": "{TYPE}",
"currencyCode": "{CURRENCY_CODE}",
"networkType": "{NETWORK_TYPE}",
"username": "{USERNAME}"
}
}

In order to send already created plasma transaction you must make a POST request to

POST https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

POST https://app.plasmapay.com/business/api/v1/wallet/transactions/{id}/send

EXAMPLE RESPONSE

{
"id": "5d810446f15d5d4dac1c392f",
"amount": 0,
"processedAmount": 0,
"currencyCode": "PLASMA",
"state": "new",
"type": "debit",
"isSmart": true,
"createdAt": "2019-09-17T16:05:26.985Z",
"priority": null,
"feePayer": "myself",
"minerFeeAmount": 0,
"plasmaFeeAmount": 0,
"toAddress": "testaccount",
"withdrawal": null,
"link": "http://dlt.plasmapay.com/transactions/1od87yo78yfo187fyo81",
"confirmations": 0,
"tokensAmount": -2,
"referenceId": "1od87yo78yfo187fyo81",
"tokenSymbol": "USDP",
"plasmaFeeTokensAmount": 0.0002,
"instruction": {
"id": "5d810446f15d5ddb971c392d",
"amount": 0,
"currencyCode": "PLASMA",
"state": "new",
"type": "debit",
"note": null,
"contactId": null,
"createdAt": "2019-09-17T16:05:26.975Z",
"extendedData": null
},
"toWallet": null,
"wallet": {
"id": "5d80c92ce94fb6523db9472d",
"type": "client_plasma",
"currencyCode": "PLASMA",
"networkType": "main",
"username": "testaccount"
}
}

Actions

ENDPOINTS:
GET 'https://app.plasmapay.com/business/api/v1/wallet/actions/{username}'

You must use your `API_KEY` for any request to the server. Using an request without `API_KEY` will return an error.

GET /actions/{username}

Get actions of plasma account

Shell
JS
Shell
curl
-X GET
-H "Content-type: application/json"
-H "authorization: Bearer <API_KEY>"
https://app.plasmapay.com/business/api/v1/wallet/actions/{username}
JS
var request = require('request');
const options = {
uri: 'https://app.plasmapay.com/business/api/v1/wallet/actions/{username}',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'authorization': 'Bearer API_KEY'
},
json: true
}
request(options, function (error, response, body) {
if (!error && response.statusCode === 200) {
// Handle body
}
});

RESPONSE

200 Ok
Content-Type: application/json

BODY

[{
"global_action_seq": "{GLOBAL_ACTION_SEQ}",
"account_action_seq": "{ACCOUNT_ACTION_SEQ}",
"block_num": "{BLOCK_NUM}",
"block_time": "{BLOCK_TIME}",
"action_trace": "{ACTION_TRACE_OBJECT}"
}]

You can pass query parameter ?offset={number} to get result from certain position

You can pass query parameter ?limit={number} to get specified maximum of result records

In order to get actions from the server you must make a GET request to

GET https://app.plasmapay.com/business/api/v1/wallet/actions/{username}

with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

EXAMPLE REQUEST

GET https://app.plasmapay.com/business/api/v1/wallet/actions/testaccount

EXAMPLE RESPONSE

[
{
"global_action_seq": 46954394,
"account_action_seq": 1,
"block_num": 12178844,
"block_time": "2019-08-07T12:50:48.000",
"action_trace": {
"receipt": {
"receiver": "testaccount",
"act_digest": "7db68d61fe3102a5323097b08dd8acf93100974f53bcef1869b89681ea5fee02",
"global_sequence": 46954394,
"recv_sequence": 1,
"auth_sequence": [
[
"plasma.coin",
29263
]
],
"code_sequence": 10,
"abi_sequence": 3
},
"act": {
"account": "plasma.token",
"name": "issue",
"authorization": [
{
"actor": "plasma.coin",
"permission": "active"
}
],
"data": {
"to": "testaccount",
"quantity": "100.000000000000000000 RUBP",
"memo": ""
},
"hex_data": "60a699e69869a6391b3130302e303030303030303030303030303030303030205255425000"
},
"context_free": false,
"elapsed": 16,
"console": "",
"trx_id": "9e6b182e0112ec5ede6455433d81f3baa0dabd5b4d601a7d19ce7ac1885027ca",
"block_num": 12178844,
"block_time": "2019-08-07T12:50:48.000",
"producer_block_id": "00b9d59c80c4c520313c799312612dc8b9e20331e17693284ad21c8b5017abec",
"account_ram_deltas": [],
"except": null,
"inline_traces": []
}
}
]

Status codes

The PlasmaPay API uses the following error codes:

Code

Meaning

200

OK Successful request

201

Created New object saved

204

No content Object deleted

Code

Meaning

400

Bad Request -- You have passed a malformed request

401

Unauthorized -- Your API key is incorrect

403

Forbidden -- The resource requested is not available with your permissions

404

Not Found -- The specified resource could not be found

422

Unprocurable Entity -- Your request is invalid

500

Internal Server Error -- We had a problem with our server. Try again later

503

Service Unavailable (Time out) -- The server is overloaded or down for maintenance