The Vitau API is organized around REST. Our API receives and returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

To authenticate the client each request must provide its personal API KEY. Clients are trusted to safeguard the key.

Fetching resources

curl --request GET \\
  --url API_URL/api/some-route \\
  --header 'Accept: application/json' \\
  --header 'X-API-Key: {Client API Key}'
NameValue typeDescriptionExample
pageintA page number within the paginated result set.?page=1
limitintNumber of results to return per page.?limit=10
searchstringReturns all objects that contain the string in the specified lookup fields?search=advil
orderingstringField name to order the results. Prefix the value with ’-’ to reverse results.?ordering=-created_at
field-namestringFilter results against the specified value.?ean_key=0123456

Paginated response structure:

In each paginated request, there is a “next” and “previous” field which specifies the url to request next (it contains the next or previous page number).

Status Code: 200 OK
{
"count": INT, // Number of total resources. Useful to show the number of pages.
"next": "API_URL/?page={int}", // URL of next page of results
"previous": "API_URL/?page={int}", // URL of previous page of results
"results": [...] // Array of result set
}

Without pagination the response only contains the array of results.

Building Vitau’s cart URL

Since there is no API interaction needed this is the simplest and quickest way to enable your customers to purchase the products they need!

The pre-made cart is a feature we use at Vitau and several commercial alliances use to direct a patient directly to the checkout of the products they use.

The base url is the following https://vitau.mx/carrito Sending the following query params:

  • productos: EANs of the products inside the cart, separated by commas
  • cantidades: numbers separated by commas, indicating the amount of each product you wish to have in your cart, following the same order of productos.

Example:

https://vitau.mx/carrito?productos=123456,78910&cantidades=1,2

For a more advanced integration where you might want to query the available products and prices from the API read the following guide Public routes