Get shop and merchant information

In this tutorial we will guide you through working with two more endpoints:/shops/{id} and /merchants/{id}.

Prerequisites to this guide are one or more of the following:

In these guides you learned how to get shop.uid or handle, that are essential starting points for this tutorial.

Getting information about the shop

By now, you should have all the information needed to get the information about the shop.
For that, use the endpoint /shops/{id} where idstands for either handle or shop.uid from the response. However, shop.uid is more appropriate for this usage since it generates less requests.

Your query to get shop information should look like this:

/v6/shops/A987AKnMPJ0CR9PZo1Jy5A

For which the response will be this:

{
    "uid": "A987AKnMPJ0CR9PZo1Jy5A",
    "type": "bricks",
    "tags": [
        "Hyper-Supermarket"
    ],
    "merchantUid": "538VqZ4gn33tVJJWEYa8d3@gb",
    "category": {
        "name": "Groceries",
        "logo": "https://s3.eu-central-1.amazonaws.com/files.node-prod.dateio.cz/category/vw4k5PnQBYNFYeL5iJNtVy/l"
    },
    "location": {
        "address": {
            "street": "Eastcheap 6",
            "city": "London",
            "zip": "EC3M 1AE",
            "country": "GB"
            "areas": {
                "20": "England"
            }
        },  
        "coordinates": {
            "type": "rooftop",
            "lat": 51.5106004,
            "long": -0.0849892
        }
    },
    "url": "https://www.tesco.com",
    "googlePlaceId": "ChIJJVHlMlIDdkgRWLgmapTxxdo"
}

Now you should have successfully gathered some information about the shop. Congratulations!

As you can see, you now know where the shop is located through the GPS coordinates, its address, whether it is an online or physical store, its URL, Google Place ID, the main category of business where the merchant operates, tags that provide additional information and merchant.uid.

merchant.uid is particularly important for the last step and that is gathering information about the merchant. Do not confuse it with merchantId - the input parameter from card transaction endpoints.

Get information about the merchant

For this step, use the GET endpoint /merchants/{id} where the {id} represents themerchantUid you got from the response from /shops/{id} in the previous step.

Your query to get merchant information should look like this:

/v6/merchants/538VqZ4gn33tVJJWEYa8d3@gb

For which the response will be this:

{
    "uid": "538VqZ4gn33tVJJWEYa8d3@gb",
    "name": "Tesco",
    "logo": "https://s3.eu-central-1.amazonaws.com/files.node-prod.dateio.cz/m/538VqZ4gn33tVJJWEYa8d3/l"
}

The response has provided you with the full merchant name and their logo in high resolution.

And that is it! By now you should have integrated all Tapix APIs necessary for enrichment of transaction data.

Data retention

Responses of both endpoints /merchants/{id} and /shops/{id} should be stored for further usage so you only need to call these endpoints if:

  • you do not have the information about the shop.uid or merchant.uid in your database yet
  • your cache has expired - in the case where you have not implement invalidations and you use automatic cache expiration
  • you implemented invalidations and there is shallow invalidation related to that shop.uid (handle) or merchant.uid (to learn more on this topic head to Data update mechanism tutorial)

Where to head next

You can learn more about integrating invalidations which serve to keep your data up-to-date. You can also integrate suggestions so you or your users can report any data discrepancies.