Skip to main content
POST
/
session
Creates a customer session
curl --request POST \
  --url https://api.pipevest.com/v1/ussd/session \
  --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 '{
  "customerId": 123456
}'
{
  "data": {
    "sessionId": "ussd_3278668b308502f3a562950fc8043028",
    "currentState": "HOME",
    "menu": {
      "state": "HOME",
      "text": "Select an investment option:",
      "options": [
        {
          "key": "1",
          "label": "Stocks",
          "nextState": "STOCKS"
        },
        {
          "key": "2",
          "label": "My Portfolio",
          "nextState": "MY_PORTFOLIO"
        }
      ],
      "isEndState": false
    },
    "ussdText": "Select an investment option:\n\n1. Stocks\n2. My Portfolio",
    "expiresAt": "2025-11-06T14:38:12.202Z"
  },
  "code": 200,
  "message": "Success"
}

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 create a customer session

customerId
integer
required

Unique customer identifier

Example:

123456

Response

Customer session created successfully

data
object
required

The USSD session response data

code
string
required

Request response code

Example:

200

message
string
required

Request response message

Example:

"Success"