Documentation Index Fetch the complete documentation index at: https://docs.pipevest.com/llms.txt
Use this file to discover all available pages before exploring further.
The stock purchase view allows the user to confirm an amount to purchase for a given stock.
This flow is particularily important given that a POST request must be made in order to create
the purchase order request.
Accessing the stock purchase view
Pass 1 as the option key to the choice parameter.
curl --request POST \
--url https://api.staging.pipevest.com/v1/ussd/process
...
--data 'sessionId=<session-id>'
--data 'choice=1'
Example Response
{
"message" : "USSD request processed successfully" ,
"data" : {
"sessionId" : "ussd_5310deea137a9cd999b02ae68a7bbbec" ,
"currentState" : "BUY_STOCK" ,
"menu" : {
"state" : "BUY_STOCK" ,
"text" : "Buy Apple Inc. (AAPL) \n\n Select amount to invest:" ,
"options" : [
{
"key" : "1" ,
"label" : "ZK22.00" ,
"nextState" : "PURCHASE_CONFIRMATION" ,
"data" : {
"amount" : 22
}
},
{
"key" : "2" ,
"label" : "ZK112.00" ,
"nextState" : "PURCHASE_CONFIRMATION" ,
"data" : {
"amount" : 112
}
},
{
"key" : "3" ,
"label" : "ZK562.00" ,
"nextState" : "PURCHASE_CONFIRMATION" ,
"data" : {
"amount" : 562
}
},
{
"key" : "4" ,
"label" : "Enter custom amount" ,
"nextState" : "ENTER_CUSTOM_PURCHASE_AMOUNT"
},
{
"key" : "0" ,
"label" : "Back" ,
"nextState" : "SELECT_STOCK"
}
],
"isEndState" : false
},
"ussdText" : "Buy Apple Inc. (AAPL) \n\n Select amount to invest: \n\n 1. ZK22.00 \n 2. ZK112.00 \n 3. ZK562.00 \n 4. Enter custom amount \n 0. Back" ,
"expiresAt" : "2025-11-06T14:58:33.942Z"
}
}
Confirming order purchase request
This is the menu that is displayed once the customer has chosen to purchase a stock.
From here the customer can choose to confirm the purchase or go back to the individual stock menu.
curl --request POST \
--url https://api.staging.pipevest.com/v1/ussd/process
...
--data 'sessionId=<session-id>'
--data 'choice=1'
{
"message" : "USSD request processed successfully" ,
"data" : {
"sessionId" : "ussd_5310deea137a9cd999b02ae68a7bbbec" ,
"currentState" : "PURCHASE_CONFIRMATION" ,
"menu" : {
"state" : "PURCHASE_CONFIRMATION" ,
"text" : "Confirm stock purchase: \n\n Stock: Apple Inc. (AAPL) \n Amount: ZK22.00 \n\n Press \" 1 \" to confirm purchase and agree to terms and conditions (pipevest.com/terms)." ,
"options" : [
{
"key" : "1" ,
"label" : "Confirm" ,
"nextState" : "PURCHASE_SUCCESS"
},
{
"key" : "0" ,
"label" : "Back" ,
"nextState" : "BUY_STOCK"
}
],
"isEndState" : false
},
"ussdText" : "Confirm stock purchase: \n\n Stock: Apple Inc. (AAPL) \n Amount: ZK22.00 \n\n Press \" 1 \" to confirm purchase and agree to terms and conditions (pipevest.com/terms). \n\n 1. Confirm \n 0. Back" ,
"expiresAt" : "2025-11-06T14:58:33.942Z"
}
}
Stock Purchase Example
USSD Stock Purchase View Check out an example of the ussd stock purchase view