Lipisha REST APIs


Making API Calls


How to Make and Process an API Call in 2 Easy Steps

Once you generate your API credentials:

  1. Make a HTTP POST Request to an API Endpoint with appropriate API Parameters for a specific API call.
  2. A JSON Response containing status and content will be immediately returned for processing.

Make a HTTP POST API Call

To make a request, your application must make a HTTP POST with URL encoded parameters to the relevant API URL.

The API URL format is defined as follows:

https://www.lipisha.com/payments/accounts/index.php/v2/api/[function_name]

Where [function_name] is the particular API function you would like to call e.g. create_payment_account.

The HTTP POST parameters must:

  1. Be URL encoded
  2. Include the API Credentials i.e API Key and API Signature
  3. Include the API Version
  4. Include all required function parameters for the specific function

The HTTP POST can be done natively or using CURL libraries available for the different programming or scripting languages. (See script samples in section 2.1.3)

Processing JSON Response

The API response will be a JSON made up of two parts.

  1. Status
  2. Content

The Status contains information on whether the API call was successful and error information if the API call failed while the Content will contain the request response relevant to the function requested by the API call.

Example of a typical JSON Response from an API Call back

  1. {
  2.   "status": {
  3.     "status_code": "0000",
  4.     "status_description": "Account Created",
  5.     "status": "SUCCESS"
  6.   },
  7.   "content": {
  8.     "account_type": "1",
  9.     "account_number": "00155",
  10.     "account_name": "Test Account",
  11.     "account_manager": "test_user"
  12.   }
  13. }

The following are some of the general status information your API call may return after processing.

Status Code Status Status Description
0000 SUCCESS API call executed and returned success status
1000 FAIL No POST parameters provided
2000 FAIL Required POST parameters missing or invalid
3000 FAIL The API credentials are invalid
4000 FAIL API call executed but returned failed status
5000 FAIL Function specific error
6000 FAIL Mobile operator related error

The content information returned will be specific for each API call. (See API responses for the different function calls in Section 3)


Fork me on GitHub