John

API

Basics

Introduction

The Kryptonica API will provide access to our services and information to our sellers. API calls are implemented as standard HTTP POST (application/x-www-form-urlencoded) calls to https://kryptonica.net/api/

API Setup

The only setup needed is to go to the API Keys page and generate an API key. You will be given a private and public key used to authenticate your API calls. Make sure you don't share your private and public key with any other users!

Note: If you forgot your private and public key, you can't access any API calls

Authentication

Every API call (Private API Calls) need access token that you have generated using private and public key. Our server generates it's own unique access token for every users.
If they don't match the API call is discarded. For example if your access token was "authorize token" and you were using the get_balance function the raw request might look like:

https://kryptonica.net/api/get_balance
and also you need to pass your access token in your header of every API calls except get_authorized_token API call. It may look like:
--header 'Authorization: {your_authorize_token}' \

API Response

The API will return an array with 3 elements: 'status', 'response' and 'message'
The status will always return either 'true' or 'false'.
If the status will return 'true', then 'response' will return an array of object or object and 'message' will return an empty.
If the status will return 'false', then 'response' will return an empty and 'message' will return decription of error message.

API POST Fields

API calls are made as basic HTTP POST requests. (Note: The POST data is regular application/x-www-form-urlencoded style data)


Basics

Get Authorized Token

API URL : https://kryptonica.net/api/get_authorized_token

Parameters

Name Type Mandatory Description
Email ID email YES The parameters should be like this, your registered email id
Public Key public_key YES The parameters should be like this, pub_12DF12
Private Key private_key YES The parameters should be like this, pvk_12DF12

Success Response

{
    "status": true,
    "response": {
        "authorize_token": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9mNvbVwvZHRz....."
    },
    "message": ""
}
            

Failure Response

{
    "status": false,
    "response": "",
    "message": "Unauthorized!"
}
            

Informational Commands

Get Basic Account Info

API URL : https://kryptonica.net/api/get_basic_info

Success Response

{
    "status": true,
    "response": {
        "username": "smith",
        "email": "smith*******ator.com",
        "merchant_id": "2f7a70*************01cd6"
    },
    "message": ""
}
            

Informational Commands

Get Coin Balances

API URL : https://kryptonica.net/api/get_balance

Success Response

{
    "status": true,
    "response": [
        {
            "coin": "BTC",
            "available": "0.00000000",
            "locked": "0.00000000",
            "total": "0.00000000"
        },
        {
            "coin": "ETH",
            "available": "1.00000000",
            "locked": "0.00000000",
            "total": "1.00000000"
        },
        {
            "coin": "USDT",
            "available": "0.00000000",
            "locked": "0.00000000",
            "total": "0.00000000"
        },
        {
            "coin": "BUSD",
            "available": "0.00000000",
            "locked": "0.00000000",
            "total": "0.00000000"
        },
        {
            "coin": "USDC",
            "available": "0.00000000",
            "locked": "0.00000000",
            "total": "0.00000000"
        }
       
    ],
    "message": ""
}
            

Informational Commands

Get Deposit Address

API URL : https://kryptonica.net/api/get_deposit_address

Parameters

Name Type Mandatory Description
Symbol currency YES The parameters should be like this, BTC, ETH

Success Response

{
    "status": true,
    "response": {
        "address": "18x***********4LFbkh"
    },
    "message": ""
}
            

Receiving Payments

Create Transaction

Note: This API is for making your own custom checkout page so buyers don't have to leave your website to complete payment. 99% of the time you don't need the extra complexity and would just use a Simple or Advanced button which you can find in our Merchant Tools section.

API URL : https://kryptonica.net/api/create_transaction

Parameters

Name Type Mandatory Description
Cmd cmd YES The parameters should be like this, simple or advanced
Amount amount YES The amount of the transaction in the original currency (currency1 below).
Currency currency1 YES The original currency of the transaction.
Currency currency2 YES The currency the buyer will be sending. For example if your products are priced in BTC but you are receiving ETH, you would use currency1=BTC and currency2=ETH. currency1 and currency2 can be set to the same thing if you don't need currency conversion.
Network network YES This is optional for all crypto except USDT. So, you need to select network type whether ERC20 or TRC20 to make payment in USDT crypto.
Buyer Email buyer_email YES Set the buyer's email address. This will let us send them a notice if they underpay or need a refund. We will not add them to our mailing list or spam them or anything like that.
Address address NO Optionally set the address to send the funds to (if not set will use the settings you have set on the 'Coins Acceptance Settings' page). Remember: this must be an address in currency2's network.
Buyer Name buyer_name NO Optionally set the buyer's name for your reference.
Item Name item_name YES Item name for your reference, will be on the payment information page and in the IPNs for the transaction.
Item Number item_number YES Item number for your reference, will be on the payment information page and in the IPNs for the transaction.
Invoice invoice YES Another field for your use, will be on the payment information page and in the IPNs for the transaction.
IPN URL ipn_url YES URL for your IPN callbacks. If not set it will use the IPN URL in your Edit Settings page if you have one set.
Success URL success_url YES Sets a URL to go to if the buyer does complete payment. (Only if you use the returned 'checkOut', no effect/need if designing your own checkout page.)
Cancel URL cancel_url YES Sets a URL to go to if the buyer does not complete payment. (Only if you use the returned 'checkOut', no effect/need if designing your own checkout page.)

Success Response

{
    "status": true,
    "response": {
        "original_amount": "0.1",
        "original_currency": "ETH",
        "selected_amount": "0.10000000",
        "selected_currency": "ETH",
        "address": "0xc4C6C******a830C4B",
        "payment_id": "Easy*******",
        "confirms_needed": 1,
        "timeout": 18000,
        "qrcode_url": "https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=0xc4C6C******a830C4B&choe=UTF-8"
    },
    "message": ""
}
            

Failure Response

{
    "status": false,
    "response": "",
    "message": "Unauthorized!"
}
            

Receiving Payments

Get TX Info

API URL : https://kryptonica.net/api/get_tx_info

Parameters

Name Type Mandatory Description
Invoice ID invoice_id YES The parameters should be like this, EASY****

Success Response

{
    "status": true,
    "response": {
        "transaction_details": {
            "payment_id": "Easy6****6G54",
            "date_time": "28-01-2021 19:04:14",
            "status": "Payment completed successfully",
            "original_amount": "0.10000000",
            "original_currency": "ETH",
            "selected_amount": "0.10000000",
            "selected_currency": "ETH",
            "buyer_email": "smih****nator.com",
            "invoice": "123456",
            "item_name": "test",
            "item_number": "",
            "callback_url" : https://kryptonica.net/api/checkoutURL/{payment_id}
        },
        "payment_details": {
            "date_time": "28-01-2021 19:13:05",
            "from_address": "0x05****21b2b9f5",
            "to_address": "0xd135f****7d25e7d4",
            "amount": "1.00000000",
            "txn_id": "0xc33e******95156963"

        }
    },
    "message": ""
}
            

Receiving Payments

Get TX List

API URL : https://kryptonica.net/api/get_tx_list

Success Response

{
    "status": true,
    "response": {
        "transaction_details": [
            {
                "payment_id": "Easy6****6G54",
                "date_time": "28-01-2021 19:04:14",
                "status": "Payment completed successfully",
                "original_amount": "0.10000000",
                "original_currency": "ETH",
                "selected_amount": "0.10000000",
                "selected_currency": "ETH",
                "buyer_email": "smih****nator.com",
                "invoice": "123456",
                "item_name": "test",
                "item_number": ""
            }
        ]
    },
    "message": ""
}
            

Withdrawals

Make Withdrawal

API URL : https://kryptonica.net/api/withdraw

Parameters

Name Type Mandatory Description
Currency currency YES The parameters should be like this, BTC, ETH
Withdrawal Address address YES The parameters should be like this, xxxxxxxxx (If you want to send amount to multiple address then format should be address1,address2,address3)
Withdrawal Amount amount YES The parameters should be like this, 0.001 (If you want to send amount to multiple address then format should be 0.001,0.002,0.003)

Success Response

{
    "status": true,
    "response": {
        "reference_id": "a8651000XXXXXXX8e562e"
    },
    "message": "Withdraw has been successfully sent. Your request will be confirmed within few minutes to over 10 minutes."
}
            

Failure Response

{
    "status": false,
    "response": "",
    "message": "Currency not available!"
}
            

Withdrawals

Get Withdrawal History

API URL : https://kryptonica.net/api/get_withdraw_history

Parameters

Name Type Mandatory Description
Currency currency YES The parameters should be like this, BTC, ETH

Success Response

{
    "status": true,
    "response": [
        {
            "withdraw_id": "your_withdrawal_id",
            "txn_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "address": "16Fg*******zGasw5",
            "amount": "250.00000000",
            "fee": "0.00000000",
            "total": "250.00000000",
            "currency": "BTC",
            "status": "Rejected",
            "date_time": "21-01-2021 18:16:18"
        }
    ],
    "message": ""
}
            

Failure Response

{
    "status": false,
    "response": "",
    "message": "Transaction not found!"
}
            

Withdrawals

Get Withdrawal Info

API URL : https://kryptonica.net/api/get_withdraw_info

Parameters

Name Type Mandatory Description
Currency currency YES The parameters should be like this, BTC, ETH
Withdrawal ID withdraw_id YES The parameters should be like this, 123456

Success Response

{
    "status": true,
    "response": {
        "withdraw_id": "your_withdrawal-id",
        "txn_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "address": "16Fg2******zGasw5",
        "amount": "250.00000000",
        "fee": "0.00000000",
        "total": "250.00000000",
        "currency": "BTC",
        "status": "Rejected",
        "date_time": "21-01-2021 18:16:18"
    },
    "message": ""
}
            

Failure Response

{
    "status": false,
    "response": "",
    "message": "Transaction not found!"
}