The Qredo API and Partner API are being deprecated and will be replaced by a breaking change in Q4. To receive updates about the release, register here.
Qredo Logo

Partner API

Partner API entities

This section presents various entities used within the Partner API.

Main API entities

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
  }
]
}

The Asset object

AttributeDescription
codeString - Asset Code e.g. BTC-TESTNET
nameString - Asset Name e.g. Bitcoin Testnet
unitCodeString - Asset unit code e.g. BTC-TEST
scaleNumber - The scale expressing the asset units e.g. 100000000
enabledBoolean - TRUE or FALSE Whether the asset is supported by Qredo or not.
testAssetBoolean - 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 a 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.

ParametersDescription
typeTransaction Type e.g. transferOut See Transaction Types
assetAsset Type e.g. BTC-TESTNET
amountThe 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.

The Company object

AttributeDescription
name*String - This is a required field. The name allocated to the Company. e.g. Big Funds Inc.
cityString - The town or city the company is located. e.g. Paris
countryString - This is the ISO alpha-2 country code e.g. FR
domainString - This is the website domain for the company e.g. bigfund.com
refString - This is your reference for the company.
company_idString - This is the unique Company ID.

Create a 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

ParametersDescription
nameRequired. String - The name of the Company
refString - This is your reference for the company.
cityString - The town or city the company is located. e.g. Paris
countryString - 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 a 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}

ParametersDescription
company_idRequired. String - The unique company identifier.

Returns the Company Object associated with the Company_ID.

Update a 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.

ParametersDescription
company_idRequired. String - This is the unique Company ID.
nameString - Company name
cityString - Company town/city
countryString - This is the ISO alpha-2 country code
domainString - This is the website domain for the company e.g. bigfund.com
refString - 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 a Company

GET https://api.qredo.network/api/v1/p/company/search

Search for a company by entering 3 letters in the query field.

ParametersDescription
queryString 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 a 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 a 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

ParametersDescription
company_idRequired. String - This is the company_id returned when you created a Company.
addressRequired. String - This is the User's email address.
typeRequired. String - Specified as 'user'
nameOptional. 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 Signing Agent (fka 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": "rosa@parks",
    "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": "rosa@parks",
        "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>" \
ParametersDescription
company_idRequired. String - This is the company_id returned when you created a Company.
trusted_entity_idRequired. 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.

Signing Agent

A Signing Agent (fka Core Client) acts as an automated Custodian for transactions. A Signing Agent (fka Core Client) allows you to set up a WebSocket feed and listen to actions.

The Signing Agent object

AttributesDescription
idUnique ID for the Signing Agent (fka Core Client)
nameSigning Agent (fka Core Client) name
feedUnique Websocket Feed
timestampTime in epoch

Create a Signing Agent

Create a Signing Agent (fka Core Client) to programmatically automate custodian flows.

POST https://api.qredo.network/api/v1/p/coreclient

ParametersDescription
nameRequired. String

Returns a Signing Agent details object.

  • EXAMPLE CREATE A Signing Agent (fka 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 Signing Agents

View all registered Signing Agent (fka Core Client)s

GET https://api.qredo.network/api/v1/p/coreclient

ParametersDescription
company_idRequired. String - This is the company_id returned when you created a Company.

Returns a list of all Signing Agent (fka Core Client)s 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
   }
   ]
   }

Signing Agent WebSocket feed

The WebSocket API offers real-time streaming event updates. All 'Actions' performed by the Signing Agent (fka Core Client)s are viewable and actionable.

Using your chosen programming environment, listen to the Signing Agent (fka Core Client)'s WebSocket feed URL (returned in the previous step)

wss://api.qredo.network/api/v1/p/coreclient/<CORE_CLIENT_ID>/feed

The Action object

AttributeDescriptionChild Attributes
idAction ID-
typeAction Type ApproveWithdraw, ApproveTransfer, RejectWithdraw, RejectTransfer-
statusThe status of the action pending, expired, approved, rejected-
timestampTime in epoch-
expireTimeTime in epoch-
detailsDetails of the Action ActionDetailApproveWithdraw, ActionDetailApproveTransfertxtype, 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"

Golang example

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
  1. Build the sample app
go build -o partnerapi-sign
  1. 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
  1. The command displays your URL, hash, signature and timestamp. It then attempts to connect and if successful returns "connected". Any actions sent to your Signing Agent (fka Core Client) are displayed in compressed JSON format.

View Signing Agent (fka Core Client) Actions.

Python3 example

Required: Python >= 3.6.1 Also, install the websocket library.

pip3 install websocket

Steps

  1. Run the example Python script:

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)
  1. You are successful when your CLI displays actions from the Signing Agent (fka 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 Signing Agent (fka Core Client).

GET /coreclient/{client_id}/actions

ParametersDescription
client_idRequired. 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 Signing Agent (fka Core Client)

GET /coreclient/{client_id}/action/{action_id}

ParameterDescription
action_IDThe unique identifier for the Action.
client_IDThe 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}

ParameterDescription
action_IDThe unique identifier for the Action.
client_IDThe Signing Agent (fka Core Client) unique identifier.

Returns an Action object with status "approved".

Reject an action

Rejects an action.

DELETE /coreclient/{client_id}/action/{action_id}

ParameterDescription
action_IDThe unique identifier for the Action.
client_IDThe 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.

The Holdings object

AttributeDescription
total_countThis is the number of asset types held by a company
symbolThis is the symbol for the asset type e.g. BTC
amountThe 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

ParametersDescription
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 the 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
    }
  ]
}

Use this endpoint to retrieve fund deposit addresses for each asset in that fund.

GET https://api.qredo.network/api/v1/p/company/{company_id}/fund/{fund_id}/deposit

ParametersDescription
company_idRequired. The unique company identifier
fund_idRequired. The unique fund identifier

Returns a list of fund assets, deposit addresses and current balances. See 'Example Fund Deposit Address Response'.

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

ParametersDescription
company_idRequired. The unique company identifier
fund_idRequired. 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.

The Fund object

  • EXAMPLE FUND OBJECT
{
"fund_id":"EXAMpleFunD00JDaDfnT9sKNdY6",
"name":"Fund 1",
"description":"Fund for demonstration",
"custodygroup_withdraw":"EXAMpleGr0upjAymQVOroGre7DF",
"custodygroup_tx":"EXAMpleGr0upsjzO0tPZPQZyPW8",
"members":
  [
    {
      "entity":
      {
        "id":"EXAMpl31Dp8g8eoI0qBrNjvjFb4",
        "accountCode":"EXAMpl34cc0UNTbrRJtHEWwaZ2V785R5AJ13SCPPoDa8",
        "name":"Cryptomagic",
        "initials":"C",
        "type":"company",
        "company":
          {
            "name":"Cryptomagic"
          }
      },
        "permissions":
          {
            "admin":true
          }
            }
    ],
    "assets":["BTC-TESTNET"],
    "wallets":
    [
      {
        "wallet_id":"EXAMpl31DsKKm175EwASd7BKCQcwZ6QF5Mm8ozbAYb7H",
        "name":"New wallet",
        "asset":"BTC-TESTNET",
        "type":0,
        "status":"ready",
        "address":"EXAMpl3aDDr3ssW1xySNDcQ8VScLLA2Meg",
        "address_type":"P2PKH",
        "short_code":"purchase version cousin",
        "balance":0,
        "custodygroup_withdraw":"EXAMpleGr0upjAymQVOroGre7DF",
        "custodygroup_tx":"EXAMpleGr0upsjzO0tPZPQZyPW8"
        }
    ]
  }
AttributeDescriptionChild Attributes
fund_idThe unique ID for the fund. Returned when fund is created.-
nameThis is the name allocated when fund created-
descriptionThis is a description of the fund-
custodygroup_withdrawThe Fund Custody Policy specifying: members (trusted_party_id) account code threshold (number of signatures required) for authorization-
custodygroup_txThe Fund Transfer Policy specifying: members (trusted_party_id) threshold (number of signatures required)-
membersDetails about Fund members and permissionsentity 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
WalletsThis 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 a Fund

FUND WITH TWO WALLETS

  1. Standard Wallet - Inherit Fund TX Policy, Custom Withdrawal Policy

  2. Dedicated Wallet - One Counterparty e.g. Exchange

  • EXAMPLE REQUEST
{
  "name": "Apollo",
  "description": "Fund with Dedicated & Standard Wallet - Inherit Fund TX Policy and Custom Withdrawal Policy",
  "custodygroup_withdraw": {
    "threshold": 1,
    "members": [
      "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
      "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
      "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
      "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
    ]
  },
  "custodygroup_tx": {
    "threshold": 1,
    "members": [
      "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
      "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
      "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
      "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
    ]
  },
  "wallets": [
    {
      "name": "Standard Wallet",
      "asset": "ETH",
      "custodygroup_withdraw": {
        "threshold": 2,
        "members": [
          "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
          "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt"
                   ]
                               }
    },
    {
      "name": "Dedicated Exchange Wallet",
      "asset": "BTC",
      "type": 1,
      "connect": [
        {
          "counterparty_id": "EXAMpl31D8rXq5TV5V8mdv9HxD2d8fyJqpDNH3MHT2pK",
          "client_id": "A12345"
        }
                ]
    }
  ]
}
  • SUCCESSFUL 200 RESPONSE BODY
{
  "fund_id":"EXAMpleFunD00JDaDfnT9sKNdY6",
  "custodygroup_withdraw":"EXAMpleGr0upjAymQVOroGre7DF",
  "custodygroup_tx":"EXAMpleGr0upsjzO0tPZPQZyPW8"
}

FUND WITH STANDARD WALLET - INHERIT TX POLICY, CUSTOM WITHDRAWAL POLICY

  • EXAMPLE REQUEST
{
    "name": "Apollo",
    "description": "Fund with Standard Wallet - Inherit Default Fund TX & Withdrawal Policies ",
    "custodygroup_withdraw": {
        "threshold": 1,
        "members": [
            "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
            "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
            "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
            "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
        ]
    },
    "custodygroup_tx": {
        "threshold": 1,
        "members": [
            "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
            "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
            "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
            "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
        ]
    },
    "wallets": [
    {
        "name": "Standard Wallet",
        "asset": "ETH",
        "custodygroup_withdraw": {
            "threshold": 1,
            "members": [
                "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
                "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt"
            ]
        }
    }
  ]
}
  • SUCCESSFUL 200 RESPONSE BODY
{"fund_id":"EXAMpleFunD00iKfG9votdTExMg","custodygroup_withdraw":"EXAMpleGr0up9UC3hXBYRNq1ynB","custodygroup_tx":"EXAMpleGr0upPXx9mcNb6rOrmNj"}

FUND WITH STANDARD WALLET - INHERIT DEFAULT FUND TX & WITHDRAWAL POLICY

  • EXAMPLE REQUEST
{
    "name": "Apollo",
    "description": "Fund with Standard Wallet - Inherit both Default Fund TX & Withdrawal Policies ",
    "custodygroup_withdraw": {
        "threshold": 1,
        "members": [
            "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
            "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
            "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
            "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
        ]
    },
    "custodygroup_tx": {
        "threshold": 1,
        "members": [
            "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
            "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
            "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
            "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
        ]
    },
    "wallets": [{
            "name": "Standard Wallet",
            "asset": "ETH"
        }
    ]
}
  • SUCCESSFUL 200 RESPONSE BODY
{
"fund_id":"EXAMpl31Dk7uJYuugG63Uv2dQrW",
"custodygroup_withdraw":"EXAMpleGr0up6wS9HJwALHpIcjG",
"custodygroup_tx":"EXAMpleGr0upCv1RDZY0m1iGmCH"
}

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

  • EXAMPLE REQUEST
{
    "name": "Apollo",
    "description": "Fund with Standard Wallet - Custom TX & Custom Withdrawal Policies",
    "custodygroup_withdraw": {
        "threshold": 1,
        "members": [
            "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
            "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
            "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
            "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
        ]
    },
    "custodygroup_tx": {
        "threshold": 1,
        "members": [
            "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
            "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
            "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
            "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
        ]
    },
    "wallets": [{
            "name": "Standard Wallet with BTC, Custom TX Policy & Default Withdrawal Policy",
            "asset": "BTC",
            "custodygroup_tx": {
                "threshold": 2,
                "members": [
                    "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
                    "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt"
                ]
            }
        },
        {
            "name": "Standard Wallet with ETH, Custom TX Policy & Custom Withdrawal Policy",
            "asset": "ETH",
            "custodygroup_withdraw": {
                "threshold": 3,
                "members": [
                    "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
                    "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
                    "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
                ]
            },
            "custodygroup_tx": {
                "threshold": 2,
                "members": [
                    "EXAMpleGr0upUDDtHxofpunmPibmAJ7mjTSMDchk2eoq",
                    "EXAMpleGr0upXy6W46AxeFURfuWDLYXKod2ZhvrmvNyt",
                    "EXAMpleGr0uprWWQiPH3XkfJ5URjSHrhYk5zT6yeEEnU",
                    "EXAMpleGr0upBNhnRGUuknkt1wBbjsEYBb8m6vhnsgak"
                ]
            }
        }
    ]
}
  • SUCCESSFUL 200 RESPONSE BODY
{
  "fund_id":"EXAMpleFunD008AMe2t9Ay3dOVi",
  "custodygroup_withdraw":"EXAMpleGr0upel1Og6UJ1jsmYLn",
  "custodygroup_tx":"EXAMpleGr0upxqsgcfp2Po9T87C"}

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

ParametersDescription
company_idRequired. The unique company identifier
nameName for the Fund.
descriptionFund description
custodygroup_withdrawFund Custody Policy (withdrawals) threshold (number of custodial signatures required), each custodial member(trusted_entity_ids)
custodygroup_txFund Custody Policy (transfers) threshold (number of custodial signatures required), each custodial member (trusted_entity_ids)
walletsname Wallet name, asset Asset type e.g. BTC-Testnet, custodygroup_withdraw

Retrieve a Fund

  • EXAMPLE RETRIEVE FUND RESPONSE
{
  "fund_id": "EXAMpl31D5hMOVjGFl1DrsbnvmS",
  "name": "Fund 1",
  "description": "Fund for demonstration purposes",
  "custodygroup_withdraw": "EXAMpleGr0up89dcdhue6LJaFUS",
  "custodygroup_tx": "EXAMpleGr0upV0jggAv1mFSR9jp",
  "members": {
    "entity": {
      "id": "EXAMpl31D2HtHPmWDUKWJ4HR0xp",
      "accountCode": "EXAMpl34cc0UNTmYxB1NeoAVhgwiEHvAoehhYYwZkAYU",
      "name": "ACME Corp",
      "initials": "A",
      "type": "company",
      "company": {
        "name": "ACME Corp"
      }
    },
    "permissions": {
      "admin": true
    }
  },
  "assets": [
    "BTC-TESTNET"
  ],
  "wallets": [
    {
      "wallet_id": "5Hb8J...WCZES",
      "name": "New wallet",
      "asset": "BTC-TESTNET",
      "type": 213312000,
      "status": "ready",
      "address": "EXAMpleTmzkd7bRKKsUmjucpLQLThv8eYX",
      "address_type": "P2PKH",
      "short_code": "bu**y h**sh stic*",
      "balance": 0,
      "custodygroup_withdraw": "EXAMpleGr0up89dcdhue6LJaFUS",
      "custodygroup_tx": "EXAMpleGr0upV0jggAv1mFSR9jp"
    },
    {
      "wallet_id": "7MkAB...S1xH6",
      "name": "New dedicated wallet",
      "asset": "BTC-TESTNET",
      "type": 1,
      "status": "ready",
      "address": "EXAMpleYSdN7uow8MJWCCffBaAQsrqW217",
      "address_type": "P2PKH",
      "short_code": "fa***ue in***t con**ct",
      "balance": 1000000,
      "custodygroup_withdraw": "EXAMpleGr0up89dcdhue6LJaFUS",
      "custodygroup_tx": "EXAMpleGr0upV0jggAv1mFSR9jp",
      "connected": {
        "counterparty_id": "EXAMpl31D9ikHHDVdjZNXjrt3CzGg4HvXRbw94qmqjVm",
        "name": "Test Exchange",
        "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}

ParametersDescription
company_idRequired. The unique company identifier
fund_idRequired. 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

ParametersDescription
company_id*Required. The unique company identifier
queryString 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.

ParameterWallet TypeDescription
0Standard WalletTo conduct transactions independently.
1Dedicated WalletSolely for access by a single third party such as an Exchange. The third party is a Custodian over the wallet and must approve assets moving out of it. This is required because the trader may for example have a limit order open with a third party so they must ensure funds are available to meet the limit order. The connected third party also has the right to 'sweep' assets out of the wallet without further approval from the wallet's owners or custodians.
3Multi-CounterpartyAccessible by multiple third parties. The purpose of this Wallet is to enable a trader to have multiple exchanges connected to the same Wallet for example to allow market orders to be placed on multiple exchanges. The connected third party/parties also have the right to 'sweep' assets out of the wallet without further approval from the wallet's owners or custodians.

Returns a fund id, custodygroup_withdraw policy ID, custodygroup_tx policy ID

  • EXAMPLE CREATE FUND RESPONSE
{
  "fund_id": "EXAMpleFunD0zasqtmtTXXoaNNJ",
  "custodygroup_withdraw": "EXAMpleGr0upScmInkMXSPzitj5",
  "custodygroup_tx": "EXAMpleGr0upPs2v5kvxglwKTKV"
}

Create a 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

ParametersDescription
company_idRequired. The unique company identifier
fund_idRequired. The identifier for the fund.
nameName for the Fund.
descriptionFund description
custodygroup_withdrawOptional. Fund Custody Policy (withdrawals) threshold (number of custodial signatures required), each custodial member(trusted_entity_ids)
custodygroup_txOptional. Fund Custody Policy (transfers) threshold (number of custodial signatures required), each custodial member (trusted_entity_ids)
walletsname 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": [
          "EXAMpleGr0upzasqtmtTXXoaNNJ",
          "EXAMpleGr0upsdg4akvxglwKTKV"
        ]
      },
      "custodygroup_tx": {
        "threshold": 1,
        "members": [
          "EXAMpleGr0upzasqtmtTXXoaNNJ",
          "EXAMpleGr0upsdg4akvxglwKTKV"
        ]
      }
    },
    {
      "name": "New dedicated wallet",
      "asset": "BTC-TESTNET",
      "type": 1,
      "connect": [
        {
          "counterparty_id": "6WM25...mqjVm",
          "client_id": "A12345"
        }
      ]
    }
  ]
}

Returns wallet IDs.

  • EXAMPLE CREATE WALLET RESPONSE
{
  "wallets": [
    "EXAMpl31DZ9Voz9EAbtTHk7A2rhQra4aPcscYNLGePci",
    "EXAMpl31DTHk7A2rhQgmTZYNLGePcira4aPcscKGMWoE"
  ]
}

Retrieve a 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}

ParametersDescription
wallet_idRequired. 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

AttributesDescriptionChild Attributes
wallet_idRequired. String - The originator wallet ID-
counterparty_wallet_addressRequired. String - This is the Counterparty Wallet Address NOTE: You can use the Counterparty Wallet code or their wallet_id-
referenceString - This is your reference for your own records.-
benefit_ofString - This is the name of the recipient of the transfer.-
account_noString - (Where relevant) This is the account number of the recipient of the transfer.-
expiresRequired. 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 a 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": "HUnmE...gRKMk",
  "counterparty_wallet_address": "D1h4c...6QuSP",
  "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

ParametersDescription
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.
referenceOptional
benefit_ofOptional
account_noOptional

See 'Example Transfer Request'.

Returns a Transaction ID tx_id.

  • EXAMPLE TRANSFER RESPONSE
{
  "tx_id": "9827feec4e......a7c3b97add"
}

Addresses

Whitelist an 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

ParametersDescription
company_id*Required. The unique company identifier
fund_id*Required. The unique fund identifier
addressOptional. Find out whether a specific address has been whitelisted
assetOptional. 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": "bc1qg...ktq98"
    },
    {
      "name": "Alice_wallet",
      "asset": "BTC",
      "address": "tb1qd...x7ud8"
    }
  ]
}

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).

The Withdraw object

AttributesDescriptionChild Attributes
wallet_idRequired. String - The originator wallet
addressRequired. String - The destination address. This must be whitelisted.
expiresRequired. String - This is the time in epoch when the withdrawal expires without custodial approval.-
referenceString - This is your reference for your own records.-
benefit_ofString - 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 a 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

ParametersDescription
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.
referenceOptional
benefit_ofOptional
account_noOptional

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.

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)

  1. A Maker posts their quote.
  2. The quote is authorized by the Maker's Custodians.
  3. The quote is added to the Liquidity Hub if add_to_liquidity_hub is set to 'True'
  4. A potential Taker views quotes on the Liquidity Hub
  5. A Taker uses the swap transaction_id to take the quote.
  6. The quote is authorized by the Taker's Custodians
  7. The Atomic swap completes in a single transaction.

Create an 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>"
}

Prerequisites:

  1. Select a fund with required assets and quantities to swap with. (fund_id)

  2. Make your quote. Specify the the assets and quantities you want to send and receive.

  3. Set an expiry time for the swap.

  4. 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

ParametersDescription
send_wallet_id*Required. The Maker's wallet ID
receive_wallet_id*Required. The Taker's wallet ID
expires*Required.
referenceOptional. 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_hubOptional. True or False. If True, quote is automatically added to Liquidity Hub

See 'Example Atomic Swap Make Request'

Returns a unique Swap Transaction ID tx_id and Transaction URL tx_url.

This must be passed to the Taker and executed prior to the expiry time.

The Atomic Swap Make Request must be authorized in accordance with the Maker's custodial policy.

The tx_url can be sent to a 'real' user for them to take.

View the Atomic Swap details

View the status of a Make swap

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}

ParametersDescription
company_idRequired. Makers unique company identifier
tx_idRequired. The Maker swap transaction_id

Returns the Transaction Object. See 'Example Transaction Object'

Delete an 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}

Create an 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": "EXAMpl31DhSEgjObPPHU7vwTNzb",
  "send_wallet_id": "EXAMpl31DKuXpb4hNIgp7DLWGRN",
  "receive_wallet_id": "EXAMpl31DunLQtaZgx49snLQtaZgx49s",
  "reference": "CX15R99XX"
}
  1. Use the Swap transaction_id from the Maker to perform the Swap.

  2. View Atomic Swap Status to ensure it has been authorized

  3. Select a fund with the required assets and quantities to receive and send.

  4. Use this endpoint to take the quote before it expires.

The Atomic Swap Take Request must be authorized in accordance with the Taker's Custodial Policy.

ParametersDescription
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.

The tx_url can be sent to a 'real' user for them to take.

View the status of a Take swap

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}

ParametersDescription
company_idRequired. Takers unique company identifier
tx_idRequired. 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 an 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"
}

Use this endpoint to add your swap to the Liquidity Hub.

POST https://api.qredo.network/api/v1/p/company/{company_id}/liquidityhub

ParametersDescription
company_idRequired. The Maker's unique company identifier
tx_idRequired. 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.

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":"EXAMpl31D89jkYn", 
    "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 a Fund Ledger

  • EXAMPLE LEDGER OBJECT
{
  "List": [
    {
      "TxID": "EXAMpl31DpRzQk3HKnnebfCj5Dh",
      "chainTxID": "EXAMpl31D6wvpY7ioT35sKZ5kyqaSt6kLdTaSShZ11Gb",
      "fundID": "EXAMpl31DmuhNLFvVhwiiqj6XcM",
      "timestamp": 1605269988,
      "expireTime": 1640998800,
      "status": "approved",
      "type": "transferOut",
      "asset": "BTC-TESTNET",
      "amount": 2803,
      "fees": 3,
      "netAmount": 2800,
      "counterpartyID": "EXAMpl31DiseE7RfifsMCDusXL8",
      "counterpartyName": "ACME Corp",
      "address": "",
      "reference": "CX15R99XX",
      "benefitOf": "John Smith",
      "accountNo": "123-XX"
    },
    {
      "TxID": "",
      "chainTxID": "EXAMpl31DsvPjnBaZzaEunxQppdBayGW7KEd2Y8hWtQ8",
      "fundID": "EXAMpl31DmuhNLFvVhwiiqj6XcM",
      "timestamp": 1605267445,
      "expireTime": 0,
      "status": "",
      "type": "deposit",
      "asset": "BTC-TESTNET",
      "amount": 10000,
      "fees": 0,
      "netAmount": 10000,
      "counterpartyID": "",
      "counterpartyName": "",
      "address": "EXAMpl31DAeG9FFbigDyt3WqebrGohuemk",
      "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

ParametersDescription
company_idRequired. company identifier
fund_idRequired. transaction_id (returned when the Fund was created)
assetAsset type
wallet_idWallet Code
directionTransaction direction all in out

Returns the Ledger Object. See 'Example Ledger Object'.

Transaction status

View a transfer status

  • EXAMPLE TRANSACTION OBJECT
{
  "approvedCount": 1,
  "expires": 1640998800,
  "initiatedTimestamp": 1594281300,
  "initiatorAuthorized": true,
  "initiatorName": "Big Fund",
  "reference": "CX15R99XX",
  "status": [
    {
      "actionID": "EXAMpl31D6WrooxkquWmirbo4oL",
      "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}

ParametersDescription
company_idRequired. company identifier
tx_idRequired. transaction_id (returned when the Transfer was created)

Returns the Transaction Object. See 'Example Transaction Object'.

Transfer status codes

tx statusDescription
pending_initiate_transferString - The trade initiator is yet to authorise the transfer
initiate_rejected_transferString- The transfer has been rejected by the trade initiator.
pending_transferString - The transfer is yet to be approved by the custodians
expired_transferString - The time set for custodian approval has been exceeded. The time is set in Epoch.
approved_transferString - The transfer has been approved and has exceeded the threshold. The transfer is written to the Qredo Blockchain.
custody_rejected_transferString - The transfer has been rejected by the custodians.
chain_rejected_transferString - Transfer has been rejected by the Qredo blockchain. (Contact Support)

View a withdrawal 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}

ParametersDescription
company_idRequired. company identifier
tx_idRequired. 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": "EXAMpl31D6WrooxkquWmirbo4oL",
      "firstName": "Han",
      "lastName": "Solo",
      "status": "approved",
      "timestamp": 1594281312,
      "userID": "EXAMpl31DsbSXBs1yjpzMaesirXPhqcz8kM7zgafmZef",
      "username": "hsolo"
    }
  ],
  "statusDetails": {
    "accountNo": "123-XX",
    "amount": 801,
    "asset": "BTC-TESTNET",
    "benefitOf": "Ben Kenobi",
    "expires": 0,
    "fees": 1,
    "fundID": "EXAMpl31DpocC9uRuy3DlNC7zXd",
    "netAmount": 800,
    "recipientAddress": "",
    "recipientEmail": "[email protected]",
    "recipientFirstName": "Han",
    "recipientLastName": "Solo",
    "recipientUsername": "hsolo",
    "reference": "CX15R99XX",
    "requestedBy": "SW Corp"
  },
  "thresholdRequired": 1,
  "txID": "EXAMpl31DhRI3sJ6UzzjYio5ulu",
  "txStatus": "approved"
}

Withdrawal status codes

Withdrawal Status Codes

tx statusdescription
pending_initiate_withdrawalString - The trade initiator is yet to authorise the withdrawal.
initiate_rejected_withdrawalString - The withdrawal has been rejected by the trade initiator.
pending_withdrawalString - The withdrawal is yet to be approved by the custodians.
expired_withdrawalString - The time set for custodian approval has been exceeded. The time is set in Epoch.
approved_withdrawalString - The withdrawal has been approved and has exceeded the threshold. The withdrawal is written to the Qredo Blockchain.
custody_rejected_withdrawalString - The withdrawal has been rejected by the custodians.
chain_rejected_withdrawalString - Withdrawal has been rejected by the Qredo blockchain. (Contact Support)

Signing Agent actions

Action TypeDescription
ApproveWithdrawA withdraw has been approved.
ApproveTransferA transfer has been approved.
Action StatusDescription
pendingThe action has not yet initiated
expiredThe action has expired
approvedThe action has been approved
rejectedThe action has been rejected.

THIRD PARTY CONNECTIONS

Exchanges

Dedicated and Multi-Counterparty wallets can be used to connect with third party exchanges.

Retrieve a 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":"EXAMpl31D8rXq5TV5V8mdv9HxD2d8fyJqpDNH3MHT2pK",
    "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 a new sweep

  • EXAMPLE SWEEP REQUEST
{
  "wallet_id": "EXAMpl31DeNYj2pTH8DfikDcH5gjHqhj9iadgVQgRKMk",
  "recipient_wallet_id": "EXAMpl31DeNYj2pTH8DfikDcH5gjHqhj9iadgVQgRKMk",
  "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

ParametersDescription
client_idRequired. This is the client ID as used by a 3rd party e.g. exchange
wallet_idString. This is the originator wallet ID
recipient_wallet_idString This is the destination wallet ID
referenceReference for the transaction
expiresExpiration time for transaction if not approved by custodians.
sendRequired symbol Asset symbol e.g. BTC amount quantity of assets being sent

Returns a transaction ID is returned.

  • EXAMPLE SWEEP REQUEST RESPONSE
{
  "tx_id": "EXAMpl31Deae4e80bda3daa7c3b97add"
}

View a 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

ParametersDescription
client_idRequired. This is the client ID as used by a 3rd party e.g. exchange
tx_idRequired. This is the tx_id returned when the sweep request was made

Returns the Sweep Transaction object.

Previous
Atomic swaps