The stocks menu view contains the available stocks that can be purchased.

Accessing the stocks view

Make a GET request to /stocks
  curl --request GET \
    --url https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456
    --header 'Authorization: Bearer 123456' \
    --header 'Signature: sig1=:OTEyMjY4...A5NTNDMEQ=:' \
    --header 'Signature-Input: sig1=("Authorization" "X-Client-Id" "@method" "@target-uri" "@path" "@query");keyid="staging-pipevest-ed25519";created=1732893484;expires=1732893584' \
    --header 'X-Client-Id: 123456' \

Example Response

{
  "data": {
    "ussdMessage": "Select Stock\n 1.Apple (AAPL)\n 2. Tesla (TSLA)\n 3. Microsoft (MSFT)\n 4. Nike (NKE) 5. Coca-Cola (KO) 6. View More Stocks 7. Search Stock Symbol 8. Back",
    "ussdOptions": [
      {
        "option": 1,
        "requestUrl": "https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&symbol=AAPL",
        "requestType": "GET"
      },
      ...
      {
        "option": 6,
        "requestUrl": "https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&page=2",
        "requestType": "GET"
      },
      {
        "option": 7,
        "requestUrl": "https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&searchMode=true",
        "requestType": "GET"
      },
      {
        "option": 8,
        "requestUrl": "https://api.staging.pipevest.com/v1/ussd/home?customerId=123456",
        "requestType": "GET"
      }
    ]
  },
  "code": 200,
  "message": "Success"
}

Viewing individual stock

Paging stocks view

  curl --request GET \
    --url https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&symbol=AAPL&page=2
    ...

The response will be similar to the initial request to view the stock menu

Enabling search mode

Returns a view that allows users to input a stock symbol.

  curl --request GET \
    --url https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&symbol=AAPL&searchMode=true
    ...

Example Response

{
  "data": {
    "ussdMessage": "Search stock symbol\n 1. Back\n",
    "ussdOptions": [
      {
        "option": 1,
        "requestUrl": "https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&symbol=AAPL",
        "requestType": "GET"
      }
    ],
    "ussdConfirm": {
      "requestUrl": "https://api.staging.pipevest.com/v1/ussd/stocks?customerId=123456&symbol={symbol}",
      "requestType": "GET"
    }
  },
  "code": 200,
  "message": "Success"
}

When confirming the stock search, {symbol} in the url must be swapped with the user input.

Query parameters

queryDefinitionRequired
customerIdThe unique customer identiferYes
pageThe current set of viewable stocks. Default is 1No
searchModeReturns a view that prompts the user to input a stock symbol. Default is falseNo

Stocks View Example

USSD Stocks View

Check out an example of the ussd stock view