NAV
bash javascript

Introduction

Overview

CTK API provides a simple and robust RESTful API to integrate digital currency wallets with your application. With this platform we provide the possibility of the user to integrate thier apps with more then 22 different digital assets in a single interface.

CTK API provides

Authorization

CTK API works with a signed JWT token authentication that refreshes every 60 minutes. All authenticated calls should have a header included on their request.

Example of the authentcation header

Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1...

Request Standards

All requests in CTK API must be sent in raw JSON format and contain the JSON type content header.

Example of the content type header

Content-Type: application/json

All responses in CTK API will also be in JSON format always returning the key "success" with a bool (true or false) to rapidly infer to the app if the transcation was successfull. Following this pattern there are two possible response formats in the API.

For a success response, the JSON structure will contain the "success" key and if any data is returned from the call it will always be present in the "data" key.

Example of a success response structure

{
    "success": true,
    "data": {
        // Data object is only present if data is returned from the call
    }
}

For an error response, the JSON structure will contain the "success" key and if any error messages were generated by the call it will populate the error array. If no error message is present the error array will be empty. In case any error is returned, the error array will contain objects with the error code and message.

Example of an error response structure

{
    "success": false,
    "error": [{
        "code": 100,
        "message": "This is an error message"
    }]
}

Environment

CTK API official sandbox is: https://sandbox.centrawallet.com/api

It is online for testing purposes only to help users develop and test their application. Once user is ready to move to production, our team will setup the users official url to do live production calls.

Wallet Methods

The wallet methods combine a group of methods that will interact with the users balance and address generation. The methods will also be used to update the wallet in which the user will be using with the card.

Get Wallets

Get wallets method will list all available wallets the user has available, the list o wallets will be composed of the user balance, the symbol it refers to, the current USD currency value of the balance. It will return all values both in float format and in string format so app don't have to worry about string formatting the currency value. Besides bringing balance information the method also returns symbol specific parameters to help apps on formatting the frontend, like image URL of the symbol, and color.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/wallet" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/wallet",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": [
        {
            "title": "Dash",
            "image": "https://s3.amazonaws.com/centra-public/content/uploads/2018/02/26123707/DASH-copy.png",
            "color": "#2573c2",
            "symbol": "DASH",
            "balance": 40.19296762,
            "balanceFormatted": "40.19297",
            "balanceCurrency": 16115.370367239,
            "balanceCurrencyFormatted": "$16,115.37",
            "isActive": false
        }
    ]
}

HTTP Request

GET api/v3/wallet

HEAD api/v3/wallet

Generate Address

The generate address method will return the address which will fund the user balance for the symbol requested. The app should send the symbol in the URL to inform the API from which node it will pull the address from and standby for funding. Some addresses that need an extra parameter ID like Monero, Ripple, Stellar, etc. will come with a colon which will have to be split in order to show correctly the address and parameter ID the user must send to. The API will validate if the symbol is in active status and if user has enabled receive for that particular symbol before generating the address.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/wallet/address/BTC" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/wallet/address/BTC",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "address": "1LLzN2ffsY1AdvswuGLMDnBro5FA8uwDZN",
        "symbol": "BTC"
    }
}

HTTP Request

GET api/v3/wallet/address/{symbol}

HEAD api/v3/wallet/address/{symbol}

Wallet Withdraw

The wallet withdraw method will execute the official send from the user wallet to the address and symbol they choose to. This transaction is irreversible once a success message is received because it involves sending the transaction to the blockchain. Constraints such as balance and availability will be validated upon request.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/wallet/withdraw/CTR" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
-d "{ \"address\": \"0x533584114A1cE143318858BAB997DC00DA575faA\", \"amount\": 1 }" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/wallet/withdraw/CTR",
    "method": "POST",
    "data": "{ \"address\": \"0x533584114A1cE143318858BAB997DC00DA575faA\", \"amount\": 1 }",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "id": "5abf9454a3972b36dc005639",
        "symbol": "CTR",
        "txhash": "0x2ab8f1aae3696f3b9193dff706c1c6633fc1d5d705cccb304cc3298eb290d832",
        "title": "Withdraw",
        "amount": 2.2,
        "amountFormatted": "2.20000",
        "conversionRateAtTransaction": 0.3295,
        "conversionRateAtTransactionFormatted": "$0.33",
        "usdAmountAtTransaction": 0.7249000000000001,
        "usdAmountAtTransactionFormatted": "$0.72",
        "conversionRateNow": 0.32759001,
        "conversionRateNowFormatted": "$0.33",
        "usdAmountNow": 0.720698022,
        "usdAmountNowFormatted": "$0.72",
        "dateTime": "2018-03-31 09:59:48",
        "type": "Sent"
    }
}

HTTP Request

GET api/v3/wallet/withdraw/{symbol}

HEAD api/v3/wallet/withdraw/{symbol}

Parameters

Parameter Type Status Description
address string required The address the amount is being sent to
amount float required The amount that is being sent in the transaction

Update Wallet

The update wallet method enables the possibility of the app to request changes to certain parameters of the wallet. Currently, only the "isDefault" parameter is enabled to be modified by the app. This parameter is very important since it's what informs the card processor from which balance the purchase request from the card will be deducted from. If none is selected, as default, the API will automatically use the highest balance or deny the purchase with the merchant. On the PUT request the client must always in form the symbol on the URL and send the paramaters to be updated on the body in JSON format.

Example request:

curl -X PUT "https://sandbox.centrawallet.com/api/v3/wallet/BTC" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
-d "{ \"isDefault\": true }" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/wallet/BTC",
    "method": "PUT",
    "data": "{ \"isDefault\": true }",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

PUT api/v3/wallet/{symbol}

Parameters

Parameter Type Status Description
isDefault boolean required Put true or false to determine if symbol is usable with the card

User Methods

The user methods combine a series of requests that involves from signup, login, account signup confirmation, to two factor authentication and get user information. Except for User method, all other methods in this collection are what we call "public" methods, these methods don't require the client to send the "Authorization" headers because the user in theory still has not setup an account to aquire one yet. These methods should be the first ones to be implement since most of the other collections require the "accessToken" generated by the login method in this collection to authenticate the client.

User

This is one of two methods in the collection that requires the client to send an "Authorization" header with token. This method is used to retrieve the current information of the user on file.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/user" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "username": "myusername",
        "recordId": "268166600234323379",
        "mfa": false,
        "firstName": "John",
        "lastName": "Doe",
        "email": "john@gmail.com",
        "birthdateDatetime": "1990-07-03",
        "birthdate": "01/07/1990",
        "phone": "+19544884444",
        "country": "US",
        "address": "1000 Elm St.",
        "city": "Somewhere",
        "state": "KS",
        "zipcode": "88995",
        "nin": "625809636",
        "tierLevel": "2",
        "vcLimit": "1"
    }
}

HTTP Request

GET api/v3/user

HEAD api/v3/user

User Signup

This is the first method that any new user should be interacting with in the begining. All parameters are required except for the "overrideConfirmation". Once signup returns a success message, the user will be sent to the CRM database integrated with API and have all initial balances generated for first time login. Once message

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/signup" \
-H "Content-Type: application/json"
-d "{ \"username\": \"johndoe05013\", \"password\": \"Test@1233\", \"firstName\": \"John\", \"lastName\": \"Doe\", \"country\": \"USA\", \"address\": \"55 wash\", \"city\": \"Miami Beach\", \"state\": \"FL\", \"zipcode\": \"33139\", \"nin\": \"23rfdqw32\", \"email\": \"johndoe05013@centra.tech\", \"phone\": \"+17865552739\", \"birthdate\": \"12/14/1988\" }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/signup",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    "data": "{ \"username\": \"johndoe05013\", \"password\": \"Test@1233\", \"firstName\": \"John\", \"lastName\": \"Doe\", \"country\": \"USA\", \"address\": \"55 wash\", \"city\": \"Miami Beach\", \"state\": \"FL\", \"zipcode\": \"33139\", \"nin\": \"23rfdqw32\", \"email\": \"johndoe05013@centra.tech\", \"phone\": \"+17865552739\", \"birthdate\": \"12/14/1988\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example Response

{
    "success": true,
    "data": {
        "signupConfirmation": true
    }
}

HTTP Request

POST api/v3/user/signup

Parameters

Parameter Type Status Description
username string Required Username, must be unique and can not have spaces
password string Required Password must be 8 characters long and have at least one uppercasse letter, one lowercase letter, one number, and one symbol.
firstName string Required The first name of the user
lastName string Required The last name of the user
country string Required The country of the user
address string Required The address of the user
city string Required The city of the user
state string Required The state of the user
nin string Required The government issued id number of the user
email string Required The user e-mail (must be valid as it will be verified)
phone string Required The mobile phone number of the user (must be valid as it's used for verification purposes)
birthdate string Required Birthdate of the user, must be 18+ years and in MM/DD/YYYY format
overrideConfirmation bool Optional This bool can be true or even omitted from request

Signup Verify

This method is necessary to confirm the user account. On the "user/signup" method success response, if it returnds "true" in the "signupConfirmation" key, then the user should receive a text message (SMS) in the phone provided for signup. The code received on that text message should be used in this method to consolidate the confirmation.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/signup/verify" \
-H "Content-Type: application/json" \
-d "{ \"username\": \"johndoe0501\", \"code\": \"493982\" }"

Example Response

{
    "success": true
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/signup/verify",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    data: "{ \"username\": \"johndoe0501\", \"code\": \"493982\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/user/signup/verify

Parameters

Parameter Type Status Description
username string required The username created on signup.
code string Required The verification received by text message (SMS)

Signup Resend Confirmation

In case the verification code expired or the app decides to send the verification code again to the user, this method will resend the confirmation code to the user phone as text message (SMS). The account should then be verified using the Signup Verify method

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/signup/confirm" \
-H "Content-Type: application/json" \
-d "{ \"username\": \"johndoe0501\" }"

Example Response

{
    "success": true
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/signup/confirm",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    data: "{ \"username\": \"johndoe0501\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/user/signup/confirm

Parameters

Parameter Type Status Description
username string Required add username

User Login

This is the main method used to authenticate the user. The user needs to privide thier username and password. The request will validate and in case of success it will return the "accessToken" to be used in the "Authorization" headers for authenticated requests.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/login" \
-H "Content-Type: application/json" \
d- "{ \"username\": \"johndoe0501\", \"password\": \"Test@123\" }" 

Example response without two factor authentication:

{
    "success": true,
    "data": {
        "twoFactorAuth": false,
        "accessToken": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE10N3MxSFJEbHllcWxFPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI3OWY1MmE1My1iNTkxLTQ0NDUtOWZhMi04ZjAzZjQ1NTliNTUiLCJldmVudF9pZCI6IjAwZDk4ZmUwLTI4NzYtMTFlOC1hYjkyLTFkMjVkNTk4OGFiYiIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE1MjExMzQ3OTIsImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTEuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0xX0ZQcEpTQWdlViIsImV4cCI6MTUyMTEzODM5MiwiaWF0IjoxNTIxMTM0NzkyLCJqdGkiOiJmNjFmYzUyMy1mMTk1LTQyMzktYWI1ZC1mYWVjYWY3N2EwMWUiLCJjbGllbnRfaWQiOiI3ZDhvc2Q1MmRpdDE2cmlubXRuZ2hhbzNrMyIsInVzZXJuYW1lIjoiam9obmRvZTA1MDEifQ.h2PCGk6ZCriRsxQVsaIoPzMYiaJhLLNERmqIVKTPhU58yHLA3Lmm_LJ8ddYFLBavXFRlJRnR_nPVzKsDlP6cYdFL-SFXM9_TiWqzSF6si5eshwUxLIyyYqFzSby2UzsLta093P0n6hvqWMtNIHkNqt7FCij0mvx5kaez96BGNfWddsAUuZmKsF25T5ZgV72DqU7rRJ6BaS9TLoUv2XteGjW_g4rlLMbmZRfMLKCw0BcT0helkQ1P9DQKLBm7kiNs6glWDeLAGv_HBfSGwtaTsF1tvpDgCwC8eoTqoMZDvz5cOaxpqismc_5fpyN0AulQBMNewrbV2Z2tN3cgHE9g1Q"
    }
}

Example response with two factor authentication:

{
    "success": true,
    "data": {
        "twoFactorAuth": true,
        "twoFactorData": {
            "CODE_DELIVERY_DELIVERY_MEDIUM": "SMS",
            "CODE_DELIVERY_DESTINATION": "+*******4345",
            "USER_ID_FOR_SRP": "johndoe0501"
        },
        "session": "4lfIp9Ldechty31QY3q_83LQbLegfv8zujp_nxxiKB-8yI80JW0UrmuAA_9NOwB2m8yc1L4FI6fKJqosqci-6cuZkHUnXjjNd5gyDjA18ncS79i4HgF0EuqZJq_SNs8j7p5JPPw3b0H93aH4Zq7lfnbLcRz2yx23H5v4bI9lEnLRmevj3EuS9OSM86agYXWmgnvw1ustG0S4hmT3fQG8eReLxkql8DS8rS2vDPQa2dBPYqGpOI3mOYsxMXMTJJ7Cy3fjQERc52LdzyMsOhI506y22o_2M0tnstRWzYFeYund_Cr2It7NmHMQ9VObiOCgnzFCEQh9bzeg26s39VN2-URijGOF7iJ0278sE0KzbXsli3DRzdvTx_27yrNjTpWtw9l2ECQp7lyPd2eF8is5R8AxeIFb2UVYrTV8j2rsX9AqrXl8nmo9N4Ylix11mHULSm2LbCwolKnmksBEgZqyecJU59JvYbf5v6J4_vhgOj47KOI4p2u_fSyjxSh1WFnDNf9oG1Qu5-cKu8Lbrwbsa368gkLsX8RPnSsYoyvITI7OXATf6Iu9QXfd4A2jaU2meQ29yggbk2kLCjDAKjNkpFv31NSXy7BIkKt8aHbQDfDiKQFvP-j2RfTRjlrp-4Wo6UEndJdzrsDx-beAktR7GWdDUfbNDitO-10JrRlb8_ozsMMQtuc2KYvqtnBMCS9JjWcOXGmVwIxQ0kt2Gy3OZ7RWWIfo6VnDH8mM1FJkFyWQ7_SpC2s6gGnw89vRWjN16OSRGY3Fn6_Vgb6bseuGlSiW9GDyC2tCh76SLPmJoPhX7nr-d8nyAEeypYW4sIAMnFPZBrpThMZWQXryFdiaZ2kRvHYkujMs0sNkU9LPbSlEoP6tGfQfTwfOkvJl_Nre5mckhDKfmVVijy8xvlR6sdkfA0n2BkNGqoLA9lG2VssnHjLBcpX4YTRsH2HM1ptdRrUoyMrGvk0Ok2QtgXbPQjYnJDbxls4VACLbh0tiMQ8wF8v97nyVKKxLx3tCMx0B0CQf-WjiF6DBUxjYdWjw713pIw2fZ9xSCPmWmAipVVk5B8my91AlZYUXeR5JkKz4UlMmxipQcYySOWKmFSIT7fuNPC_peAJDrTsThVa7bcu1iQP6JCHhaaiTNw0KVdKZq-ZzmE1ex5xfDCUvP0L-E9vYE9emO7XDe1TtRUqnhpEdjO-c0YwB65jpzhXkAFKfWQ52k5EMvvwhVXpP25KDDQxrD2Q_Vv-s5AQC8Zj5Zn4UDMXezHp3_SijyrtW9gzG6hQWgkP8gC5_gMVWS_gzgQ"
    }
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/login",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    "data": "{ \"username\": \"johndoe0501\", \"password\": \"Test@123\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/user/login

Parameters

Parameter Type Status Description
username string Required The username of the user
password string Required The password of the user

User Login Code

In case the user has two factor autnetication activated ("mfa" set to "true" in his profile), then to obtain the "accessToken" the user will need to go through this method. On the User Login you will receive a "session" that will need to be sent on this method toguether with username and code received on the 2fa device.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/login/code" \
-H "Content-Type: application/json" \
-d "{ \"username\": \"johndoe0501\", \"code\": \"332112\", \"session\": \"Yekz8FpVJyzXLoJ117CxvRwj3fwqiPkLIa2VcTwZXq3K9yAqmI_trt6cQlv62UOdj8hDSx9dTRo6_sGUV02TMy6Q2dDA1tNCABJ7fnW8S9jMTfHJqkQhbJ9oMigsU2Qm--gk3sz6qO-5sE1llLuw1Jz_Hlb8rx2UfHlTrXpSLBfFmvtSp_hEE7lVa54LJRf8bzmDA7Nmk6fwo-4c8Ex1b1SC2qgdNqs_RHz6GN5eokfE7VgRxwK0EsmpGx3QES5mK7URDUnPbhENPEtCp-IXdXmm7CVvNXM0c-OHCZvzfKBWdSf5CBjD1HALBpnrwmx9tJl_vtUEbfFeWL7JAtot5L2Jxi1UID8iolbT7EIzhf5w0GmLFV2o-kmsw0QY_pfYljT_0HwaQj4bIJI9ofjxfv4mmZhc2sUEJ9Os-0uypqKonCCQkArYTnyKjOhYX8Z3EdBhEELyswM9D_8X0bxw-6s6JtpshSL2aBGQWYUdwXKoM_mKt8zptUQ82l7ouYZqI7VbCcoAYEAOWTUseebGNHzLMJHEvN4Z7diaeIFdSGpSFSvNXE9aBYTn0LAhrpls39serM6dJzUvM6y4uLGHcEukcGFVGGLcFsxS2YnDLDCOdyjHYjiD98gg2_FR57A3XPABlo677gtyiiaA30YgXSz3DTeeACPA4ch5o7KiH2bv1LOssx9HlmHO6VBZLeBGj3dniS5e5VpBykcuuetfgJ9sHaoMUAFLD7ywaOarPBE30mEm0DUD_C3GxCKylWYk2uA2RZ9lzFk6p8HL7M5HhQSEFPC-9A_z521KrLtnhxUgip-hIiwHDqNY1bwXVSZFaEOvgUuw4bwW84A6T6ULQxgAwOqwExRVgnBpbyCYKB1HdeYK0AfxSGCDFz9Xu47iZAVe8W57jSmNmgUzj22rzWx3xmZ8rY26EINoC8gNC_SLAGiYtxaO0IXEK1Jo6E0EJTNOgdtegjm_ZPFGMCTdIDurdYX2GNOfi4hicfPNOoeYUw1J7kiUvQZK0uM87DDWNfJAqlJnrrYSzV0aJfPms3wNfVEjZxP18u-HxqIt5ZIcB77kklf-dNl0wVChyncZCwxXuiMmo4N8nXiz2kOT_cZ8eOxLp-a1vyCtMlp50p2CVljrF5cO_AFXYTQ5sLEUTs7p2ZHGTK20MZpV0jPSJNXkEvywqrcwBdQVGl1VxCkoyJHv05yIuR3EhIi3JV7XeG939-Ja7Dg_phLFBj2R-PZDr_jgas_NsnCy2ai-Xj7HC7fdcOnngO0IhblsiqUdH1zkOxmcmVXO8OAVgeIiA\" }"

Example response:

{
    "success": true,
    "data": {
        "accessToken": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE10N3MxSFJEbHllcWxFPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJlMmFjYTE3My0wZTYyLTRiZGYtOWU0Mi1kMmZkNzVmMGQzOTkiLCJldmVudF9pZCI6Ijk5NGVjNTgyLTI5ZjYtMTFlOC05ZGJjLTZiNjA5YTEzMmZhMSIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE1MjEzMDAwMDksImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTEuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0xX0ZQcEpTQWdlViIsImV4cCI6MTUyMTMwMzYwOSwiaWF0IjoxNTIxMzAwMDA5LCJqdGkiOiI1MTAyZWE0Mi1kN2E2LTRkOGItOGJjZi1iYmZlYjMzN2RiOTIiLCJjbGllbnRfaWQiOiI3ZDhvc2Q1MmRpdDE2cmlubXRuZ2hhbzNrMyIsInVzZXJuYW1lIjoiamFyeXNhcmRpbmhhIn0.MxLFOrRJszV6kZE2mcqonsAaXKxDZkNtaqQc0VceH9dw8hLedGGT2NkTzEH5TKMJaUjNEgjZVyeMyvWMQCr4mtcj1f6eyGTNOoim1xumzCnIzaX4KxZef7xVnD0YlhNsdCrv7QD1RGcIz8zcNaPj5jfeAkYnKAxWUc9qqq8xVcE18rwAoKgustZFOLSoYSQ-lJ0fNKcJcdeGe8m8FoDXJo7pS-ivmi1LpgASXt04PbGaw0rkc05IroTcmfg7HHQcBle0-GCeHlhSW-MEmTO36ZeNMnUV7GAywCmqmu_sZGUROXA4-P2byVqDnECRvPMiHzXF5x9toxUbzsYK7y01Mg"
    }
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/login/code",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    "data": "{ \"username\": \"johndoe0501\", \"code\": \"332112\", \"session\": \"Yekz8FpVJyzXLoJ117CxvRwj3fwqiPkLIa2VcTwZXq3K9yAqmI_trt6cQlv62UOdj8hDSx9dTRo6_sGUV02TMy6Q2dDA1tNCABJ7fnW8S9jMTfHJqkQhbJ9oMigsU2Qm--gk3sz6qO-5sE1llLuw1Jz_Hlb8rx2UfHlTrXpSLBfFmvtSp_hEE7lVa54LJRf8bzmDA7Nmk6fwo-4c8Ex1b1SC2qgdNqs_RHz6GN5eokfE7VgRxwK0EsmpGx3QES5mK7URDUnPbhENPEtCp-IXdXmm7CVvNXM0c-OHCZvzfKBWdSf5CBjD1HALBpnrwmx9tJl_vtUEbfFeWL7JAtot5L2Jxi1UID8iolbT7EIzhf5w0GmLFV2o-kmsw0QY_pfYljT_0HwaQj4bIJI9ofjxfv4mmZhc2sUEJ9Os-0uypqKonCCQkArYTnyKjOhYX8Z3EdBhEELyswM9D_8X0bxw-6s6JtpshSL2aBGQWYUdwXKoM_mKt8zptUQ82l7ouYZqI7VbCcoAYEAOWTUseebGNHzLMJHEvN4Z7diaeIFdSGpSFSvNXE9aBYTn0LAhrpls39serM6dJzUvM6y4uLGHcEukcGFVGGLcFsxS2YnDLDCOdyjHYjiD98gg2_FR57A3XPABlo677gtyiiaA30YgXSz3DTeeACPA4ch5o7KiH2bv1LOssx9HlmHO6VBZLeBGj3dniS5e5VpBykcuuetfgJ9sHaoMUAFLD7ywaOarPBE30mEm0DUD_C3GxCKylWYk2uA2RZ9lzFk6p8HL7M5HhQSEFPC-9A_z521KrLtnhxUgip-hIiwHDqNY1bwXVSZFaEOvgUuw4bwW84A6T6ULQxgAwOqwExRVgnBpbyCYKB1HdeYK0AfxSGCDFz9Xu47iZAVe8W57jSmNmgUzj22rzWx3xmZ8rY26EINoC8gNC_SLAGiYtxaO0IXEK1Jo6E0EJTNOgdtegjm_ZPFGMCTdIDurdYX2GNOfi4hicfPNOoeYUw1J7kiUvQZK0uM87DDWNfJAqlJnrrYSzV0aJfPms3wNfVEjZxP18u-HxqIt5ZIcB77kklf-dNl0wVChyncZCwxXuiMmo4N8nXiz2kOT_cZ8eOxLp-a1vyCtMlp50p2CVljrF5cO_AFXYTQ5sLEUTs7p2ZHGTK20MZpV0jPSJNXkEvywqrcwBdQVGl1VxCkoyJHv05yIuR3EhIi3JV7XeG939-Ja7Dg_phLFBj2R-PZDr_jgas_NsnCy2ai-Xj7HC7fdcOnngO0IhblsiqUdH1zkOxmcmVXO8OAVgeIiA\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/user/login/code

Parameters

Parameter Type Status Description
session string Required The the session received on the User Login method
code string Required The code received on the 2fa device
username string Required The username of the user requesting the accessToken

User Forgot Password

This method is used to help users that forget thier passwords. The method will initiate the authentication flow to change the user password. It uses the users phone on file to send a verification code that needs to be sent on the User Password Confirm method to effectivelly change the password to a new one.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/password" \
-H "Content-Type: application/json" \
-d "{ \"username\": \"johndoe0501\" }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/password",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    "data": "{ \"username\": \"johndoe0501\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "codeDeliveryMethod": "SMS",
        "codeDestination": "+*******0612"
    }
}

HTTP Request

POST api/v3/user/password

Parameters

Parameter Type Status Description
username string Required The username of the user initiating the authentication flow

User Logout

This method will logout the user and make the access token invalid immediately on all devices.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/user/logout" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/login",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response without two factor authentication:

{
    "success": true
}

HTTP Request

GET api/v3/user/logout

User Forgot Password Confirm

This method is the final part of the authentication flow initiated in the User Forgot Password method. The app must send the username, verification code received on the device, and the new password with the "password" parameter.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/password/confirm" \
-H "Content-Type: application/json"
-d "{ \"username\": \"johndoe0501\", \"code\": \"662624\", \"password\": \"Test@123\" }"

Example response:

{
    "success": true
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/password/confirm",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    "data": "{ \"username\": \"johndoe0501\", \"code\": \"662624\", \"password\": \"Test@123\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/user/password/confirm

Parameters

Parameter Type Status Description
username string Required The username of the user that initiated the forgot password authentication flow
code string Required The verification code received as text message on the phone (SMS)
password string Required The new password, must be 8 characters long, have at least 1 uppercase letter, 1 lowercase letter, 1 numberm, and 1 symbol

User Update

This method is used to update the user information in the CRM database and also update login attributes like 2FA (with the "mfa" key). This is the second and last method in the User Methods that the app needs to send the "Authorization" headers. On this request, only paramareters that are going to be updated need to sent on request. The API will only update the parameters present on the body JSON. As success it should return all user information with the updated parameters.

Example request:

curl -X PUT "https://sandbox.centrawallet.com/api/v3/user/update" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
-d "{ \"mfa\": true }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/update",
    "method": "PUT",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    },
    data: "{ \"mfa\": true }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "username": "johndoe0501",
        "recordId": "2681666000004306464",
        "mfa": true,
        "firstName": "John",
        "lastName": "Doe",
        "email": "johndoe0501@mailinator.com",
        "birthdateDatetime": "1990-03-08",
        "birthdate": "03/08/1990",
        "phone": "+13055600612",
        "country": "US",
        "address": "FL",
        "city": "Miami",
        "state": "FL",
        "zipcode": "33130",
        "nin": "81818181",
        "tierLevel": "1",
        "vcLimit": 0
    }
}

HTTP Request

PUT api/v3/user/update

Parameters

Parameter Type Status Description
username string Optional Username, must be unique and can not have spaces
firstName string Optional The first name of the user
lastName string Optional The last name of the user
country string Optional The country of the user
address string Optional The address of the user
city string Optional The city of the user
state string Optional The state of the user
nin string Optional The government issued id number of the user
email string Optional The user e-mail (must be valid as it will be verified)
phone string Optional The mobile phone number of the user (must be valid as it's used for verification purposes)
birthdate string Optional Birthdate of the user, must be 18+ years and in MM/DD/YYYY format
mfa bool Optional This parameter defines the user 2fa preference, must send "true" or "false" bool

Step-by-Step Signup Methods

This collection is used if the app developer prefers to add the user signup flow on a step-by-step basis. Currently this flow is composed of 9 steps. 4 of the 9 methods don't require the access token, but the rest all require user to be logged in (it is advised for user experience to login user on the backend at this stage). If user chooses this method, it is advised that they be aware of the "singupStepsCompleted" variable returned on the User method. It will show the number of steps completed, if user does not have all 9 step, app should direct user to the correct step. Ex: If user has 5 completed steps then they should be directed to step 6.

Step 1

This is the first step of the signup process, on this step user should send basic information to get first part of the login process setup. After receiving a success message on this step, the user will receive a verification number on thier phone. The verification number must be sent on Step 2.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/user/signup/step1" \
-H "Content-Type: application/json"
-d "{ \"username\": \"fulano\", \"password\": \"@jA2543232\", \", \"phone\": \"+19589992222\", \"email\": \"fulano@email.com\", \"firstName\": \"FULANO\", \"lastName\": \"DE TAL\" }" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/user/signup/step1",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json"
    },
    "data": "{ \"username\": \"fulano\", \"password\": \"@jA2543232\", \", \"phone\": \"+19589992222\", \"email\": \"fulano@email.com\", \"firstName\": \"FULANO\", \"lastName\": \"DE TAL\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "username": "fulano",
        "email": "fulano@email.com",
        "phone": "+19589992222"
    }
}

HTTP Request

GET api/v3/user/signup/step1

HEAD api/v3/user/signup/step1

Get Parameters

Parameter Status Default Description
username Required null The username user will use to login
password Required null The password for the user, must have at least one uppercase letter, one lowercase letter, one number, one symbol, and full password must be at least 8 characters long
email Required null The e-mail of the user, will be used for confirmation and verifications
phone Required null The phone of the user, will be used for confirmation and verifications
firstName Required null The first name of the user
lastName Required null The last name of the user

Transaction Methods

Transaction By Symbol

This method is used to list the user transaction and group it by symbol to make it easy for the ui to loop through it.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/transactionBySymbol?page=1&limit=100&symbol=CTR" \
-H "Content-Type: application/json"
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/transactionBySymbol?page=1&limit=100&symbol=CTR",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "group": {
            "CTR": {
                "page": 1,
                "totalPages": 25,
                "limit": 1,
                "total": 25,
                "transactions": [
                    {
                        "id": "5a9c1586faec643da528eb7e",
                        "symbol": "CTR",
                        "txhash": "0xf54e150d2f85be47334bfa378f0f0ea43cb629f92fffbebef70eee03b5b41f10",
                        "title": "",
                        "amount": 3,
                        "amountFormatted": "3.00000",
                        "conversionRateAtTransaction": 0.68511663,
                        "conversionRateAtTransactionFormatted": "$0.69",
                        "usdAmountAtTransaction": 2.05534989,
                        "usdAmountAtTransactionFormatted": "$2.06",
                        "conversionRateNow": 0.41045796,
                        "conversionRateNowFormatted": "$0.41",
                        "usdAmountNow": 1.23137388,
                        "usdAmountNowFormatted": "$1.23",
                        "dateTime": "2018-03-03 16:37:10",
                        "type": "Receive"
                    }
                ]
            }
        }
    }
}

HTTP Request

GET api/v3/transactionBySymbol?page=1&limit=100

HEAD api/v3/transactionBySymbol

Get Parameters

Parameter Status Default Description
page Optional 1 The page to list
limit Optional 100 The maximum number of results to list

Transaction

This method is used to list the user transaction. It will paginate according to the GET parameters sent. If none are sent it will assume default values.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/transaction?page=1&limit=100" \
-H "Content-Type: application/json"
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \

Example response:

{
    "success": true,
    "data": {
        "page": 1,
        "totalPages": 1,
        "limit": 17,
        "total": 17,
        "transactions": [
            {
                "id": "5a43bffasdffd795sda30245289001e",
                "symbol": "BTC",
                "txhash": "466f5d7725asd1ff98fasdfa7c1sdfe35e27a29522fd86a0ac041cce5b8e882f45f",
                "title": "",
                "amount": 0.00022881,
                "amountFormatted": "0.00023",
                "conversionRateAtTransaction": 15237.81,
                "conversionRateAtTransactionFormatted": "$15,237.81",
                "usdAmountAtTransaction": 3.4865633061,
                "usdAmountAtTransactionFormatted": "$3.49",
                "conversionRateNow": 8133.3252,
                "conversionRateNowFormatted": "$8,133.33",
                "usdAmountNow": 1.860986139012,
                "usdAmountNowFormatted": "$1.86",
                "dateTime": "2018-02-12 13:03:00",
                "type": "Receive"
            },
            {
                "id": "5a3bc039bad7d23450f40401b1",
                "symbol": "BTC",
                "txhash": "1712asdff232241600asqfdf4441",
                "title": "PAYPAL",
                "amount": 0.0001,
                "amountFormatted": "0.00010",
                "conversionRateAtTransaction": 16244.4,
                "conversionRateAtTransactionFormatted": "$16,244.40",
                "usdAmountAtTransaction": 1.62444,
                "usdAmountAtTransactionFormatted": "$1.62",
                "conversionRateNow": 8133.3252,
                "conversionRateNowFormatted": "$8,133.33",
                "usdAmountNow": 0.81333252,
                "usdAmountNowFormatted": "$0.81",
                "dateTime": "2018-02-06 19:27:03",
                "type": "Sent"
            }
        }
    }
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/transaction?page=1&limit=100",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

GET api/v3/transaction

HEAD api/v3/transaction

Get Parameters

Parameter Status Default Description
page Optional 1 The page to list
limit Optional 100 The maximum number of results to list
symbol Optional null If sent, it will bring only transactions for that symbol

Transaction Total

This method is will filter transactions based on parameters of time frame. It will aggregate all transactions on the given period in time and show to the client the total amount in USD (at the time of receival or send), amount of transactions, and and array of the transactions related to the period. The method also enables the app to filter by symbol and transaction type.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/transaction/total?type=receive&period=monthly&symbol=XRP" \
-H "Content-Type: application/json"
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/transaction/total?type=receive&period=monthly&symbol=XRP",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "type": "receive",
        "period": {
            "type": "monthly",
            "min": "2018-03-01 00:00:00",
            "max": "2018-03-31 23:59:59"
        },
        "total": 311.12927,
        "totalFormatted": "$311.13",
        "totalTransactions": 10,
        "transactions": [
            {
                "id": "5aa68e755cb9e35ae7fca818",
                "symbol": "XRP",
                "txhash": "C9B58F15CB6EA72AFAEC060169A97A9109387DCC247C69B1EAFA2CAF875D61F2",
                "title": "",
                "amount": 41.207778,
                "amountFormatted": "41.20778",
                "conversionRateAtTransaction": 0.7966431,
                "conversionRateAtTransactionFormatted": "$0.80",
                "usdAmountAtTransaction": 32.827892010032,
                "usdAmountAtTransactionFormatted": "$32.83",
                "conversionRateNow": 0.6326100099,
                "conversionRateNowFormatted": "$0.63",
                "usdAmountNow": 26.068452848537,
                "usdAmountNowFormatted": "$26.07",
                "dateTime": "2018-03-12 10:28:05",
                "type": "Receive"
            }
            //, ......
        ]
    }          
}            

HTTP Request

GET api/v3/transaction/total?type=receive&period=monthly&symbol=XRP

HEAD api/v3/transaction/total

Get Parameters

Parameter Status Default Description
type Optional empty The type of transaction to retrieve, possible values are cardPurchase, receive, sent
page Optional 1 The page to list
limit Optional 100 The maximum number of results to list
symbol Optional null If sent, it will bring only transactions for that symbol
period Optional monthly The period to filter the transactions by, accepted values are daily, weekly, annually, interval (must send startDate and endData parameter), monthly
startDate Optional null The start date in datetime format YYYY-MM-DD
endDate Optional null The end date in datetime format YYYY-MM-DD

Symbol Methods

The symbol methods collection currently has one method which has the purpose to provide the apps the current available assets on the API. It will provide apps full information on the symbol regarding display name, image, conversion rate, etc.

Symbol

This method will get all available symbols for the API client. It will return importante information regarding the symbol such as status, image, title, receive and send status, order to display in apps (it already lists in proper order), if card is spendable on the card, color of the symbol to personalize the UI color pattern, fee, etc.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/symbol" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/symbol",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": [
        {
            "title": "Centra",
            "symbol": "CTR",
            "card": "centra",
            "image": "https://s3.amazonaws.com/centra-public/content/uploads/2018/02/26123705/Centra-copy.png",
            "status": true,
            "receive": true,
            "send": true,
            "cardSpendable": false,
            "conversionRate": {
                "USD": {
                    "price": 0.36709398,
                    "priceFormatted": "$0.37"
                }
            },
            "order": 1,
            "color": "#dcf1f8",
            "fee": 1.2,
            "feeFormatted": "$1.20"
        },
        {
            "title": "Bitcoin",
            "symbol": "BTC",
            "card": "bitcoin",
            "image": "https://s3.amazonaws.com/centra-public/content/uploads/2018/02/26123703/Bitcoin-copy.png",
            "status": true,
            "receive": true,
            "send": true,
            "cardSpendable": true,
            "conversionRate": {
                "USD": {
                    "price": 7828.92,
                    "priceFormatted": "$7,828.92"
                }
            },
            "order": 2,
            "color": "#f7931a",
            "fee": 0.01,
            "feeFormatted": "$0.01"
        }
        //, ...
    ]
}        

HTTP Request

GET api/v3/symbol

HEAD api/v3/symbol

Card Methods

Card

This method will list all cards available that the user can use with with the wallet. It will show the status, type, and two image paramaters indicating the front and back of the card image to be used if its virtual.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/card" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/card",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "cards": [
            {
                "san": "417011732",
                "cardType": "gold",
                "status": true,
                "virtual": false,
                "image": {
                    "front": "https://s3.amazonaws.com/centra-public/content/uploads/2018/02/19170856/card_Gold-card_front.png",
                    "back": ""
                }
            }
        ]
    }
}

HTTP Request

GET api/v3/card

HEAD api/v3/card

Card Issue

This method is to issue a card to the user. It is an empty method, as it has the objective to issue a card to a user with correct profile information and KYC clearance.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/card/issue" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/card/issue",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "san": "123456789" 
    }
}

HTTP Request

POST api/v3/card/issue

Card Info

This request informs the user card status in the system.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/card/info" \
-H "Content-Type: application/json" \ 
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/card/info",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "san": "123456789",
        "status": true,
        "virtual": true,
        "cardNumber": "****************",
        "cardExpDate": "04/22",
        "cardCvv": "***"
    }
}

HTTP Request

POST api/v3/card/info

Parameters

Parameter Type Status Description
san number Required San is number accociated with an individual card.

Card Activate

This method is used to activate the card a user has received. To activate a card the user needs to send the received card's SAN number on the back of the card and CVV number.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/card/activate" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/card/activate",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    },
    "data": "{ \"san\": \"12456789\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "san": "123456789",
        "status": true,
        "virtual": true,
        "cardNumber": "****************",
        "cardExpDate": "04/22",
        "cardCvv": "***"
    }
}

HTTP Request

POST api/v3/card/activate

Parameters

Parameter Type Status Description
san number Required San is number accociated with an individual card.

Card Status

With this method the user can update the status of the card. The app must send the SAN number on the url and SAN number as JSON body. With this request the user can lock or unlock the card for usage.

Example request:

curl -X PUT "https://sandbox.centrawallet.com/api/v3/card/status/123456789" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
-d "{ \"status\": true }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/card/status/{san}",
    "method": "PUT",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    },
    "data": "{ \"san\": \"12456789\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "san": "123456789",
        "status": true,
        "virtual": true,
        "cardNumber": "****************",
        "cardExpDate": "04/22",
        "cardCvv": "***"
    }
}

HTTP Request

PUT api/v3/card/status/{san}

Parameters

Parameter Type Status Description
status boolean Required true or false

External Provider Methods

The "External Provider Methods" collection makes it possible to use balances from other wallets in the CTK API. The main purpose of this integration is to let the user use a CTK API issued card with the balance of a third-party wallet.

To have this method working correctly the following must be observed:

Add External provider

This method makes it possible for the user to add an external provider to thier wallet. The user must have the API KEY and API SECRET of the provider they are adding. The provider also needs to be in the list of authorized providers.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/externalProvider" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
-d "{ \"status\": true, \"apiKey\": \"68df0a2c13d7a2898d09e1f70180907d\", \"apiSecret\": \"5a5ad7f5397770cdce18be55bd486205\", \"provider\": \"bithumbs\" }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/externalProvider",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    },
    "data": "{ \"status\": true, \"apiKey\": \"68df0a2c13d7a2898d09e1f70180907d\", \"apiSecret\": \"5a5ad7f5397770cdce18be55bd486205\", \"provider\": \"bithumbs\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "provider": "provider",
        "status": true,
        "apiKey": "324ksdfg839555",
        "apiSecret": "cc984jfgidsfj323"
    }
}

HTTP Request

POST api/v3/externalProvider

Parameters

Parameter Type Status Description
provider string Required The provider the is being added
status boolean Required Determine if the provider is active, must be true or false (activating one will disable all the rest)
apiKey string Required The API KEY from the External Provider (must be generated on the external provider)
apiSecret string Required The API SECRET from the External Provider (must be generated on the external provider)

Edit External Provider

This method makes it possible for the user to edit an external provider. Possible updatable fields are status, apiKey, apiSecret. The provider being edited must be sent at the beginning end of the URL.

Example request:

curl -X PUT "https://sandbox.centrawallet.com/api/v3/externalProvider/yourprovider" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
-d "{ \"status\": true, \"apiKey\": \"asdf234idghaswe23995\", \"apiSecret\": \"asdf234idghaswe23995\", \"provider\": \"yourprovider\" }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/externalProvider/yourprovider",
    "method": "PUT",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    },
    "data": "{ \"apiKey\": \"asdf234idghaswe23995\", \"apiSecret\": \"asdf234idghaswe23995\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "status": true,
        "apiKey": "324ksdfg839555",
        "apiSecret": "cc984jfgidsfj323"
    }
}

HTTP Request

PUT api/v3/externalProvider/{provider}

Parameters

Parameter Type Status Description
status boolean Required Determine if the provider is active, must be true or false (activating one will disable all the rest)
apiKey string Required The API KEY from the External Provider (must be generated on the external provider)
apiSecret string Required The API SECRET from the External Provider (must be generated on the external provider)

Delete External Provider

This method will delete the provider linked to the user, this action will disable immediately the record and return the wallet back to default (show original symbols supported by the wallet)

Example request:

curl -X DELETE "https://sandbox.centrawallet.com/api/v3/externalProvider/yourprovider" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
 }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/externalProvider/yourprovider",
    "method": "DELETE",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "provider": "yourprovider"
    }
}

HTTP Request

DELETE api/v3/externalProvider/{provider}

Get External Provider

This method will return the current active external provider the user has available. Only one external provider can be active on an account.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/externalProvider" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
 }"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/externalProvider/yourprovider",
    "method": "DELETE",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": {
        "provider": "yourprovider"
    }
}

HTTP Request

DELETE api/v3/externalProvider/{provider}

Exchange Methods

Exchange Transactions

This method will return all transactions done by the user. It will list from newest to oldest.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/exchange/transactions" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/exchange/transactions",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": [
        {
            "id": "078e143947ef",
            "createdAt": 1520899877,
            "payinConfirmations": "2",
            "status": "finished",
            "currencyFrom": "xrp",
            "currencyTo": "ltc",
            "payinAddress": "rPujGTiw6nKmMvAiUT6UjpFxT9QrDn9kJP",
            "payinExtraId": "156041",
            "payinHash": "4AFEF913094503014D0F91F41FD8209CD9C48B89D44BBC6BC0221BA805720E4C",
            "payoutAddress": "LWAPtEgkzczJeCmGxQESTmyfEqrdZgFYzj",
            "payoutExtraId": null,
            "payoutHash": "3c9717333b9f9be1774a5f9517928e9c06ab56887a3e926cc01d55fdcd9c6e98",
            "amountFrom": "47.52",
            "amountTo": "0.20525208",
            "networkFee": "0.003",
            "changellyFee": "0.5",
            "apiExtraFee": "0"
        },
        {
            "id": "3bb09c8a2054",
            "createdAt": 1520865047,
            "payinConfirmations": "2",
            "status": "finished",
            "currencyFrom": "xrp",
            "currencyTo": "eth",
            "payinAddress": "rPujGTiw6nKmMvAiUT6UjpFxT9QrDn9kJP",
            "payinExtraId": "155963",
            "payinHash": "156514D0B280BA1332CF659B44BB9759D799E6EFA6C4E51B870B0FC4D0D7F370",
            "payoutAddress": "0x588BF5217B15911ba1c9C01E5aF2ceBbfE371d5f",
            "payoutExtraId": null,
            "payoutHash": "0x6dde0cb69a8eb6c57675e25bdb7c75a8e1ca1bccd86c32f3867a11da39b4393f",
            "amountFrom": "42.57",
            "amountTo": "0.04677343633793722",
            "networkFee": "0.002",
            "changellyFee": "0.5",
            "apiExtraFee": "0"
        }
    ]
}        

HTTP Request

GET api/v3/exchange/transactions

HEAD api/v3/exchange/transactions

Exchange

With this method the app wil get all possible exchange combination (pairs) for coin swaps. It will show the current amount it is needed for each asset to be converted to another asset as listed.

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/exchange" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 

Example response:

{
    "success": true,
    "data": [
        {
            "from": "BTC",
            "to": "ETH",
            "amountFrom": 1,
            "amountFromFormatted": "1.00000",
            "amountTo": 13.694185,
            "amountToFormatted": "13.69419"
        },
        {
            "from": "BTC",
            "to": "LTC",
            "amountFrom": 1,
            "amountFromFormatted": "1.00000",
            "amountTo": 48.8545,
            "amountToFormatted": "48.85450"
        },
        {
            "from": "BTC",
            "to": "DASH",
            "amountFrom": 1,
            "amountFromFormatted": "1.00000",
            "amountTo": 19.608465,
            "amountToFormatted": "19.60847"
        }
    ]
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/exchange",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

GET api/v3/exchange

HEAD api/v3/exchange

Exchange ID

Get the status of a currently executed exchange. This method is very important as it will engage the user to the real live status of the exchange that was instantiated. It will return five possible status which are "waiting", "confirming", "exchanging", "sending", and "finished".

Example request:

curl -X GET "https://sandbox.centrawallet.com/api/v3/exchange/3bb09c8a2054" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/exchange/3bb09c8a2054",
    "method": "GET",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
    }
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "success": true,
    "data": "finished"
}

HTTP Request

GET api/v3/exchange/{id}

HEAD api/v3/exchange/{id}

Exchange Minimum

This method will return the mininum amount needed to fulfill an exchange between the two coins. Transactions created must use this as minimum amount or the exchange will fail.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/exchange/minimum" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
-d "{ \"from\": \"BTC\", \"to\": \"ETH\" }"

Example response:

{
    "success": true,
    "data": {
        "amount": 0.0012777914,
        "amountFormatted": "0.00128"
    }
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/exchange/minimum",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." 
    },
    "data": "{ \"from\": \"BTC\", \"to\": \"ETH\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/exchange/minimum

Parameters

Parameter Type Status Description
from string Required The asset the exchange will be made from
to string Required The asset the exchange will be made to

Exchange Transaction

This is the most important method within the exchange collection. It will execute an exchange transaction between two assets based on the users avaiability of balance on the asset from whitch it's transfering from.

Example request:

curl -X POST "https://sandbox.centrawallet.com/api/v3/exchange/transaction" \
-H "Content-Type: application/json" \
-H "Authorization: eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..." \
-d "{ \"from\": \"XRP\", \"to\": \"ETH\", \"amount\": \"50\" }"

Example response:

{
    "success": true,
    "data": {
        "id": "970ec2975d59",
        "fromAddress": "rPujGTiw6nKmMvAiUT6UjpFxT9QrDn9kJP",
        "fromExtraId": "157002",
        "toAddress": "0x588BF5217B15911ba1c9C01E5aF2ceBbfE371d5f"
    }
}
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://sandbox.centrawallet.com/api/v3/exchange/transaction",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "eyJraWQiOiJJZjM0NFVROXQzUEtaYVJkcU9FclhJOTJSdFUxUE1..."
    },
    "data": "{ \"from\": \"XRP\", \"to\": \"ETH\", \"amount\": \"50\" }"
};

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v3/exchange/transaction

Parameters

Parameter Type Status Description
from string Required The asset the exchange will be made from
to string Required The asset the exchange will be made to
amount number Required a valid amount to exchange