Skip to main content
POST
/
process
Processes a customer's ussd request
curl --request POST \
  --url https://api.pipevest.com/v1/ussd/process \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Signature: <signature>' \
  --header 'Signature-Input: <signature-input>' \
  --header 'X-Client-Id: <x-client-id>' \
  --data '{
  "sessionId": "ussd_3278668b308502f3a562950fc8043028",
  "choice": 1
}'
{
  "message": "USSD request processed successfully",
  "data": {
    "sessionId": "ussd_3278668b308502f3a562950fc8043028",
    "currentState": "STOCKS",
    "menu": {
      "state": "STOCKS",
      "text": "Select Stock:",
      "options": [
        {
          "key": "1",
          "label": "AAPL",
          "nextState": "SELECT_STOCK",
          "data": {
            "stockId": "cmhkp4jkw0005zxfok9m0kiwg",
            "symbol": "AAPL",
            "name": "Apple Inc."
          }
        },
        {
          "key": "2",
          "label": "AMZN",
          "nextState": "SELECT_STOCK",
          "data": {
            "stockId": "cmhkp4kcp0008zxfohlxjtvd7",
            "symbol": "AMZN",
            "name": "Amazon.com Inc."
          }
        },
        {
          "key": "3",
          "label": "GOOGL",
          "nextState": "SELECT_STOCK",
          "data": {
            "stockId": "cmhkp4juc0006zxfo52azbrvo",
            "symbol": "GOOGL",
            "name": "Alphabet Inc."
          }
        },
        {
          "key": "4",
          "label": "JPM",
          "nextState": "SELECT_STOCK",
          "data": {
            "stockId": "cmhkp4ldl000czxfoqdqmzur8",
            "symbol": "JPM",
            "name": "JPMorgan Chase & Co."
          }
        },
        {
          "key": "5",
          "label": "META",
          "nextState": "SELECT_STOCK",
          "data": {
            "stockId": "cmhkp4kv7000azxfoi6s5yw7j",
            "symbol": "META",
            "name": "Meta Platforms Inc."
          }
        },
        {
          "key": "7",
          "label": "Next Page"
        },
        {
          "key": "8",
          "label": "Search Stock",
          "nextState": "SEARCH_STOCK"
        },
        {
          "key": "0",
          "label": "Back to Home",
          "nextState": "HOME"
        }
      ],
      "isEndState": false
    },
    "ussdText": "Select Stock:\n\n1. AAPL\n2. AMZN\n3. GOOGL\n4. JPM\n5. META\n7. Next Page\n8. Search Stock\n0. Back to Home",
    "expiresAt": "2025-11-06T14:38:12.202Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Signature
string
required

Base64 encoded signed hash of the http message request components.

Learn how signatures work

Example:

"sig1=:OTEyMjY4...A5NTNDMEQ=:"

Signature-Input
string
required

An ordered list of components that make up the signature base. It is used to recompute and verify the Signature

Learn how signatures work

Example:

"sig1=(\"Content-Type\" \"Content-Digest\"...expires=<expires>"

X-Client-Id
string
required

Unique identifier assigned to the client

Example:

"client-id"

Query Parameters

customerId
integer
required

Unique customer identifier

Example:

123456

Body

application/json

Details used to process a customer's ussd request

sessionId
string
required

Unique session identifier

Example:

"ussd_3278668b308502f3a562950fc8043028"

choice
required

The choice made by the customer (can be an integer like 1, 2, 3, 4 or a string like "Tesla", "Apple", "Gold")

Example:

1

Response

USSD request processed successfully

data
object
required

The USSD process request response data

code
string
required

Request response code

Example:

200

message
string
required

Request response message

Example:

"Success"