Close
    logo

    API Basics

    Kashier API gives you access to pretty much all the features you can use on our dashboard and lets you extend them for use in your application. It strives to be RESTful and is organized around the main resources you would be interacting with - with a few notable exceptions.

    Sample Requests

    We provide sample API calls next to each method using cURL. All you need to do is insert your specific parameters, and you can test the calls from the command line. See this tutorial on using cURL with APIs.

    You can also use Postman if you aren't familiar with cURL. Postman is an easy to use API development environment for making HTTP requests. You can download the Kashier Postman Collection to make testing the API easier.

    Requests and Response

    Both request body data and response data are formatted as JSON. Content type for responses will always be application/json. Generally, all responses will be in the following format:

    Click here to shrink
    1{
    2 "response": [object], // contains actionable result of processing if present
    3 "status": [string], // Only success if the details provided could be processed and no error occured while processing
    4 "message": [string] // Explains why status is false... Entirely informational. Please only log this but do not use for your checks
    5}

    While we generally recommend that developers use HTTP status codes to determine the result of an API call, we have provided a handy status key to let you know upfront if the request was successful or not.

    Message key

    The message key is a string which will contain a summary of the response and its status. For instance when trying to retrieve a list of invoices, message might read The Payment Requests have been retrieved [success]. In the event of an error, the message key will contain a description of the error.

    Response key

    The response key is where you want to look at for the result of your request. It can either be an object, or an array depending on the request made. For instance, a request to retrieve a list invoices will return a array of invoices in the data key inside response object.

    Pagination

    The pagination key is used to provide context for the contents of the response key. For instance, if a list of transactions performed by a merchant is being retrieved, pagination parameters can be passed along to limit the result set. The pagination key will then contain an object with the following attributes:

    Click here to shrink
    1"pagination": {
    2 "totalDocs": 211,
    3 "limit": 1000000,
    4 "totalPages": 1,
    5 "page": 1,
    6 "pagingCounter": 1,
    7 "hasPrevPage": false,
    8 "hasNextPage": false,
    9 "prevPage": null,
    10 "nextPage": null
    11}

    Keys

    KeyDescription
    totalDocsThis is the total number of transactions that were performed by the merchant.
    limitThis is the maximum number of records that will be returned per request. This can be modified by passing a new value as a pageSize query parameter. Default value is 10 documents per page and Maximum value is 100 documents per page
    totalPagesThis is how many pages in total are available for retrieval considering the maximum records per page specified. For context, if there are 100000001 records and pageSize is left at its default value, totalPages will have a value of 2.
    pageThis is the current page being returned. This is dependent on what page was requested using the currentPage query parameter. Default: 1
    pagingCounterThis is the starting number of first record for retrieval considering the maximum records per page specified.
    hasPrevPageThis is boolean to give availability of prev page.
    hasNextPageThis is boolean to give availability of next page.
    prevPageThis is order of previous page if available or NULL.
    nextPageThis is order of Next page if available or NULL.
    Getting Started — Previous
    API Keys
    Next — Dashboard API
    Authentication