What is DART API?

Main Documentation

DART API provides the ability to external systems to connect with DART. By using the API, users can create and manage DART's users externally. Bearer tokens are used to identify the API users.

API URL: https://api.dart.cash/api

Authentication

After creating an API token, use it for authentication with the API by appending the bearer token to the API's base URL:

$request->setHeader(array( 'Authorization' => 'Bearer <token>' ));

Get External Customer

To get customer details, send an HTTP GET request to the API's customer/get endpoint with the following parameters:

Name Description
dart_user_name This parameter is used to specify a customer user name.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/get?dart_user_name=billyjoel'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' ));

API Response

{ "first_name": "Billy", "last_name": "Joel", "dart_user_name": "billyjoel", "email": "billy@gmail.com" }

Create External Customer

To create an external customer, send an HTTP POST request to the API's customer/create endpoint with the following parameters:

Name Description
first_name This parameter is used to specify a customer first name.
last_name This parameter is used to specify a customer last name.
user_name This parameter is used to specify a customer user name.
email This parameter is used to specify a customer email.
password This parameter is used to specify a customer password.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/create'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' )); $request->addPostParameter(array( 'first_name' => 'Billy', 'last_name' => 'Joel', 'user_name' => 'billyjoel', 'email' => 'billy@gmail.com', 'password' => 'billy@123#' ));

API Response

"Customer Created Successfully."

Edit External Customer

To edit an external customer, send an HTTP POST request to the API's customer/update endpoint with the following parameters:

Name Description
dart_user_name This parameter is used to specify a customer user name.
first_name This parameter is used to specify a customer first name.
last_name This parameter is used to specify a customer last name.
email This parameter is used to specify a customer email.
password This parameter is used to specify a customer password.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/update'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' )); $request->addPostParameter(array( 'dart_user_name' => 'billyjoel', 'first_name' => 'Billy', 'last_name' => 'Joel', 'email' => 'billy@gmail.com', 'password' => 'billy@123' ));

API Response

"Customer Updated Successfully."

Restriction for Trade Scripts

To restrict trade scripts, send an HTTP POST request to the API's customer/update-tsp-status endpoint with the following parameters:

Name Description
dart_user_name This parameter is used to specify a customer user name.
external_tsp_status Set to false to restrict trade scripts.
tsp_duration Set an integer as number of hours to deactivate trade scripts.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/update-tsp-status'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' )); $request->addPostParameter(array( 'dart_user_name' => 'billyjoel', 'external_tsp_status' => 'false', 'tsp_duration' => '10' ));

API Response

"Customer Tsp Access Disabled"

Customer Trade Script Details

To get customer trade script details, send an HTTP GET request to the API's customer/trade-script-details endpoint with the following parameters:

Name Description
dart_user_name This parameter is used to specify a customer user name.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/trade-script-details?dart_user_name=billyjoel'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' ));

API Response

{ "data": [ { "trade_script_name": "Full Velocity Members Only", "initial_amount": "49.25", "current_amount": "49.2500", "status": 5, "total_deposit": "50.0000", "activate_date": "2022-06-08" } ] }

Customer Total Balance of USDC

To get customer total balance of USDC, send an HTTP GET request to the API's customer/usdc-balance endpoint with the following parameters:

Name Description
dart_user_name This parameter is used to specify a customer user name.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/usdc-balance?dart_user_name=billyjoel'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' ));

API Response

{ "total_usdc_balance": "980.04" }

Customer Custom Token Value

To get customer custom token value, send an HTTP GET request to the API's customer/token-value endpoint with the following parameters:

Name Description
dart_user_name This parameter is used to specify a customer user name.
token This parameter is used to specify a token name.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/token-value?dart_user_name=billyjoel&token=Chaos'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' ));

API Response

{ "token_value": "19.96" }

Transfer Amount to Customer Main Wallet

To transfer an amount to a customer's main wallet, send an HTTP POST request to the API's customer/transfer-amount endpoint with the following parameters:

Name Description
userId This parameter is used to specify a customer user name.
amount This parameter is used to specify an amount.

API Request

$request = new HTTP_Request2(); $request->setUrl('https://api.dart.cash/api/customer/transfer-amount'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Accept' => 'application/json', 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT' ));

Request Body

{ "userId": "customer user name", "amount": "the amount api user wants to transfer to customer" }

Webhooks

Customer Activate

After activating your customer from the DART system, you will receive a Webhook HTTP POST response to your your-domain/webhook/customer-activate endpoint.

Webhook Response

{ "message": "External customer activated.", "old_dart_user_name": "billyjoel", "new_dart_user_name": "billyjoel" }

Customer Update

After updating your customer details from the DART system, you will receive a Webhook HTTP POST response to your your-domain/webhook/customer-update endpoint.

Webhook Response

{ "message": "External customer information updated", "old_dart_user_name": "billyjoel", "new_dart_user_name": "billy" }

Customer Deactivate

After deactivating your customer from the DART system, you will receive a Webhook HTTP POST response to your your-domain/webhook/customer-deactivate endpoint.

Webhook Response

{ "message": "External customer deactivated.", "old_dart_user_name": "billyjoel", "new_dart_user_name": "billyjoel" }

Trade Script Withdrawal/Exit

After customer withdrawal or exit from the DART system trade script, you will receive a Webhook HTTP POST response to your your-domain/webhook/trade-script-withdrawal endpoint.

Customer Withdrawal from Trade Script

{ "message": "External customer withdraw from trade script.", "old_dart_user_name": "billyjoel", "new_dart_user_name": "billyjoel", "amount": "50.00", "trade_script_name": "Full Velocity Members Only" }

Customer Exit from Trade Script

{ "message": "External customer exit from trade script.", "old_dart_user_name": "billyjoel", "new_dart_user_name": "billyjoel", "amount": "2.00", "trade_script_name": "Full Velocity Members Only" }