Qredo Partner & Core Client API reference¶
Work in progress
Note that this section is work in progress and is not complete yet.
Introduction¶
Qredo Partner & Core Client APIs enable you to manage funds and perform transactions whilst ensuring robust decentralized custody for your clients.
To gain access to the Partner & Core Client API, create an account by joining the network and applying from the Qredo Web App. Once you’ve completed the signup process and acknowledged our terms, we’ll review your application and if you're accepted you'll be able to generate API keys via the Qredo Web App.
You can use the Partner & Core Client API in test mode without affecting your live data or interacting with networks. The API key you use determines whether the request is live mode or sandbox test mode.
Note
Requests should be submitted in a compressed format and responses are sent in a compressed format. However the examples in this reference are typically uncompressed for ease of comprehension.
Environments¶
Currently, two API environments are available: API Production (prod) and API Play (the test env).
BASE URL on Production
https://api.qredo.network/api/v1/p
You can perform testing on production as well. The Base URL is the same for both testing and live requests but the API keys for authentication are different.
BASE URL on Play
https://play-api.qredo.network/api/v1/p
All API examples use the Prod base URL
All API call examples presented in this guide use the base URL for the Production environment.
Request, response format¶
Our APIs are organized around RESTful principles with resource-oriented URLs. They return compressed JSON encoded responses and use standard HTTP response codes to indicate status and errors. Requests must be submitted in a compressed format.
Authentication¶
EXAMPLE HEADER
Use either a timestamp OR a nonce (not both)!
-H "accept: application/json" \
-H "x-timestamp: <Epoch_timestamp>" \
-H "x-sign: <your_generated_signature>" \
-H "X-API-KEY: <your_API_key>" \
or
-H "accept: application/json" \
-H "x-nonce: <nonce>" \
-H "x-sign: <your_generated_signature>" \
-H "X-API-KEY: <your_API_key>" \
The Partner & Core Client API is served over HTTPS TLS v1.2+ to ensure data privacy; HTTP and HTTPS with TLS versions below 1.2 are not supported. All requests must include a Content-Type of application/json and the body must be valid JSON.
Every request to the Qredo Partner API & Core Client API requires:
- YOUR_API_KEY - the Base64 encoded key (copied to clipboard from the Qredo Web App). This can be either the sandbox key or production key.
-
SIGNATURE AND TIMESTAMP (or NONCE) - The signature is the URL-safe base64 encoding (RFC 4648) of the RSA PKCS #1 1.5 signature of the SHA256 hash of the payload to be signed.
-
PAYLOAD The payload to be signed is the nonce or timestamp concatenated with the URL of the request then the body in compressed JSON format (if that particular call requires a body)
In summary:
- Construct the JSON body.
- Compress the JSON.
- Concatenate it on to the end of the nonce/timestamp and URL.
- Hash it with the SHA256 algorithm.
- Sign the hash with RSA PKCS #1 1.5.
- Encode the signature with URL-safe base64 encoding.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Danger
You must never use API keys in the frontend of your application or malicious users could discover them in your source code. You should only use them on your server. You must never embed API keys in your backend code as this increases the risk of discovery.
Test the API¶
The type of API you use determines whether you use the sandbox or live environment.
You can make all the same API requests in the sandbox API as in the live one. Sandbox results have the same result response structures as live requests.
You can use the sandbox API to simulate API requests and to check:
- Your system's network connectivity with the Partner & Core Client API.
- Your websockets are working correctly.
- You are posting requests in the correct format.
- You are handling responses correctly.
You can generate sandbox API key from the Qredo Web App.
Go live¶
Once you have completed Sandbox testing you can generate live Production API keys from the Qredo Web App.
Error Messages¶
ERROR STRUCTURE
{
"code": "<ERROR_CODE>",
"msg": "<ERROR_MESSAGE>",
"detail": {
"reason": "<NOT_ALWAYS_PRESENT>"
}
}
EXAMPLE ERROR MESSAGE
{
"code": 401,
"msg": "Unauthorized",
"detail": {
"reason": "empty token"
}
}
Qredo uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx
range indicate success. Codes in the 4xx
range indicate an error that failed given the information provided (e.g. a required parameter was omitted). Codes in the 5xx
range indicate an error with Qredo servers (rare).
Some 4xx
errors include an error code explaining the error reported.
All errors are returned with the same structure:
Error Code | Meaning |
---|---|
400 | Bad Request -- The request was not accepted typically due to invalid syntax. Make sure your request is formatted correctly. |
401 | Unauthorized -- The request does not have permission to perform the request. Make sure you've entered a correct API Key for authentication. |
403 | Forbidden -- The API key does not have permission to perform the request. Is your account set up? Contact Support |
404 | Not Found -- The requested resource does not exist. Make sure you've formatted the URL correctly. |
429 | Too Many Requests -- Too many requests hit the API too quickly. Please try again later. |
50x | Internal Server Error -- Something went wrong on Qredo's end (rare). Please try again later. |
Rate Limits¶
tbc
Versioning¶
A publicly released version of a Partner & Core Client API will never change in any way that could impact clients' integrations.
Whenever Qredo makes any API change, a new version of an API will be released that clients can choose to upgrade their integration to.
Changelog¶
tbc
Core resources¶
Assets¶
Assets can be queried without stating a Company_ID. It is a useful endpoint to query prior to performing a transaction.
GET https://api.qredo.network/api/v1/p/assets
EXAMPLE UNCOMPRESSED ASSETS REQUEST
curl -X GET "https://api.qredo.network/api/v1/p/assets"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
EXAMPLE ASSETS RESPONSE
{"assets":
[
{"code":"BTC",
"name":"Bitcoin",
"unitCode":"BTC",
"scale":100000000,
"enabled":true,
"testAsset":false
},
{"code":"BTC-TESTNET",
"name":"Bitcoin Testnet",
"unitCode":"BTC-TEST",
"scale":100000000,
"enabled":true,
"testAsset":true
},
{"code":"ETH",
"name":"Ethereum",
"unitCode":"ETH",
"scale":1000000000,
"enabled":true,
"testAsset":false
},
{"code":"ETH-TESTNET",
"name":"Ethereum Testnet",
"unitCode":"ETH-TEST",
"scale":1000000000,
"enabled":true,
"testAsset":true
}
]
}
Currently, (December 2020) Qredo supports the following assets:
- Bitcoin,
- Bitcoin Testnet,
- Ethereum,
- Ethereum Testnet.
Bitcoin (BTC) is expressed to a scale of 100000000. This is equal to Bitcoin Satoshis. Ether (ETH) is expressed to a scale of 100000000. This is equal to Ether Gwei
Asset Object¶
Attribute | Description |
---|---|
code | String - Asset Code e.g. BTC-TESTNET |
name | String - Asset Name e.g. Bitcoin Testnet |
unitCode | String - Asset unit code e.g. BTC-TEST |
scale | Number - The scale expressing the asset units e.g. 100000000 |
enabled | Boolean - TRUE or FALSE Whether the asset is supported by Qredo or not. |
testAsset | Boolean - TRUE or FALSE - Whether the asset is a test asset or not. |
Fees¶
Fees can be queried without stating a Company_ID. It is a useful endpoint to query prior to performing a transaction. You can calculate the real-time fees for specific assets and transaction types.
POST https://api.qredo.network/api/v1/p/fees
Fees at a glance
- 0.1 bps (or 0.001%) for transfers/atomic swaps
- 0.1 bps (or 0.001%) for withdraws
- NO charge on deposits.
Create Fee Request¶
EXAMPLE UNCOMPRESSED FEE REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/fees"
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "{
"type":"transferOut",
"asset":"BTC-TESTNET",
"amount":200000
}"
EXAMPLE COMPRESSED FEE REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/fees" -H "accept: application/json" -H "X-API-KEY: <YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"type\":\"transferOut\",\"asset\":\"BTC-TESTNET\",\"amount\":200000}"
EXAMPLE FEE RESPONSE
{"netAmount":200000,"amountToSend":200200,"fees":200}
Provide details of your transaction to obtain real-time fees.
Parameters | Description |
---|---|
type | Transaction Type e.g. transferOut See Transaction Types |
asset | Asset Type e.g. BTC-TESTNET |
amount | The asset amount for the transaction e.g. 200000 |
Company¶
A Company represents a customer account created by a partner. Multiple companies can be created corresponding to multiple customer accounts. A company must exist before any transaction can take place.
Company Object¶
Attribute | Description |
---|---|
name* | String - This is a required field. The name allocated to the Company. e.g. Big Funds Inc. |
city | String - The town or city the company is located. e.g. Paris |
country | String - This is the ISO alpha-2 country code e.g. FR |
domain | String - This is the website domain for the company e.g. bigfund.com |
ref | String - This is your reference for the company. |
company_id | String - This is the unique Company ID. |
Create Company¶
EXAMPLE UNCOMPRESSED REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company"
-H "accept: application/json"
-H "X-API-KEY: <YOUR_API_KEY"
-H "Content-Type: application/json"
-d "{
"name":"Big Funds Inc.",
"city": "Paris",
"country":"FR",
"domain":"bigfund.com",
"ref":"<YOUR_REFERENCE>"
}"
EXAMPLE COMPRESSED REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company" -H "accept: application/json" -H "X-API-KEY: <YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"name\":\"Big Funds Inc.\",\"city\":\"Paris\",\"country\":\"FR\",\"domain\":\"bigfund.com\",\"ref\":\"YOUR_REFERENCE\"}"
This is the first step. To create a company, the minimum required parameter is name.
POST https://api.qredo.network/api/v1/p/company
Parameters | Description |
---|---|
name | Required. String - The name of the Company |
ref | String - This is your reference for the company. |
city | String - The town or city the company is located. e.g. Paris |
country | String - This is the ISO alpha-2 country code e.g. FR. See List of Country Codes. |
Returns a Company Object with a unique Company ID.
Retrieve Company¶
EXAMPLE UNCOMPRESSED REQUEST
curl -X GET "https://api.qredo.network/api/v1/p/company/{COMPANYID}"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
EXAMPLE COMPRESSED REQUEST
curl -X GET "https://api.qredo.network/api/v1/p/company/<COMPANY_ID>" -H "accept: application/json" -H "X-API-KEY: <YOUR_API_KEY>"
Retrieve details about a Company from a Company_ID. Includes the information used to create the Company.
GET https://api.qredo.network/api/v1/p/company/{COMPANY_ID}
Parameters | Description |
---|---|
company_id | Required. String - The unique company identifier. |
Returns the Company Object associated with the Company_ID.
Update Company¶
Updates the specified Company by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
PUT https://api.qredo.network/api/v1/p/company/{COMPANY_ID}
All Parameters are optional except for Company_ID.
Parameters | Description |
---|---|
company_id | Required. String - This is the unique Company ID. |
name | String - Company name |
city | String - Company town/city |
country | String - This is the ISO alpha-2 country code |
domain | String - This is the website domain for the company e.g. bigfund.com |
ref | String - This is your reference for the company. |
Returns the Company_ID and Ref.
EXAMPLE UNCOMPRESSED REQUEST
curl -X PUT "https://api.qredo.network/api/v1/p/company/{COMPANY_ID}"
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "{
"name":"Big Funds",
"city":"London",
"country":"UK",
"domain":"bigfunds.co.uk",
"ref":"<YOUR_REFERENCE>"
}"
EXAMPLE COMPRESSED REQUEST
curl -X PUT "https://api.qredo.network/api/v1/p/company/{COMPANY_ID}" -H "accept: application/json" -H "X-API-KEY: <YOUR_API_KEU>" -H "Content-Type: application/json" -d "{\"name\":\"Big Funds\",\"city\":\"London\",\"country\":\"UK\",\"domain\":\"bigfunds.co.uk\",\"ref\":\"<YOUR_REFERENCE>\"}"
Search Company¶
GET https://api.qredo.network/api/v1/p/company/search
Search for a company by entering 3 letters in the query field.
Parameters | Description |
---|---|
query | String 3 letters |
Returns the total_count for the number of matches along with details of each matching company.
EXAMPLE UNCOMPRESSED REQUEST
curl -X GET "https://api.qredo.network/api/v1/p/company/search?query=big"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
EXAMPLE COMPRESSED REQUEST
curl -X GET "https://api.qredo.network/api/v1/p/company/search?query=big" -H "accept: application/json" -H "X-API-KEY: <YOUR_API_KEY>"
EXAMPLE RESPONSE
{
"total_count":4,
"matches":[
{
"company_id":"<COMPANY_ID_RESULT_1>",
"name":"Big Org",
"domain":""
},
{
"company_id":"COMPANY_ID_RESULT_2",
"name":"Big Funds Inc.",
"domain":"bigfund.com"
},
{
"company_id":"COMPANY_ID_RESULT_3",
"name":"Big Fund",
"domain":""
},
{
"company_id":"COMPANY_ID_RESULT_4",
"name":"big Fund",
"domain":""}
]
}
Trusted Network¶
A Trusted Network is the collective term for all Trusted Parties - Users, Counterparties and Custodians.
A Trusted Network is associated with a specific Company by its Company_ID.
It is within this network that you can perform transactions and withdrawals whilst ensuring the implementation of secure, decentralized custody.
At least one User must be added as a Trusted Party to create a Trusted Network. The minimum required fields are address and type.
Add User¶
A User is an individual who is added to the Qredo Network. Once added, funds can be transferred to them using the API. A user must be added to the Trusted Network as a Trusted Party to act as a custodian.
To add a User to the Qredo Network, they must join by registering and creating an account via the Qredo website and selecting 'Join the Network'.
Add Trusted Party¶
A Trusted Party can be a Counterparty for a transaction and/or a Custodian. Use this call to make a request to add a user or entity as a Trusted Party. The user or entity is only added as a Trusted Party after they have approved the request.
Before you start
A User must already be part of the Qredo Network to be added as a Trusted Party. To join the Qredo Network all users must register and create an account via the Qredo Website and selecting 'Join the Network'.
POST https://api.qredo.network/api/v1/p/company/{company_id}/trustedparty
Parameters | Description |
---|---|
company_id | Required. String - This is the company_id returned when you created a Company. |
address | Required. String - This is the User's email address. |
type | Required. String - Specified as 'user' |
name | Optional. String - Name of Trusted Party |
Returns a standard HTTP 200 OK
Response to indicate the request has been made to add a Trusted Party. The request needs to be approved by the intended Trusted Party via the Qredo Signing app on their mobile device or via the the Core Client.
EXAMPLE ADD TRUSTED PARTY REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company/{company_id}/trustedparty"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "{
"address": "[email protected]",
"type": "user"
}
EXAMPLE ADD TRUSTED PARTY RESPONSE
{"code":200,"msg":"OK"}
Retrieve a list of Trusted Parties¶
Retrieves all Trusted Parties associated with a Company. This endpoint can be used to confirm that a user or entity has accepted a request to be a Trusted Party. Upon successful addition of a Trusted Party a 'Trusted_Entity_ID' is returned.
GET https://api.qredo.network/api/v1/p/company/{company_id}/trustedparty
EXAMPLE TRUSTED PARTY LIST RESPONSE
"company_id": "<COMPANY_ID>",
"total_count": 0,
"list": [
{
"company_id": "<COMPANY_ID>",
"total_count": 1,
"list": {
"trusted_entity_id": "<TRUSTED_ENTITY_ID>",
"name": "Rosa Parks",
"type": "user",
"address": "[email protected]",
"internal": true,
"created": "<TIMESTAMP>"
}
}
]
}
Delete a Trusted Party¶
Remove a Trusted Party from a company Trusted Network.
DELETE https://api.qredo.network/api/v1/p/company/{company_id}/trustedparty/{trustedparty_id}
EXAMPLE REMOVE TRUSTED PARTY
curl -X DELETE "https://api.qredo.network/api/v1/p/company/<COMPANY_ID>/trustedparty/<TRUSTED_ENTITY_ID>"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
Parameters | Description |
---|---|
company_id | Required. String - This is the company_id returned when you created a Company. |
trusted_entity_id | Required. String - This is returned by retrieving all Trusted Parties (above) |
Returns standard HTTP 200 OK Response
to indicate a Trusted Party has been removed successfully.
Core Client¶
A Core Client acts as an automated Custodian for transactions. A Core Client allows you to set up a websocket feed and listen to actions.
Core Client Object¶
Attributes | Description |
---|---|
id | Unique ID for the Core Client |
name | Core Client name |
feed | Unique Websocket Feed |
timestamp | Time in epoch |
Create a Core Client¶
Create a Core Client to programmatically automate custodian flows.
POST https://api.qredo.network/api/v1/p/coreclient
Parameters | Description |
---|---|
name | Required. String |
Returns a Core Client details object.
EXAMPLE CREATE A CORE CLIENT
curl -X POST "https://api.qredo.network/api/v1/p/coreclient"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "{
"name":"meaningful_name"
}"
Retrieve a list of all Core Clients¶
View all registered Core Clients
GET https://api.qredo.network/api/v1/p/coreclient
Parameters | Description |
---|---|
company_id | Required. String - This is the company_id returned when you created a Company. |
Returns a list of all Core Clients for a Company ID is returned.
EXAMPLE GET CORE CLIENTS RESPONSE
{"count":3,
"clients":[
{
"id":"<CORE_CLIENT_ID_1>",
"name":"alpha",
"feed":"wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID_1>/feed",
"timestamp":1607437910},
{
"id":"<CORE_CLIENT_ID_2>",
"name":"beta",
"feed":"wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID_2/feed",
"timestamp":1607444404},
{
"id":"<CORE_CLIENT_ID_3>",
"name":"meaningful_name",
"feed":"wss://api.qredo.network/api/v1/p/coreclient/CORE_CLIENT_ID_3/feed",
"timestamp":1607945099
}
]
}
Core Client Websocket Feed¶
The websocket API offers real-time streaming event updates. All 'Actions' performed by the Core Clients are viewable and actionable.
Using your chosen programming environment, listen to the Core Client's websocket feed URL (returned in the previous step)
wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID>/feed
Action Object¶
Attribute | Description | Child Attributes |
---|---|---|
id | Action ID | - |
type | Action Type ApproveWithdraw, ApproveTransfer, RejectWithdraw, RejectTransfer | - |
status | The status of the action pending, expired, approved, rejected | - |
timestamp | Time in epoch | - |
expireTime | Time in epoch | - |
details | Details of the Action ActionDetailApproveWithdraw, ActionDetailApproveTransfer | txtype, txID, asset, amount, fees, net amount, reference, benefitOf, accountNo, companyID, fundID, initiatedtime, expires, recipientAddress, recipientAddressName, initiatedBy, initiatorName, initiatorType |
Create a Websocket Connection¶
You must include the following headers:
"x-api-key": "your API key",
"x-sign": "the signature of the timestamp concatenated with the WSS URL",
"x-timestamp": "the timestamp used to generate the signature"
Example using Golang¶
Use our example Golang partnerapi-sign client program.
Required: Golang
Steps
1) Clone the Partner API Sign repo
2) Change directory to the location where the repo is installed on your laptop.
cd partnerapi-sign
3) Build the sample app
go build -o partnerapi-sign
4) Listen to the websocket with the following command:
Linux/Mac
./partnerapi-sign websocket -url wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID>/feed
Windows
partnerapi-sign.exe websocket -url wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID>/feed
5) The command displays your URL, hash, signature and timestamp. It then attempts to connect and if successful returns "connected". Any actions sent to your Core Client are displayed in compressed JSON format.
Example using Python3¶
Required: Python >= 3.6.1
Also, install the websocket
library.
pip3 install websocket
Steps
1) Run the example Python script:
Note
You may have to switch the code tab to 'Python' in order to view it.
EXAMPLE PYTHON
from websocket import create_connection
ws = create_connection("wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID>/feed", header={"x-api-key": "<YOUR_API_KEY>","x-sign": "<SIGNATURE>", "x-timestamp": "12345678"})
while True:
result = ws.recv()
print (result)
2) You are successful when your CLI displays actions from the Core Client in compressed JSON format.
Example websocket response¶
- id: Action ID
- type: Action Type e.g. ApproveWithdraw, ApproveTransfer
- status: The status of the action e.g. pending, expired, approved, rejected
- timestamp: Time in epoch
- expireTime: Time in epoch
EXAMPLE WEBSOCKET RESPONSE
{"id":", "<ACTION_ID>": ", "type": "<TYPE_OF_ACTION>", "status": ", "timestamp": , "expireTime": }
Retrieve details of all pending actions¶
Retrieve details of all pending actions associated with a Core Client.
GET /coreclient/{client_id}/actions
Parameters | Description |
---|---|
client_id | Required. String - This is the Core Client ID. |
Returns a list of pending actions.
EXAMPLE PENDING ACTIONS RESPONSE
{
"count": 0,
"actions": [
{
"id": "<CORE_CLIENT_ID>",
"type": "ApproveTransfer",
"status": "pending",
"timestamp": 1601972322,
"expireTime": 1601973322
}
]
}
Retrieve details of an action¶
Retrive details of a specific action associated with a Core Client
GET /coreclient/{client_id}/action/{action_id}
Parameter | Description |
---|---|
action_ID | The unique identifier for the Action. |
client_ID | The Core Client unique identifier. |
Returns an Action object.
EXAMPLE ACTION OBJECT RESPONSE
{
"id": "<ACTION_ID>",
"type": "ApproveWithdraw",
"status": "pending",
"timestamp": 0,
"expireTime": 0,
"details": {
"txType": "string",
"txID": "string",
"asset": "string",
"amount": 0,
"fees": 0,
"netAmount": 0,
"reference": "string",
"benefitOf": "string",
"accountNo": "string",
"companyID": "string",
"fundID": "string",
"initiatedTime": 0,
"expires": 0,
"recipientAddress": "string",
"recipientAddressName": "string",
"initiatedBy": "string",
"initiatorName": "string",
"initiatorType": "string"
}
}
Approve an action¶
Approve an action.
PUT /coreclient/{client_id}/action/{action_id}
Parameter | Description |
---|---|
action_ID | The unique identifier for the Action. |
client_ID | The Core Client unique identifier. |
Returns an Action object with status "approved".
Reject an action¶
Rejects an action.
DELETE /coreclient/{client_id}/action/{action_id}
Parameter | Description |
---|---|
action_ID | The unique identifier for the Action. |
client_ID | The Core Client unique identifier. |
Returns an Action object with status "rejected".
Holdings¶
A Holding represents a portfolio of Funds.
You can retrieve all assets held by a company according to the asset type. Each Holding entry includes the balance for that asset allowing you to track funds coming in and out.
Holdings Object¶
Attribute | Description |
---|---|
total_count | This is the number of asset types held by a company |
symbol | This is the symbol for the asset type e.g. BTC |
amount | The quantity of each asset |
Retrieve Holdings¶
Use this endpoint to retrieve information on all assets held by a company on the Qredo Network.
GET https://api.qredo.network/api/v1/p/company/{company_id}/holding
Parameters | Description |
---|---|
company_id* | The unique identifier for the company |
Returns the Holdings Object.
EXAMPLE RETRIEVE HOLDINGS RESPONSE
"total_count": 3,
"holdings": [
{
"code": "BTC",
"amount": 4266
},
{
"code": "ETH",
"amount": 1077
},
{
"code": "USDT",
"amount": 500451
}
]
}
Deposits¶
Deposits add assets to wallets contained within funds.
You can add a deposit to a wallet using the wallet_code or wallet_id.
Retrieve Fund Deposit Address¶
EXAMPLE FUND DEPOSIT ADDRESS RESPONSE
{
"total_count": 0,
"list": [
{
"asset": "BTC-TESTNET",
"address": "n2GoFtw8aTH6y************fxrSp3iTL6jwUX",
"balance": 100
},
{
"asset": "ETH-TESTNET",
"address": "y2koFtw8aTH6y************ljhrSp4trys456",
"balance": 200
}
]
}
GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}/deposit
Parameters | Description |
---|---|
company_id | Required. The unique company identifier |
fund_id | Required. The unique fund identifier |
Returns a list of fund assets, deposit addresses and current balances. See 'Example Fund Deposit Address Response'.
Note
Each asset has its own deposit address.
Deposit assets into a Fund¶
Use this endpoint to add an asset to an existing fund.
POST https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}/deposit
Parameters | Description |
---|---|
company_id | Required. The unique company identifier |
fund_id | Required. The unique fund identifier |
Returns a standard HTTP 200 OK Response indicates an asset has been added successfully.
Funds¶
A Fund represents a container for a portfolio of Assets and their associated Wallets. Multiple Funds can be created on behalf of a customer to form a Holding.
Administrators, Principals and Custody Groups are assigned to each individual fund. There is only one Custody Group per Fund.
Each Asset Type within a fund e.g. BTC can have multiple Wallets.
Wallets can be STANDARD, DEDICATED or MULTI-COUNTERPARTY. View WALLET TYPES.
Fund Object¶
EXAMPLE FUND OBJECT
{
"fund_id":"1o0vR41rNSRRkJDaDfnT9sKNdY6",
"name":"Fund 1",
"description":"Fund for demonstration",
"custodygroup_withdraw":"1o0vR7B7IcKUjAymQVOroGre7DF",
"custodygroup_tx":"1o0vR1QhIFnfsjzO0tPZPQZyPW8",
"members":
[
{
"entity":
{
"id":"1nyEFWwuZp8g8eoI0qBrNjvjFb4",
"accountCode":"4nZ94izhGvajYqbrRJtHEWwaZ2V785R5AJ13SCPPoDa8",
"name":"Cryptomagic",
"initials":"C",
"type":"company",
"company":
{
"name":"Cryptomagic"
}
},
"permissions":
{
"admin":true
}
}
],
"assets":["BTC-TESTNET"],
"wallets":
[
{
"wallet_id":"A8zpKjJ5VsKKm175EwASd7BKCQcwZ6QF5Mm8ozbAYb7H",
"name":"New wallet",
"asset":"BTC-TESTNET",
"type":0,
"status":"ready",
"address":"muBYKnPgEgnMKBW1xySNDcQ8VScLLA2Meg",
"address_type":"P2PKH",
"short_code":"purchase version cousin",
"balance":0,
"custodygroup_withdraw":"1o0vR7B7IcKUjAymQVOroGre7DF",
"custodygroup_tx":"1o0vR1QhIFnfsjzO0tPZPQZyPW8"
}
]
}
Attribute | Description | Child Attributes |
---|---|---|
fund_id | The unique ID for the fund. Returned when fund is created. | - |
name | This is the name allocated when fund created | - |
description | This is a description of the fund | - |
custodygroup_withdraw | The Fund Custody Policy specifying: members (trusted_party_id) account code threshold (number of signatures required) for authorization |
- |
custodygroup_tx | The Fund Transfer Policy specifying: members (trusted_party_id) threshold (number of signatures required) |
- |
members | Details about Fund members and permissions | entity ID e.g. company ID account code -- name e.g. company name initials initials of entity name type user - (firstName,lastName, email, userName), company - (company name), core client permissions admin, withdraw, transfer or swap |
wallets | This defines the wallet type(s) | name The name for a wallet e.g. BTC wallet asset The asset associated with the wallet. OPTIONAL custodygroup_withdraw Use to define a custom policy at wallet level OPTIONAL custodygroup_tx Use to define a custom policy at wallet level type 0 - Standard Wallet (For independent transactions) 1 - Dedicated Wallet (For use with a single 3rd Party) 3 - Multi-Counterparty Wallet (For use with several 3rd Parties) connect External 3rd Party connection requires counterparty_id and client_id (provided by third party) status |
Create Fund¶
EXAMPLE CREATE FUND REQUEST
FUND WITH TWO WALLETS
1) Standard Wallet - Inherit Fund TX Policy, Custom Withdrawal Policy
2) Dedicated Wallet - One Counterparty e.g. Exchange
{
"name": "Apollo",
"description": "Fund with Dedicated & Standard Wallet - Inherit Fund TX Policy and Custom Withdrawal Policy",
"custodygroup_withdraw": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"custodygroup_tx": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"wallets": [
{
"name": "Standard Wallet",
"asset": "ETH",
"custodygroup_withdraw": {
"threshold": 2,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt"
]
}
},
{
"name": "Dedicated Exchange Wallet",
"asset": "BTC",
"type": 1,
"connect": [
{
"counterparty_id": "7RKJyd3zY8rXq5TV5V8mdv9HxD2d8fyJqpDNH3MHT2pK",
"client_id": "A12345"
}
]
}
]
}
SUCCESSFUL 200 RESPONSE BODY
{
"fund_id":"1qI5uyxVcda770hphSUBFF1bKBm",
"custodygroup_withdraw":"1qI5usgVS5Qyz979tHk08vcpvN5",
"custodygroup_tx":"1qI5uwpRl38SCdjMeBmnWVeX7g1"
}
FUND WITH STANDARD WALLET - INHERIT TX POLICY, CUSTOM WITHDRAWAL POLICY
{
"name": "Apollo",
"description": "Fund with Standard Wallet - Inherit Default Fund TX & Withdrawal Policies ",
"custodygroup_withdraw": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"custodygroup_tx": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"wallets": [
{
"name": "Standard Wallet",
"asset": "ETH",
"custodygroup_withdraw": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt"
]
}
}
]
}
SUCCESSFUL 200 RESPONSE BODY
{"fund_id":"1qINjCo8EKlndiKfG9votdTExMg","custodygroup_withdraw":"1qINj934jj8q9UC3hXBYRNq1ynB","custodygroup_tx":"1qINj98kifIePXx9mcNb6rOrmNj"}
FUND WITH STANDARD WALLET - INHERIT DEFAULT FUND TX & WITHDRAWAL POLICY
{
"name": "Apollo",
"description": "Fund with Standard Wallet - Inherit both Default Fund TX & Withdrawal Policies ",
"custodygroup_withdraw": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"custodygroup_tx": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"wallets": [{
"name": "Standard Wallet",
"asset": "ETH"
}
]
}
SUCCESSFUL 200 RESPONSE BODY
{
"fund_id":"1qIHVBwDjk7uJYuugG63Uv2dQrW",
"custodygroup_withdraw":"1qIHV9eywEfG6wS9HJwALHpIcjG",
"custodygroup_tx":"1qIHV7fvN5bACv1RDZY0m1iGmCH"
}
FUND WITH TWO STANDARD WALLETS -
1) Standard Wallet containing BTC, Custom Withdraw Policy & Default TX Policy
2) Standard Wallet containing ETH, Custom Withdraw Policy and Custom TX Policy
{
"name": "Apollo",
"description": "Fund with Standard Wallet - Custom TX & Custom Withdrawal Policies",
"custodygroup_withdraw": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"custodygroup_tx": {
"threshold": 1,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"wallets": [{
"name": "Standard Wallet with BTC, Custom TX Policy & Default Withdrawal Policy",
"asset": "BTC",
"custodygroup_tx": {
"threshold": 2,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt"
]
}
},
{
"name": "Standard Wallet with ETH, Custom TX Policy & Custom Withdrawal Policy",
"asset": "ETH",
"custodygroup_withdraw": {
"threshold": 3,
"members": [
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
},
"custodygroup_tx": {
"threshold": 2,
"members": [
"2vNbT1cXHoKaUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
"5R8jT2vvtsjgXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
"6NsppL9QLYBarWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
"Hcp4SmwmgU3zBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
]
}
}
]
}
SUCCESSFUL 200 RESPONSE BODY
{
"fund_id":"1qIf1UmWGQ4zg8AMe2t9Ay3dOVi",
"custodygroup_withdraw":"1qIf1YGCeyVcel1Og6UJ1jsmYLn",
"custodygroup_tx":"1qIf1Rq8PQAxxqsgcfp2Po9T87C"}
Use this endpoint to create a fund and specify what assets you want in it.
POST https://api.qredo.network/api/v1/p/company/{company_id}fund
Parameters | Description |
---|---|
company_id | Required. The unique company identifier |
name | Name for the Fund. |
description | Fund description |
custodygroup_withdraw | Fund Custody Policy (withdrawals) threshold (number of custodial signatures required), each custodial member(trusted_entity_ids) |
custodygroup_tx | Fund Custody Policy (transfers) threshold (number of custodial signatures required), each custodial member (trusted_entity_ids) |
wallets | name Wallet name, asset Asset type e.g. BTC-Testnet, custodygroup_withdraw |
Retrieve Fund¶
EXAMPLE RETRIEVE FUND RESPONSE
{
"fund_id": "1dnpG2K2A5hMOVjGFl1DrsbnvmS",
"name": "Fund 1",
"description": "Fund for demonstration purposes",
"custodygroup_withdraw": "1nL7QOoLqPDq89dcdhue6LJaFUS",
"custodygroup_tx": "1nL7QUCW15xaV0jggAv1mFSR9jp",
"members": {
"entity": {
"id": "1nKlfvP0U2HtHPmWDUKWJ4HR0xp",
"accountCode": "3Xjk46grBSLRL6mYxB1NeoAVhgwiEHvAoehhYYwZkAYU",
"name": "ACME Corp",
"initials": "A",
"type": "company",
"company": {
"name": "ACME Corp"
}
},
"permissions": {
"admin": true
}
},
"assets": [
"BTC-TESTNET"
],
"wallets": [
{
"wallet_id": "5Hb8J6w14MdeAq3owKmfTVcwy6TKqhfVj9DV2VtWCZES",
"name": "New wallet",
"asset": "BTC-TESTNET",
"type": 213312000,
"status": "ready",
"address": "mfXXBW8Tmzkd7bRKKsUmjucpLQLThv8eYX",
"address_type": "P2PKH",
"short_code": "buddy harsh stick",
"balance": 0,
"custodygroup_withdraw": "1nL7QOoLqPDq89dcdhue6LJaFUS",
"custodygroup_tx": "1nL7QUCW15xaV0jggAv1mFSR9jp"
},
{
"wallet_id": "7MkABERLqL3FTNouykXtftkyBoseza4KfQ6YKQcS1xH6",
"name": "New dedicated wallet",
"asset": "BTC-TESTNET",
"type": 1,
"status": "ready",
"address": "mndLfcZYSdN7uow8MJWCCffBaAQsrqW217",
"address_type": "P2PKH",
"short_code": "fatigue infant conduct",
"balance": 1000000,
"custodygroup_withdraw": "1nL7QOoLqPDq89dcdhue6LJaFUS",
"custodygroup_tx": "1nL7QUCW15xaV0jggAv1mFSR9jp",
"connected": {
"counterparty_id": "6WM255GuS9ikHHDVdjZNXjrt3CzGg4HvXRbw94qmqjVm",
"name": "Test Excahnge",
"client_id": "A12345",
"status": "connected"
}
}
]
}
Use this endpoint to retrieve information about a specific Fund including custody groups and members.
GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}
Parameters | Description |
---|---|
company_id | Required. The unique company identifier |
fund_id | Required. The unique fund identifier |
Returns details about a specific fund, custody groups for withdrawals and transfers as well as details on fund members and their permissions.
Search Funds¶
EXAMPLE FUND SEARCH RESPONSE
{
"total_count": 2,
"list": [
{
"name": "Big Fund",
"id": "1dnpG2K2A**********Fl1DrsbnvmS"
},
{
"name": "Big Load",
"id": "2cnp**********VjGFl1DrsbnvmN"
}
]
}
Use this endpoint to search all Company funds that match a query.
GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/search
Parameters | Description |
---|---|
company_id* | Required. The unique company identifier |
query | String of 3 letters or more. |
Returns all matching fund names and their corresponding fund_id are returned. See 'Example Fund Search Response'.
Wallets¶
Wallet Types¶
Granular Custody Policies are available at Wallet level. Multiple Asset Types can be added to a fund. Multiple wallets can be associated with individual Asset Types.
Parameter | Wallet Type | Description |
---|---|---|
0 | Standard Wallet | |
1 | Dedicated Wallet | |
3 | Multi-Counterparty |
Returns a fund id, custodygroup_withdraw policy ID, custodygroup_tx policy ID
EXAMPLE CREATE FUND RESPONSE
{
"fund_id": "1dnfLZolYD72zasqtmtTXXoaNNJ",
"custodygroup_withdraw": "1dnfLYHOGn8gScmInkMXSPzitj5",
"custodygroup_tx": "1dnfLeHXkaxQPs2v5kvxglwKTKV"
}
Create Wallet¶
Use this endpoint to add a new wallet to a fund and specify what assets you want in it.
The default fund custody policy is used unless a wallet-level custody policy is specified.proto
POST https://api.qredo.network/api/v1/p/company/{company_id}fund/{fund_id}/wallet
Parameters | Description |
---|---|
company_id | Required. The unique company identifier |
fund_id | Required. The identifier for the fund. |
name | Name for the Fund. |
description | Fund description |
custodygroup_withdraw | Optional. Fund Custody Policy (withdrawals) threshold (number of custodial signatures required), each custodial member(trusted_entity_ids) |
custodygroup_tx | Optional. Fund Custody Policy (transfers) threshold (number of custodial signatures required), each custodial member (trusted_entity_ids) |
wallets | name Wallet name, asset Asset type e.g. BTC-Testnet, custodygroup_withdraw |
EXAMPLE CREATE WALLET REQUEST
{
"wallets": [
{
"name": "New wallet",
"asset": "BTC-TESTNET"
},
{
"name": "New wallet with custom custody group",
"asset": "BTC-TESTNET",
"custodygroup_withdraw": {
"threshold": 1,
"members": [
"1dnfLZolYD72zasqtmtTXXoaNNJ",
"1dnfLeHXkaxasdg4akvxglwKTKV"
]
},
"custodygroup_tx": {
"threshold": 1,
"members": [
"1dnfLZolYD72zasqtmtTXXoaNNJ",
"1dnfLeHXkaxasdg4akvxglwKTKV"
]
}
},
{
"name": "New dedicated wallet",
"asset": "BTC-TESTNET",
"type": 1,
"connect": [
{
"counterparty_id": "6WM255GuS9ikHHDVdjZNXjrt3CzGg4HvXRbw94qmqjVm",
"client_id": "A12345"
}
]
}
]
}
Returns wallet IDs.
EXAMPLE CREATE WALLET RESPONSE
{
"wallets": [
"KGMWoEgmTZ9Voz9EAbtTHk7A2rhQra4aPcscYNLGePci",
"9Voz9EAbtTHk7A2rhQgmTZYNLGePcira4aPcscKGMWoE"
]
}
Retrieve Wallet¶
EXAMPLE RETRIEVE WALLET REQUEST
Use this endpoint to retrieve information about a specific wallet including balance, addresses and custody groups.
GET https://api.qredo.network/api/v1/p/wallet/{wallet_id}
Parameters | Description |
---|---|
wallet_id | Required. The unique wallet identifier (returned when the wallet was created) |
{
"wallet_id": "string",
"name": "string",
"asset": "string",
"type": 0,
"status": "string",
"address": "string",
"address_type": "string",
"short_code": "string",
"balance": 0,
"custodygroup_withdraw": "string",
"custodygroup_tx": "string",
"policy_withdraw": {
"id": "string",
"name": "string",
"threshold": 0,
"members": [
{
"id": "string",
"name": "string",
"accountCode": "string",
"initials": "string",
"type": "user",
"company": {
"name": "string"
},
"user": {
"firstName": "string",
"lastName": "string",
"email": "string",
"userName": "string"
},
"core-client": {
"name": "string"
}
}
]
},
"policy_tx": {
"id": "string",
"name": "string",
"threshold": 0,
"members": [
{
"id": "string",
"name": "string",
"accountCode": "string",
"initials": "string",
"type": "user",
"company": {
"name": "string"
},
"user": {
"firstName": "string",
"lastName": "string",
"email": "string",
"userName": "string"
},
"core-client": {
"name": "string"
}
}
]
},
"connected": [
{
"client_id": "string",
"counterparty_id": "string",
"name": "string",
"status": "string"
}
]
}
TRANSACTIONS¶
Transaction types can be deposit, withdraw, transferIn, transferOut, swap, swapIn, swapOut
Transfers¶
A Transfer object is created when you move assets from a fund to a counterparty fund on the Qredo Network. All transfers require Custodial Approval (in accordance with the fund transfer policy).
The Transfer object¶
Attributes | Description | Child Attributes |
---|---|---|
wallet_id | Required. String - The originator wallet ID | - |
counterparty_wallet_address | Required. String - This is the Counterparty Wallet Address NOTE: You can use the Counterparty Wallet code or their wallet_id | - |
reference | String - This is your reference for your own records. | - |
benefit_of | String - This is the name of the recipient of the transfer. | - |
account_no | String - (Where relevant) This is the account number of the recipient of the transfer. | - |
expires | Required. String - This is the time in epoch when the transfer expires without custodial approval. | - |
send* | Required. This is the type and amount of asset sent. | symbol - Required. String - Asset Symbol e.g. BTC |
amount - Required. String - Amount of asset sent. |
Create Transfer¶
EXAMPLE TRANSFER REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company/<COMPANY_ID/transfer"
-H "Content-Type: application/json"
-H "accept: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "
{
"wallet_id": "HUnmEJEgYeNYj2pTH8rAnd0mgjHqhj9iadgVQgRKMk",
"counterparty_wallet_address": "D1h4cyu5MJWDSgo6[email protected]113tKZ3vDkNiPXVrs6QuSP",
"expires": 1640998800,
"benefit_of": "Malala Yousafzai",
"account_no": "123-XX",
"reference": "97879780",
"send": {
"symbol": "BTC",
"amount": 800
}
}"
Use this endpoint to create a transfer:
POST /company/{company_id}/transfer
Parameters | Description |
---|---|
wallet_id* | Required. The originator wallet_id |
counterparty_wallet_address* | Required. This is the wallet code OR counterparty wallet_id of the counterparty. |
expiration* | Required. This is the time in epoch when the transfer expires without custodial approval. |
send symbol* | Required. This is the symbol for the asset being transferred. |
send amount* | Required. This is the quantity of the asset being sent. |
reference | Optional |
benefit_of | Optional |
account_no | Optional |
See 'Example Transfer Request'.
Returns a Transaction ID tx_id.
EXAMPLE TRANSFER RESPONSE
{
"tx_id": "9827feec4e**********a7c3b97add"
}
Addresses¶
Add Whitelist Address¶
Use this endpoint to whitelist an address. This is essential to ensure that a withdrawal transaction can be approved using this address.
GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}/whitelist
Retrieve Fund Whitelist¶
Use this endpoint to get a list of all whitelisted addresses associated with a specific fund.
GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}/whitelist
Parameters | Description |
---|---|
company_id* | Required. The unique company identifier |
fund_id* | Required. The unique fund identifier |
address | Optional. Find out whether a specific address has been whitelisted |
asset | Optional. Filter addresses for a specific asset |
Returns all whitelisted addresses for that fund.
EXAMPLE FUND WHITELIST RESPONSE
{
"total_count": 2,
"list": [
{
"name": "Rosa_wallet",
"asset": "BTC-TESTNET",
"address": "bc1qgr090h********rlaytx5v7ytm2ktq98"
},
{
"name": "Alice_wallet",
"asset": "BTC",
"address": "tb1qd5jkskt********qsgta2ncrgkx7ud8"
}
]
}
Withdrawals¶
A Withdraw Object is created when you move assets from a fund to a withdrawal address. All withdrawals require Custodial Approval (in accordance with the fund withdrawal policy).
Withdraw Object¶
Attributes | Description | Child Attributes |
---|---|---|
wallet_id | Required. String - The originator wallet | |
address | Required. String - The destination address. This must be whitelisted. | |
expires | Required. String - This is the time in epoch when the withdrawal expires without custodial approval. | - |
reference | String - This is your reference for your own records. | - |
benefit_of | String - This is the name of the recipient of the withdrawal. | - |
send* | Required. This is the type and amount of asset sent. | symbol - Required. String - Asset Symbol e.g. BTC |
amount - Required. String - Amount of asset sent. |
Create withdraw¶
EXAMPLE WITHDRAW REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company/<COMPANY_ID>/withdraw"
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "
"wallet_id":"<ORIGINATOR_WALLET_ID>",
"address":"mkLaDxYkiaYW********TNu9ZcpHgd6",
"expires":16****800,
"benefit_of":"Bob Cohen",
"account_no":"123-XX",
"reference":"CX15R99XX",
"send":{
"symbol":"BTC",
"amount":800}
}"
Use this endpoint to create a withdrawal:
POST /company/{company_id}/withdraw
Parameters | Description |
---|---|
company_id* | Required. The unique company identifier |
wallet_id* | Required. The originator fund identifier |
address* | Required. The destination address |
expires* | Required. This is the time in epoch when the transfer expires without custodial approval. |
send symbol* | Required. This is the symbol for the asset being transferred. |
send amount* | Required. This is the quantity of the asset being sent. |
reference | Optional |
benefit_of | Optional |
account_no | Optional |
See 'Example withdraw request'
Response¶
EXAMPLE WITHDRAW RESPONSE
{
"tx_id": "45677feec4e**********a7c3b97add"
}
The Response is a Transaction ID tx_id.
Atomic Swaps¶
Atomic Swaps enable you to exchange assets with another member on the Qredo Network in a decentralized way with granular governance as defined by you.
Note
The member you want to trade with must have a fund containing both assets you want to swap with (e.g. ETH-TESTNET & BTC-TESTNET)
- A Maker posts their quote.
- The quote is authorized by the Maker's Custodians.
- The quote is added to the Liquidity Hub if add_to_liquidity_hub is set to 'True'
- A potential Taker views quotes on the Liquidity Hub
- A Taker uses the swap transaction_id to take the quote.
- The quote is authorized by the Taker's Custodians
- The Atomic swap completes in a single transaction.
Create Atomic Swap (Maker)¶
EXAMPLE ATOMIC SWAP MAKE REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company/<MAKER_COMPANY_ID>/atomicswap/make"
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "
{
"send_wallet_id": "nLQtaZgx49s2sa7dD1K8unLQtaZgx49s",
"receive_wallet_id": "2sa7dD1K8unLQtaZgx49snLQtaZgx49s",
"expires": 1640998800,
"reference": "CX15R99XX",
"send": {
"symbol": "BTC",
"amount": 800
},
"receive": {
"symbol": "ETH",
"amount": 2536
},
"add_to_liquidity_hub": false
}
EXAMPLE ATOMIC SWAP MAKE RESPONSE
{
"tx_id": "bda3daa7c3************eec4eae4e80",
"tx_url": "https://qredo.network/aswp<tx_id>"
}
-
Select a fund with required assets and quantities to swap with. (fund_id)
-
Make your quote. Specify the the assets and quantities you want to send and receive.
-
Set an expiry time for the swap.
-
Use this endpoint to make a quote and initiate an Atomic Swap.
POST https://api.qredo.network/api/v1/p/company/{company_id}/atomicswap/make
Parameters | Description |
---|---|
send_wallet_id* | Required. The Maker's wallet ID |
receive_wallet_id* | Required. The Taker's wallet ID |
expires* | Required. |
reference | Optional. Your reference for the swap |
send* | Required. Your 'Sell' price - Asset Symbol and Amount |
receive* | Required. Your 'Buy' price - Asset Symbol and Amount |
add_to_liquidity_hub | Optional. True or False. If True, quote is automatically added to Liquidity Hub |
See 'Example Atomic Swap Make Request'
Note
The Atomic Swap Make Request must be authorized in accordance with the Maker's custodial policy.
Returns a unique Swap Transaction ID tx_id and Transaction URL tx_url.
Warning
This must be passed to the Taker and executed prior to the expiry time.
Note
The tx_url can be sent to a 'real' user for them to take.
View Atomic Swap Details¶
View Status of Make¶
Use the following endpoint to view transaction details of a Make swap.
GET https://api.qredo.network/api/v1/p/company/{company_id}/atomicswap/make/{tx_id}
Parameters | Description |
---|---|
company_id | Required. Makers unique company identifier |
tx_id | Required. The Maker swap transaction_id |
Returns the Transaction Object. See 'Example Transaction Object'
Delete Atomic Swap (Maker)¶
Use this endpoint to cancel an Atomic Swap you have created. This removes it from the Liquidity Hub.
DELETE https://api.qredo.network/api/v1/p/company/{company_id}/atomicswap/make/{tx_id}
Complete Atomic Swap (Taker)¶
EXAMPLE ATOMIC SWAP TAKE REQUEST
curl -X POST "https://api.qredo.network/api/v1/p/company/{company_id}/atomicswap/take"
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "
{
"swap_id": "1l65SpjcfhSEgjObPPHU7vwTNzb",
"send_wallet_id": "1l62uLH2KKuXpb4hNIgp7DLWGRN",
"receive_wallet_id": "2sa7dD1K8unLQtaZgx49snLQtaZgx49s",
"reference": "CX15R99XX"
}
-
Use the Swap transaction_id from the Maker to perform the Swap.
-
View Atomic Swap Status to ensure it has been authorized
-
Select a fund with the required assets and quantities to receive and send.
-
Use this endpoint to take the quote before it expires.
Note
The Atomic Swap Take Request must be authorized in accordance with the Taker's Custodial Policy.
Parameters | Description |
---|---|
swap_id* | Required. The tx_id (obtained from the Maker) |
send_wallet_id* | Required. The Taker's wallet ID or wallet code |
receive_wallet_id* | Required. The Maker's wallet ID or wallet code |
reference* | Reference for the swap |
See 'Example Atomic Swap Take Request'
Returns a unique Swap Transaction ID tx_id.
View Transaction Status using the tx_id
View Holdings to confirm the Swap has executed.
Note
The tx_url can be sent to a 'real' user for them to take.
View Atomic Swap Status(Take)¶
Use the following endpoint to view transaction details of a Take swap.
GET https://api.qredo.network/api/v1/p/company/{company_id}/atomicswap/take/{tx_id}
Parameters | Description |
---|---|
company_id | Required. Takers unique company identifier |
tx_id | Required. The Taker swap transaction_id |
Returns the Transaction Object. See 'Example Transaction Object'.
Liquidity Hub¶
The Liquidity Hub is a place for makers to broadcast Atomic Swap quotes. It is also the place for potential takers to retrieve information about all available Atomic Swap quotes.
Add Atomic Swap¶
EXAMPLE ATOMIC SWAP REQUEST
```curl
curl -X POST "https://api.qredo.network/api/v1/p/company/{company_id}/liquidityhub"
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-timestamp: <Epoch timestamp>" \
-H "x-sign: <signature generated_using your RSA key>" \
-H "X-API-KEY: <API key created in Qredo web app>" \
-d "
{
"tx_id": "1lm519eiGT**********HrEYvSBuSn"
}
POST https://api.qredo.network/api/v1/p/company/{company_id}/liquidityhub
Parameters | Description |
---|---|
company_id | Required. The Maker's unique company identifier |
tx_id | Required. The Transaction Id received after creating the swap. |
Returns a standard HTTP 200 OK Response to indicate a swap_transaction_id has been added successfully.
Note
The tx_id is not posted in the Liquidity Hub unless it has custodial approval.
Retrieve all Active Swaps¶
Use this endpoint to retrieve all active swaps in the Liquidity Hub.
GET https://api.qredo.network/api/v1/p/company/{company_id}/liquidityhub
Returns a list of active swaps. (Owner indicates whether the swap is associated with company_id queried).
EXAMPLE GET RESPONSE LIQUIDITY HUB
{"items":
[
{
"tx_id":"ioaco989089jkYn",
"send_amount": 800,
"send_asset": "ETH",
"receive_amount": "BTC",
"receive_asset": "ETH",
"owner": false,
"expires": 189896876,
"added":198787878
}
]
}
Liquidity Hub Websocket Feed¶
Use this endpoint to get a real-time feed of all active swaps in the Liquidity Hub.
wss://api.qredo.network/api/v1/p/liquidityhub/feed
Fund Ledger¶
View all transactions for a Fund.
View Fund Ledger¶
EXAMPLE LEDGER OBJECT
{
"List": [
{
"TxID": "1kEe4G9mopRzQk3HKnnebfCj5Dh",
"chainTxID": "8frWYAHJL6wvpY7ioT35sKZ5kyqaSt6kLdTaSShZ11Gb",
"fundID": "1kEYnRGrYmuhNLFvVhwiiqj6XcM",
"timestamp": 1605269988,
"expireTime": 1640998800,
"status": "approved",
"type": "transferOut",
"asset": "BTC-TESTNET",
"amount": 2803,
"fees": 3,
"netAmount": 2800,
"counterpartyID": "1kEY6PBbhiseE7RfifsMCDusXL8",
"counterpartyName": "ACME Corp",
"address": "",
"reference": "CX15R99XX",
"benefitOf": "John Smith",
"accountNo": "123-XX"
},
{
"TxID": "",
"chainTxID": "EX79B14iusvPjnBaZzaEunxQppdBayGW7KEd2Y8hWtQ8",
"fundID": "1kEYnRGrYmuhNLFvVhwiiqj6XcM",
"timestamp": 1605267445,
"expireTime": 0,
"status": "",
"type": "deposit",
"asset": "BTC-TESTNET",
"amount": 10000,
"fees": 0,
"netAmount": 10000,
"counterpartyID": "",
"counterpartyName": "",
"address": "mjyWz5ZAXAeG9FFbigDyt3WqebrGohuemk",
"reference": "",
"benefitOf": "",
"accountNo": ""
}
]
}
Use the following endpoint to view all transations for a company fund.
GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}/ledger
Parameters | Description |
---|---|
company_id | Required. company identifier |
fund_id | Required. transaction_id (returned when the Fund was created) |
asset | Asset type |
wallet_id | Wallet Code |
direction | Transaction direction all in out |
Returns the Ledger Object. See 'Example Ledger Object'.
Transaction Status¶
View Transfer status¶
EXAMPLE TRANSACTION OBJECT
{
"approvedCount": 1,
"expires": 1640998800,
"initiatedTimestamp": 1594281300,
"initiatorAuthorized": true,
"initiatorName": "Big Fund",
"reference": "CX15R99XX",
"status": [
{
"actionID": "1eRPBxd9w6WrooxkquWmirbo4oL",
"firstName": "Alice",
"lastName": "Walker",
"status": "approved",
"timestamp": 1594281312,
"userID": "<TRUSTED_ENTITY_ID>",
"username": "awalker"
}
],
"statusDetails": {
"accountNo": "123-XX",
"amount": 801,
"asset": "BTC-TESTNET",
"benefitOf": "Bob Stander",
"expires": 0,
"fees": 1,
"fundID": "<FUND_ID>",
"netAmount": 800,
"recipientAddress": "",
"recipientEmail": "[email protected]",
"recipientFirstName": "Bob",
"recipientLastName": "Stander",
"recipientUsername": "bstander",
"reference": "CX15R99XX",
"requestedBy": "Big Fund"
},
"thresholdRequired": 1,
"txID": "1eRPC44Mjh********jYio5ulu",
"txStatus": "approved"
}
Use the following endpoint to view the status of a specific transfer for a company.
GET https://api.qredo.network/api/v1/p/company/{company_id}/transfer/{tx_id}
Parameters | Description |
---|---|
company_id | Required. company identifier |
tx_id | Required. transaction_id (returned when the Transfer was created) |
Returns the Transaction Object. See 'Example Transaction Object'.
Transfer Status Codes¶
tx status | Description |
---|---|
pending_initiate_transfer | String - The trade initiator is yet to authorise the transfer |
initiate_rejected_transfer | String- The transfer has been rejected by the trade initiator. |
pending_transfer | String - The transfer is yet to be approved by the custodians |
expired_transfer | String - The time set for custodian approval has been exceeded. The time is set in Epoch. |
approved_transfer | String - The transfer has been approved and has exceeded the threshold. The transfer is written to the Qredo Blockchain. |
custody_rejected_transfer | String - The transfer has been rejected by the custodians. |
chain_rejected_transfer | String - Transfer has been rejected by the Qredo blockchain. (Contact Support) |
View Withdraw status¶
Use the following endpoint to view the status of a specific withdraw for a company.
GET https://api.qredo.network/api/v1/p/company/{company_id}/withdraw/{tx_id}
Parameters | Description |
---|---|
company_id | Required. company identifier |
tx_id | Required. transaction_id (returned when the Withdraw was created) |
Returns the Transaction Object. See 'Example Transaction Object'
{
"approvedCount": 1,
"expires": 1640998800,
"initiatedTimestamp": 1594281300,
"initiatorAuthorized": true,
"initiatorName": "SW Corp",
"reference": "CX15R99XX",
"status": [
{
"actionID": "1eRPBxd9w6WrooxkquWmirbo4oL",
"firstName": "Han",
"lastName": "Solo",
"status": "approved",
"timestamp": 1594281312,
"userID": "3fyHm7e3hsbSXBs1yjpzMaesirXPhqcz8kM7zgafmZef",
"username": "hsolo"
}
],
"statusDetails": {
"accountNo": "123-XX",
"amount": 801,
"asset": "BTC-TESTNET",
"benefitOf": "Ben Kenobi",
"expires": 0,
"fees": 1,
"fundID": "1ePK2dtLnpocC9uRuy3DlNC7zXd",
"netAmount": 800,
"recipientAddress": "",
"recipientEmail": "[email protected]",
"recipientFirstName": "Han",
"recipientLastName": "Solo",
"recipientUsername": "hsolo",
"reference": "CX15R99XX",
"requestedBy": "SW Corp"
},
"thresholdRequired": 1,
"txID": "1eRPC44MjhRI3sJ6UzzjYio5ulu",
"txStatus": "approved"
}
Withdrawal Status Codes¶
Withdrawal Status Codes
tx status | description |
---|---|
pending_initiate_withdrawal | String - The trade initiator is yet to authorise the withdrawal. |
initiate_rejected_withdrawal | String - The withdrawal has been rejected by the trade initiator. |
pending_withdrawal | String - The withdrawal is yet to be approved by the custodians. |
expired_withdrawal | String - The time set for custodian approval has been exceeded. The time is set in Epoch. |
approved_withdrawal | String - The withdrawal has been approved and has exceeded the threshold. The withdrawal is written to the Qredo Blockchain. |
custody_rejected_withdrawal | String - The withdrawal has been rejected by the custodians. |
chain_rejected_withdrawal | String - Withdrawal has been rejected by the Qredo blockchain. (Contact Support) |
Core Client Actions¶
Action Type | Description |
---|---|
ApproveWithdraw | A withdraw has been approved. |
ApproveTransfer | A transfer has been approved. |
Action Status | Description |
---|---|
pending | The action has not yet initiated |
expired | The action has expired |
approved | The action has been approved |
rejected | The action has been rejected. |
THIRD PARTY CONNECTIONS¶
Exchanges¶
Dedicated and Multi-Counterparty wallets can be used to connect with third party exchanges.
Retrieve list of exchanges¶
Use the following endpoint to retrieve a list of exchanges to connect with.
GET https://api.qredo.network/api/v1/p/exchanges
Returns a list of Exchanges and their details.
EXAMPLE EXCHANGE LIST RESPONSE
{
"exchanges":
[
{
"id":"7RKJyd3zY8rXq5TV5V8mdv9HxD2d8fyJqpDNH3MHT2pK",
"name":"Test Exchange",
"url":"testexchange.co",
"logourl":"https://www.logo.svg",
"client":
{
"fields":
[
{
"id":"customer_id",
"type":"string",
"name":"Your customer ID"
},
{
"id":"customer_email",
"type":"string",
"name":"Your Email address"
}
]
}
}
See examples of how to Connect a Dedicated Wallet to an Exchange
Sweeps¶
Sweeps are the ability for specified users to transfer into or withdraw funds from a Dedicated or Multi-Counterparty wallet without further authorisation. Specified users are 3rd parties such as Exchanges.
Add new Sweep¶
EXAMPLE SWEEP REQUEST
{
"wallet_id": "HUnmEJEgYeNYj2pTH8DfikDcH5gjHqhj9iadgVQgRKMk",
"recipient_wallet_id": "HUnmEJEgYeNYj2pTH8DfikDcH5gjHqhj9iadgVQgRKMk",
"expires": 1640998800,
"reference": "CX15R99XX",
"send": {
"symbol": "BTC",
"amount": 800
}
}
Initiate a new sweep transaction and define parameters for the transaction.
Use the following endpoint to create a new sweep.
POST https://api.qredo.network/api/v1/p/coreclient/{client_id}/sweep
Parameters | Description |
---|---|
client_id | Required. This is the client ID as used by a 3rd party e.g. exchange |
wallet_id | String. This is the originator wallet ID |
recipient_wallet_id | String This is the destination wallet ID |
reference | Reference for the transaction |
expires | Expiration time for transaction if not approved by custodians. |
send | Required symbol Asset symbol e.g. BTC amount quantity of assets being sent |
Returns a transaction ID is returned.
EXAMPLE SWEEP REQUEST RESPONSE
{
"tx_id": "9827feec4eae4e80bda3daa7c3b97add"
}
View Sweep Status¶
EXAMPLE VIEW SWEEP STATUS RESPONSE
{
"approver_count": 0,
"expires": 0,
"initiated_timestamp": 0,
"reference": "string",
"status": [
{
"action_id": "string",
"status": "string",
"timestamp": 0,
"entity": "string"
}
],
"status_details": {
"amount": 0,
"asset": "string",
"expires": 0,
"fees": 0,
"wallet_id": "string",
"net_amount": 0,
"recipient_wallet_id": "string",
"reference": "string",
"requested_by": "string"
},
"threshold_required": 0,
"tx_id": "string",
"tx_status": "string"
}
View the status of a Sweep by providing the client_ID and tx_id.
Use the following endpoint to create a new sweep.
POST https://api.qredo.network/api/v1/p/coreclient/{client_id}/sweep/tx_id
Parameters | Description |
---|---|
client_id | Required. This is the client ID as used by a 3rd party e.g. exchange |
tx_id | Required. This is the tx_id returned when the sweep request was made |
Returns the Sweep Transaction object.