Asset Share Price Integration (Market stack)

Requirement 

Need to integrate Asset Number (custom record) with the Stock market prices of the Asset numbers with the respective World Market and Ticker symbol.
Fetch the data for each day.

Overview

The marketstack API was built to offer a stock market data solution and make it accessible to both developers and companies around the world. At this time, the API supports 125,000+ stock tickers from 72 global stock exchanges. Using the marketstack REST API you will be able to obtain end-of-day data, intraday data as well as historical market data for the last 30 years.The marketstack API is part of the apilayer portfolio and sits next to some of the most popular API services and Software-as-a-Service products worldwide, such as currencylayer, aviation stack or ip stack. To learn more about apilayer, visit the official apilayer website. Stock market data provided by the marketstack API is licensed and sourced from multiple high-authority market data providers around the world. Stock market data from United States exchanges is licensed and sourced from Tiingo, Inc. out of New York City, USA.

Pricing is based on the number of monthly API requests allowed. Each time the marketstack API service is used to look up data for one specific stock ticker, one API request is consumed. As a result, if a given API request contains 5 tickers (symbols), 5 API requests will be consumed. API errors are not counted towards the monthly quota.

Marketstack API and NetSuite

  • In NetSuite, the records present for the Stock price integration are ‘Asset Number’ and ‘Asset Share Price & Currency’.
  • The Asset Number record contains the Ticker symbol which will be used to fetch the raw closing stock price of the respective Ticker symbol.

                                                  Fig 1.1: Asset Number record
  • The Stock prices are created as new Asset Share Price & Currency records, which is linked with the Asset Number.

                                    Fig 1.2: Associated Asset Share Price & Currency records

Integration Working

The MarketStack API is scheduled to run every day, which will fetch the raw closing price of the given stock ticker symbol. The Asset Number record contains the World Market and Ticker symbol.

  • The Asset Number records containing Ticker symbols only are listed for the Marketstack API integration.
  • Based on the Ticker Symbol, the Asset price of the Ticker symbol is fetched from the Marketstack API.
  • The date of the Asset Share Price record will be the date fetched from the response of the Marketstack API.
  • The currency of the Asset Share Price record will be set as ‘GBP’ always.
  • Asset prices are only present in the working days, so during weekends the Asset prices fetched will be of the latest working day.
  • The Marketstack API is scheduled to run every day at 11:00 pm NetSuite account time.

An email will be sent to the script owner, whenever an error response is fetched from the Marketstack APIs.

Leave a comment

Your email address will not be published. Required fields are marked *