Meditroc/Farmadeals API - Stock Query

Meditroc and Farmadeals allow users to look for missing products. E-mails are sent to other members to notify them of new product searches.

The protocol described below allows us to optimize the delivery procedure, by contacting only pharmacies that have the product in their inventory. This is a webservice that allows you to know which products are being looked for, and to let us know which pharmacy has a searched product in its inventory and which one does not.

If you wish to integrate this protocol, please contact us.

Technical Specifications

Introduction

This webservice requires an access key. If you have not received one, please contact us so that we can provide one. This key is sent in POST payloads.

Every request data is encoded in JSON.

Retrieve search CNKs

In order to retreive the search products, you must interrogate the following URL with a POST request:

https://api.meditroc.be/v1/service/stockquery/query

The payload has to be a JSON map, containing the following keys:

For example :

{
    "apikey": "1337",
    "apb": 999999
}

This method will return stock requests that the pharmacy has to fulfill.

The returned HTTP codes are the following.

HTTP Code Description Example
200 Requests in progress have been retrieved, the searched product list is returned. The cnk key will contain product CNKs that have to be looked into the inventory.
{
    "cnk": [1, 2, 3]
}
401 The APB number is invalid.
500 An error occured, the description is in the response's body.

Request Number Limitation

By default, every searched product without an answer is returned.

If you wish to limit the number of products to look into the inventory, you can add the query parameter maxQueries.

For example:

https://api.meditroc.be/v1/service/stockquery/query?maxQueries=15

Response to Inventory Requests

In order to send an answer to searched products, you must interrogate the following URL with a POST request:

https://api.meditroc.be/v1/service/stockquery/stock

The payload has to be a JSON map, containing the following keys:

For example:

{
    "apikey": "1337",
    "apb": 999999,
    "cnks" : {
        "1": true,
        "2": true,
        "3": false
    }
}

The returned HTTP codes are the following.

HTTP Code Description
200 The inventory has been sent. No returned value is provided.
401 The APB number is invalid.
500 An error occured, the description is in the response's body. For example, you might have forgotten the "cnks" key in the payload.

Test interface

You can test your developments using our test API.

Changelog