API Documentation

Libraries

get
Get Transactions

http://discoin.sidetrip.xyz/transactions
Retrieves unprocessed transactions. All retrieved transactions will be marked as "Processed".
Request
Response
Headers
Authorization
required
string
Your token.
200: OK
An array of transactions.
[{
"user": "155784937511976960",
"timestamp": 1502829034,
"source": "DTS",
"amount": 1.2,
"receipt": "e7eed14463d00e05eca7075bbc89aa7be640e494"
},
{
"user": "155784937511976960",
"timestamp": 1502829034,
"source": "DUT",
"amount": 1,
"receipt": "f951dae48f7ef5670270717fe57af9eb41b889f0",
"type": "refund"
}]
401: Unauthorized
Your token is invalid.
{
"status": "error",
"reason": "unauthorized"
}

get
Get Transaction

http://discoin.sidetrip.xyz/transaction/:receipt
Retrieves transaction info based off receipt.
Request
Response
Path Parameters
receipt
required
string
The receipt you want to look up.
Headers
Authorization
required
string
Your token.
200: OK
Transaction information.
{
"amountDiscoin": 120,
"amountSource": 10,
"amountTarget": 10,
"processTime": 1503429255,
"processed": true,
"receipt": "3013edf87bf5a369621fd6065b1454ea7ba71464",
"reversed": true,
"source": "DUT",
"target": "DTS",
"timestamp": 1503428678,
"type": "normal",
"user": "132315148487622656"
}
404: Not Found
No transaction was found.
{
"reason": "transaction not found",
"status": "error"
}

post
Create New Transaction

http://discoin.sidetrip.xyz/transaction
Request a transaction.
Request
Response
Headers
Authorization
required
string
Your token.
Body Parameters
amount
required
integer
Transaction amount in original currency.
exchangeTo
required
integer
String, 3-letter currency code representing the destination currency. Case insensitive.
user
required
string
ID of user who requested the transaction
200: OK
{
"limitNow": 4999,
"receipt": "dca311df716ad4a6b734e3b92f0b58d797abd98c",
"resultAmount": 1,
"status": "approved"
}
400: Bad Request
Invalid data (amount or destination currency)
{
"reason": "invalid amount",
"status": "error"
}
403: Forbidden
User rejections.
not verified
exceeded daily per user limit
exceeded daily total limit
{
"reason": "verify required",
"status": "declined"
}

get
Get Exchange Rates

http://discoin.sidetrip.xyz/rates.json
Get current exchange rates between currencies.
Request
Response
200: OK
A list of exchange rates.
[{
"EliteLooter": {
"currencyCode": "ELT",
"toDiscoin": 0.9,
"fromDiscoin": 1
}
}, {
"KekBot": {
"currencyCode": "KEK",
"toDiscoin": 3,
"fromDiscoin": 1
}
}, {
"Pollux": {
"currencyCode": "RBN",
"toDiscoin": 1,
"fromDiscoin": 0.9
}
}, {
"Dice": {
"currencyCode": "OAT",
"toDiscoin": 0.1,
"fromDiscoin": 1
}
}, {
"DiscordTel": {
"currencyCode": "DTS",
"toDiscoin": 1,
"fromDiscoin": 0.9
}
}]

post
Reverse a transaction

http://discoin.sidetrip.xyz/transaction/reverse
Reject a transaction sent to your bot and allow the the source bot to refund the user.
Request
Response
Headers
Authorization
required
string
Your token.
Body Parameters
receipt
required
string
The receipt of the transaction you want to reverse.
200: OK
Creates a transaction to the source bot marked as a "refund".
{
"refundAmount": 100,
"status": "ok"
}
400: Bad Request
You attempted to reverse a transaction that is a refund, already is reversed, or doesn't exist.
{
"reason": "invalid receipt",
"status": "failed"
}
403: Forbidden
You attempted to reverse a transaction from another bot.
{
"reason": "transaction must be to your bot",
"status": "failed"
}
404: Not Found
You attempted to reverse a transaction that couldn't be found.
{
"reason": "transaction not found",
"status": "failed"
}