Patascore

Financial health. Financial Prosperity. Financial wealth.
This document defines the new web service specifications for the Patascore services. It also illustrates the technologies and protocols used to support cross platform cross language interaction between the Patascore web services and Patascore clients. The API is REST based, and the data-exchange format is JSON. The API follows HTTP rules, enabling a wide range of HTTP clients can be used to interact with the API.

General Principals

Root of the API

The API gateway offers a set of endpoints that can be reached via the following root URI’s depending on the environment:
  • Development/Testbed: https://dev.api.patascore.com/
  • Production: https://api.patascore.com/

Available HTTP VERBS

Patascore APIs use appropriate HTTP verbs for every action
Method
Description
GET
Used for retrieving resources.
POST
Used for creating resources and performing resource actions.
PUT
Used for updating resources.
DELETE
Used for deleting resources.
Data submitted to the API must be in JSON format, all responses from the API are also in JSON format.

Response Structure

The response structure for Patascore APIs follows the below format.
{
"status":200,
"message":"Successfully logged in",
"data":{
"national_id":"12345678",
"phone":"254707001122",
"name":"Anthony Kamau Mathenge",
"id":1328774,
"uuid":"b493a591-46a3-46c7-8c1d-0537d00f977c"
}
}

Webhooks/Callback URLs

Webhooks are user-defined HTTP callbacks triggered by an event. Patascore uses webhooks to asynchronously let your application know when events happen Eg,
  • Mpesa statement analytics process completion
  • CRB data fetch completion

Errors

Errors are always returned as an array of error objects, keyed by errors in the top level of a JSON object along with an error status & message
{
"status":400,
"message":"Validation failed for one or more arguments",
"errors":[
"channel: Channel is mandatory"
]
}
Last modified 2yr ago