Stoxlify Core API (1.0.0)

Download OpenAPI specification:

GENERAL GUIDELINES

INTRODUCTION

Welcome to the Stoxlify API Technical Documentation.

This documentation/reference includes all the details regarding the API endpoints and webhooks that will allow you to integrate Stoxlify's financial services into your own applications, systems, and platforms.

We strongly suggest that you read through the General Guidelines section to familiarize yourself with the overall structure and behavior of the Stoxlify APIs.

The API endpoints are grouped according to the product and are ordered based on the usual call sequence for easier reference. Each product, endpoint, and parameter will have a description to define the purpose of each element.

Disclaimer: We will continually update and enhance this page and its contents whenever necessary.

To know more about how to get started and the end-to-end onboarding process, you may refer to https://stoxlify.com/get-started

For any questions/inquiries, you may refer to our FAQs (https://stoxlify.com/faq) or reach out to the Stoxlify's Team via the Contact Us Form found in various pages of https://stoxlify.com/ and select “Request for integration support for Sandbox and UAT development” in the the “How can we help you?” dropdown.

DEVELOPMENT ENVIRONMENTS

There are 2 environments where you could use our APIs for specific purposes.

  • STAGING (https://api.staging.stoxlify.com/)
    • Description: This environment is where you can “try” or test the request and response of our APIs to have an idea on the format and behaviour that your system needs to integrate with.
    • Purpose of Use: To simulate and test the request and response payload of the APIs so you could finalize how your system interacts with our APIs.
  • PRODUCTION (https://api.stoxlify.com/)
    • Description: This environment is where you can interact with live data and initiate live actions.
    • Purpose of Use: To use the Stoxlify products and services in actual business transactions and use cases.

AUTHENTICATION

The API requires bearer token authentication using the Authorization header. To authenticate, include an Authorization header in your requests with the value Bearer YOUR_ACCESS_TOKEN.

To obtain an API credentials, please contact the administrator.

Account

Retrieve User Account

Retrieve User Account endpoint will allows authenticated user to retrieve their own informations including details, subscription and login info.

Responses

Delete User Account

Delete User Account endpoint will allows user to delete their informations belong to them

Responses

Edit User Account

Edit User Account endpoint will allows authenticated user to edit their own informations.

Request Body schema: application/json
required
name
string

Name represents user's name.

email
string

Email represents user's email.

image
string

Image represents URL of the user's image.

country_code
string

CountryCode represents country code user's in phone number.

phone
string

Phone represents user's phone number.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "image": "string",
  • "country_code": "string",
  • "phone": "string"
}

Bandarmology

Get Broker Summary

This endpoint returns a summary of the current state of a broker. The summary includes information about the broker's balance, open orders, and recent trades.

query Parameters
ticker
string

Ticker represents particular stock code. ex: BBCA, BMRI

Responses

Broker

List Broker Credentials

This endpoint retrieves a list of all broker credentials stored in the system. It provides relevant information for each set of credentials. This allows users to manage and view their linked broker accounts.

query Parameters
page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

broker
string
Default: "UnknownBroker"
Enum: "UnknownBroker" "Binance" "Tokocrypto" "OKX" "Coinbase" "Cexio"

Broker represents credential's provider.

Responses

Disconnect Broker

This endpoint allows users to remove an existing broker credential from the system. Once removed, the system will no longer be able to authenticate or make requests on behalf of the broker associated with the deleted credentials.

query Parameters
client_id
string

ClientName represents api key of client credential.

Responses

Connect Broker

This endpoint allows users to securely add new broker credentials to the system. These credentials can be used to authenticate and authorize requests made on behalf of the broker during trading or data retrieval operations.

Request Body schema: application/json
required
label
string

ClientName represents name of client credential.

client_id
string

ClientName represents api key of client credential.

client_secret
string

ClientName represents api secret of client credential.

broker
string (brokerBrokerOpt)
Default: "UnknownBroker"
Enum: "UnknownBroker" "Binance" "Tokocrypto" "OKX" "Coinbase" "Cexio"

Responses

Request samples

Content type
application/json
{
  • "label": "string",
  • "client_id": "string",
  • "client_secret": "string",
  • "broker": "UnknownBroker"
}

Contact

Contact Us

Contact Us enable customer to reach out to team for support their needs

Request Body schema: application/json
required
name
string

Name represents customer's name.

email
string

Email represents customer's email.

message
string (Message represet's customer's message)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "message": "string"
}

Dictionary

Fetch Dictionaries

This endpoint used to fetch dictionaries based on category.

query Parameters
category
string

Category determines category of the dictionary.

label
string

Label determines label of the dictionary.

Responses

Market

Get Market Info

This endpoint returns real-time stock quotes, historical data, and technical indicators for any publicly traded company.

Request Body schema: application/json
required
ticker
string (Ticker represents the particular product code. ex: BBCA, BMRI)
range
string

Range represents the term count.

interval
string

Interval represents the time period between terms.

indicator
string

Indicator represents a trend or fact that indicates the state or level of price.

source
string (marketSource)
Default: "UnknwonSource"
Enum: "UnknwonSource" "YFinance" "Binance"

Responses

Request samples

Content type
application/json
{
  • "ticker": "string",
  • "range": "string",
  • "interval": "string",
  • "indicator": "string",
  • "source": "UnknwonSource"
}

Market Monitoring Status

This endpoint returns the current stock monitoring status for a particular market or group of products. You can specify the market(s) you want to get the status for, as well as the frequency at which you want to check their stock status.

Request Body schema: application/json
required
object

List represent mapped list of a latest monitoring status of a ticker.

Responses

Request samples

Content type
application/json
{
  • "list": {
    }
}

Search Market Ticker

This endpoint used for full-text searching available ticker from the market information provider.

query Parameters
query
string

Query represents the symbol or keyword to search for.

source
string
Default: "UnknwonSource"
Enum: "UnknwonSource" "YFinance" "Binance"

Source represents the data source of the symbol or keyword to search for.

Responses

Media

Upload Media

Upload Media allow user to store their media data into object storage.

Request Body schema: application/json
required
content
string

Content represents base64 encoded file content.

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Fetch Media

Fetch Media allows user to fetch their stored media.

path Parameters
name
required
string

Name represents file name being uploaded to object storage.

query Parameters
media_id
string

MediaId represents media unique identifier.

Responses

Remove Media

Remove Media allows user to delete their stored media.

path Parameters
name
required
string

Name represents file name being uploaded to object storage.

query Parameters
media_id
string

MediaId represents media unique identifier.

Responses

Model

Retrieve Models

This endpoint used to retrieve list of user custom made made trading model.

query Parameters
page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

Responses

Save Model

This endpoint used to save custom made trading model.

Request Body schema: application/json
required
label
string

Name is the user identifier of a model.

description
string

Description is detailed brief of the model.

overlay
boolean

Overlay determines indicator is overlaying candlestick price.

object (scriptScript)

Responses

Request samples

Content type
application/json
{
  • "label": "string",
  • "description": "string",
  • "overlay": true,
  • "script": {
    }
}

Retrieve List Deployed Models

This endpoint retrieves a list of all trading models that are currently deployed and active within the system. This helps users monitor their deployed algorithms in real time.

query Parameters
page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

ticker
string

Ticker represents the particular product code. ex: BTCUSDT, ETHUSDT

source
string
Default: "UnknwonSource"
Enum: "UnknwonSource" "YFinance" "Binance"

Source is a data provider used for price data.

Responses

Deploy Model

Submit to this endpoint to deploy trading model using custom trading strategy.

Request Body schema: application/json
required
model_id
string

ModelId represents identifier of model used for deployment.

credential_id
string

CredentialId is Client Id used from connected broker.

timing
string (modelTradeTiming)
Default: "OnTime"
Enum: "OnTime" "Late"

Responses

Request samples

Content type
application/json
{
  • "model_id": "string",
  • "credential_id": "string",
  • "timing": "OnTime"
}

Update Status Deployment

This endpoint allows users to update the deployment status of an active trading model. Users can pause, resume, or stop the deployment of a model, giving them control over the trading model's lifecycle. This is useful for managing models based on performance or market conditions.

Request Body schema: application/json
required
task_id
string

TaskId represents identifier of a deployed model.

status
string (modelTaskStatus)
Default: "UnknownStatus"
Enum: "UnknownStatus" "Paused" "OpenPosition" "NoPosition" "TaskPending" "TaskDone" "TaskCanceled"

Responses

Request samples

Content type
application/json
{
  • "task_id": "string",
  • "status": "UnknownStatus"
}

Delete Deployed Model

This endpoint allows users to remove or undeploy a trading model that is currently deployed. Once removed, the model will no longer be active or participate in live trading. This is useful for stopping or retiring models that are no longer needed or performing as expected.

path Parameters
task_id
required
string

TaskId represents identifier of a deployed model.

Responses

Execute Script

This endpoint used to compile user custom made made trading model.

Request Body schema: application/json
required
model_id
string

ModelId is the identifier of a model.

object (scriptScript)
ticker
string (Ticker represents the particular product code. ex: BTCUSDT, ETHUSDT)
range
string

Range represents the term count.

interval
string

Interval represents the time period between terms.

source
string (marketSource)
Default: "UnknwonSource"
Enum: "UnknwonSource" "YFinance" "Binance"

Responses

Request samples

Content type
application/json
{
  • "model_id": "string",
  • "script": {
    },
  • "ticker": "string",
  • "range": "string",
  • "interval": "string",
  • "source": "UnknwonSource"
}

Load Model

This endpoint used to load user custom made made trading model.

path Parameters
model_id
required
string

ModelId is the identifier of a model.

Responses

Remove Model

This endpoint used to remove single user made trading model.

path Parameters
model_id
required
string

ModelId is the identifier of a model.

Responses

Product

Get Products

Get Products provide informations about products

query Parameters
categories
Array of strings

Categories represents list of name of the product's category.

product_ids
Array of strings

ProductIds represents list of product's unique identifier.

category_ids
Array of strings

CategoryIds represents list of product category's unique identifier.

name
string

Name represents product unique name for full text search.

page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

Responses

Delete Products

Delete Products facilitates to delete specific products

query Parameters
product_ids
Array of strings

ProductIds represents product's unique identifier.

Responses

Create Products

Create Products facilitates to create new products

Request Body schema: application/json
required
Array of objects (productProduct)

Products returning list of available products.

Responses

Request samples

Content type
application/json
{
  • "products": [
    ]
}

Purchase

Get Purchases

Get Purchases provides data of created purchases and it's details

query Parameters
purchase_ids
Array of strings

PurchaseIds represents list of unique identifier of a purchase.

status
Array of strings

Status represents list of status of a purchase.

page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

latest
boolean

Latest enforces to fetch latest state.

Responses

Purchase

Purchase facilitates purchase a product action that triggers payment

Request Body schema: application/json
required
provider
string (purchasePaymentProvider)
Default: "UnknownPaymentProvider"
Enum: "UnknownPaymentProvider" "Mock" "Mayar"
Array of objects (purchasePurchaseProduct)

Products represents products being purchased.

object (purchasePurchaseDiscount)

Responses

Request samples

Content type
application/json
{
  • "provider": "UnknownPaymentProvider",
  • "products": [
    ],
  • "discount": {
    }
}

Precalculate Purchase

Purchase facilitates price pre calculation before doing the real purchase

Request Body schema: application/json
required
provider
string (purchasePaymentProvider)
Default: "UnknownPaymentProvider"
Enum: "UnknownPaymentProvider" "Mock" "Mayar"
Array of objects (purchasePurchaseProduct)

Products represents products being purchased.

object (purchasePurchaseDiscount)

Responses

Request samples

Content type
application/json
{
  • "provider": "UnknownPaymentProvider",
  • "products": [
    ],
  • "discount": {
    }
}

Statistic

Dashboard Monitoring

This endpoint provides a comprehensive overview of key metrics and performance indicators for the trading platform. The dashboard includes real-time data and statistics on trading models, active trades, portofolio, offering users a centralized view to monitor and manage trading activities effectively.

query Parameters
range
string
Default: "UnknownTimeRange"
Enum: "UnknownTimeRange" "Day" "Week" "Month"

Range represents time range applied for querying dashboard monitoring.

Responses

Strategy

Retrieve Strategies

This endpoint used to retrieve list of user made stragtegies.

query Parameters
page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

Responses

Remove Strategy

This endpoint used to remove single user made strategy.

query Parameters
strategy_id
string

StrategyId is the identifier of a strategy.

Responses

Save Strategy

This endpoint used to save stategy which contain list of rules.

Request Body schema: application/json
required
label
string

Label is the user identifier of a strategy.

description
string

Description is detailed brief of the strategy.

analytic
string (strategyAnalyticOptions)
Default: "UnknownAnalytic"
Enum: "UnknownAnalytic" "Technical" "Fundamental" "Bandarmology"

Responses

Request samples

Content type
application/json
{
  • "label": "string",
  • "description": "string",
  • "analytic": "UnknownAnalytic"
}

Simulation

Retrieve Technical Rules

This endpoint used to retrieve list of user made technical rules for simulation.

query Parameters
page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

strategy_id
string <int64>

StrategyId identify group of saved technical rules.

Responses

Remove Technical Rule

This endpoint used to remove single user made technical rules for simulation.

query Parameters
rule_id
string

RuleId is the identifier of a rule.

Responses

Add Technical Rules

This endpoint used to add technical rule for simulation.

Request Body schema: application/json
required
Array of objects (technicalTechnicalRules)

Rules are a conditions that want to be simulated.

Responses

Request samples

Content type
application/json
{
  • "rules": [
    ]
}

Trade

Retrieve Trades

This endpoint retrieves a list of executed trades from the system, allowing users to view details of past trades for analysis and record-keeping.

query Parameters
page
string <int64>

Page determines number of page.

limit
string <int64>

Limit determines maximum number of returned data.

from
string <date-time>

From is the beginning timestamp of returned data.

to
string <date-time>

To is the ending timestamp of returned data.

Responses