Wiki

    Contact support:

    Email: support@erply.com

    14 Jul, 2021
    Permalink:
    Also available in:EstonianFinnish

    Which API To Use?

    The term "API" stands for "Application Programming Interface". Erply API is the programmatic way to "talk to Erply", and lets you:
    1. Fetch the data you can see in back office (eg. the list of products or customers);
    2. Or, add or modify data (eg. to create a new sales order);
    3. Or, issue commands (eg. to ask Erply what is the current effective price, including discounts and promotions, for a particular product in a particular store and for a specific customer).

    Erply API

    If you are new to Erply API development, then most likely what you need is "Erply API". It is an all-around, general-purpose API that supports all Erply's standard features and lets you do everything that you can do in back office and in the POS (point of sale).

    There is a dedicated website and knowledge base for Erply API:
     
    Whatever your Erply account is, you can always access your account's API at the following URL:
     
    https://<account number>.erply.com/api/

    Other APIs

    Lately, we have started implementing new API features as separate "microservices". Each such API fulfills a specific purpose.

    The motivation behind those separate APIs (and the reason to use them!) might be that:
    • Some of them expose the same standard functionality in a better format and with more expressive commands. For example, if you need to fetch the data featured on a "Z Report" (the cashier's end of day report), you may want to take a look at the "Reports API".
    • Or, some of these APIs provide additional features. For example, the "Product Information Management API" lets you extend products with structured dynamic data — "product parameters".
    To explore the available endpoints and their functionality, use Erply API call "getServiceEndpoints". Replace "<accountnumber>" with your actual Erply account number, a three- to six-digit code. This call, contrary to others, does not require authentication:
     
     curl -X POST -d clientCode=<accountnumber> -d request=getServiceEndpoints https://<accountnumber>.erply.com/api/ | jq .
    If you do not have the "jq" tool installed, just omit the vertical bar and everything after that ("| jq .") — you will get a plain, not pretty-printed, JSON response.

    Alternatively, to have a quick look, you can also load it in browser:
     
    https://<accountnumber>.erply.com/api/?request=getServiceEndpoints&sendContentType=1&clientCode=<accountnumber>

    The response may look like as follows:



    If you start building an integration that uses these APIs, your integration MUST follow the same procedure at the beginning of every session:
    1. Call "getServiceEndpoints",
    2. Extract the URL of the relevant service,
    3. Proceed to call that endpoint as appropriate.
    Erply uses many data centers around the world and there are many instances of those services deployed. Therefore, the returned URLs are specific to your account, and furthermore — can change without prior notice!