Skip to main content

All Data usage example

This section related to Get Customer All Data, Get Merchant, Get Offer, Get Region, Get Privilege, Get Benefit sections

GET <API base url>/customers/3/all?merchants.include=true&offers.include=true&privileges.include=true&rewards.include=true&regions.include=true&benefits.include=true&language=*

Response would look like this:

{
"value": {
"merchants": optional {
"continuationToken": "MTk4MAo=",
"list":
[
{
"id": 17,
"configUrl": "https://customer.s1mpl.com/api/v4/merchants/17/1/en",
...
// customer level fields
},
...
]
} ,
"offers": optional {
"continuationToken": "NjIwCg==",
"list": [...]
},
"benefits": optional {
"list": [...]
},
"privileges":optional {
"continuationToken": "MjAyMAo=",
"list": [...]
},
"regions": optional {
"list": [...]
},
"rewards" : optional {
"continuationToken": "MTA1MAoK",
"list": [...]
}
}
}

Each property of response contains optional property continuationToken and required property list.

If continuationToken presents means that it is possible to receive more entities of type. To do it should make request and pass it as query parameter for needed entity:

GET <API base url>/customers/3/all?merchants.include=true&merchants.continuationToken=46c2e8899afc4f04 ...

Each list property contains array of objects of specified type. Each object in list is like:

{
"id": 17,
"configUrl": "https://customer.s1mpl.com/api/v4/merchants/17/1/en",
...
// customer level fields
}

Use configUrl to receive entity

note

All configUrl responses are cached

GET https://customer.s1mpl.com/api/v4/merchants/17/1/en

{
"value": {
"id": 17,
"marketName": "Default language market name",
"legalName": "Default language legal name",
"about": "Default language about info",
"phones": "0687224060 default",
"emails": "[email protected] default",
"website": "Default language webite",
"fbLink": "Default language link fb",
"vkLink": "Default language vk link",
"instagramLink": "Default language Instagram link",
"category": "pets",
"buttonText": "Button text default language",
"buttonUrl": "button url default language",
"locations": [
{
"name": "Location 2",
"lat": 21.11750030517578,
"lon": 55.537200927734375,
"phones": "Phone",
"address": "L. Rėzos g., Juodkrantė 93101, Lithuania",
"schedule": "Tue-Sun: 12-9PM"
},
{
"name": "Location 1",
"lat": 24.64974021911621,
"lon": 59.390079498291016,
"phones": "234234234",
"address": "Tähetorni 2, 11625 Tallinn, Estonia",
"schedule": "Tue-Sun: 12-9PM"
}
]
}
}