Rewards & Loyalty

Rewards

POST /rewards

const issueReward = (customer: string, asset: string, notional: string) => {
  const body = `{
    underlying: ${underlying},
    quoted_currency: 'e₹',
    total: ${notional}
    participant_code: ${customer}
  }`
  const timestamp = Math.round(Date.now() / 1000)
  const payload = timestamp + 'POST' + '/rewards' + body
  const decodedSecret = Buffer.from(apiSecret, 'base64')
  const hmac = crypto.createHmac('sha256', decodedSecret)
  const signedPayload = hmac.update(payload).digest('base64')

  // SET HEADERS
  const headers = {
    'X-NDAX-API-KEY': 'public_key',
    'X-NDAX-SIGNED': signedPayload,
    'X-NDAX-TIMESTAMP': timestamp,
    'X-NDAX-PASSPHRASE': 'passphrase'
  }
  const options = {
    headers,
    body,
    json: true
  }

  return request.post(`https://api.ndax.in/rewards`, options)
}

Sample Response

Executes a trade to issue a reward in a certain asset. See one-pager here for more details.

Optional request header include:

Parameter
Description
Type

X-REQUEST-ID

Include a X-REQUEST-ID in the request header to ensure idempotent rewards requests

UUID

Body parameters include:

  • underlying (required) the underlying asset for to be rewarded.

  • quoted_currency (required) the quoted asset for purchase of the reward

  • quantity (optional) the desired amount of the underlying for the quote (either quantity or total must be provided)

  • total (optional) the desired amount of the quoted_currency for the quote (either quantity or total must be provided)

  • participant_code (required) the participant that is receiving the reward. This is the platform's customer.

  • account_label (optional) the account label associated with the account.

Response:

Parameter
Description
Type

request_id

The identifier of the RFQ

string

quote

The quote object that was executed

quote

trade_id

The unique identifier assigned to the trade, which is the same trade_id as found in a GET /trades request Note: the quote_id will be saved as the client_trade_id

string

status

The status of the trade, e.g. Completed

string

Last updated