Store API

For more details about this API usage check our API documentation

Introduction

The store API allows to user managing stores data. Stores can be created, queried or modified.

Preparation

  • Have an authenticated token from the authentication service, this token should be used as an authorization bearer token header for every request done in this API (more information about the authorization service here).

Create a store

Stores can be created by making a POST request to the /stores endpoint. The details of the discount must be specified in the request body. An example request can be seen bellow.

Example request body:

{
"storeId": "9999",
"branchName": "Example branch name",
"address": {
"country": "DE",
"city": "Bielefeld",
"postalcode": "10180",
"street": "Randomplatz",
"houseNumber": "10"
},
"contact": {
"phone": "123 / 9876543"
},
"openHours": {
"WEDNESDAY": {
"open": "09:00",
"close": "19:00"
},
"MONDAY": {
"open": "09:00",
"close": "19:00"
},
"THURSDAY": {
"open": "09:00",
"close": "19:00"
},
"TUESDAY": {
"open": "09:00",
"close": "19:00"
},
"FRIDAY": {
"open": "09:00",
"close": "19:00"
},
"SATURDAY": {
"open": "09:00",
"close": "18:00"
}
},
"distChain": "DE01",
"defaultCurrency": "EUR",
"paymentMethods": [
"SOZIALSCHEIN",
"TELECASH",
"PINPAD",
"CASH"
],
"taxId": "DE 12345678",
"properties": {
"language": "DE",
"priceCorrectionAllowed": false,
"manualPriceLimits": [],
"logoFilename": "Logo_Image.png",
"footerImageFilename": "Footer_Image.png",
"receiptFooterMessage": [
"Umtausch von ungetragener Ware",
"mit Bon innerhalb von 7 Tagen möglich.",
"Reduzierte Ware ist",
"vom Umtausch ausgeschlossen."
]
},
"active": true
}

These are some important attributes to clarify about stores, we are omitting the ones that are self-explanatory:

  • The storeId value represents a store's unique identifier, this value is provided in the request when creating a store.
  • distChain is the distribution chain value the store belongs to.
  • paymentMethods is a list of the available payment methods that can be used in the store.
  • priceCorrecionAllowed is a flag that tells if the price of products can be manually corrected or not by the staff at the stores when processing purchases.
  • language specifies the primary language used in the store, this can used determine the language used in client applications.
  • logoFilename and footerImageFilename determines which image filenames should be used in printed receipts.
  • receiptFooterMessage is a list of strings that contains customizable text shown in printed receipts.
  • active is a flag that determines if a store is currently operating or not.

Example response:

{
"storeId": "9999",
"branchName": "Example branch name",
"address": {
"country": "DE",
"city": "Bielefeld",
"postalcode": "10180",
"street": "Randomplatz",
"houseNumber": "10"
},
"contact": {
"phone": "123 / 9876543"
},
"openHours": {
"WEDNESDAY": {
"open": "09:00",
"close": "19:00"
},
"MONDAY": {
"open": "09:00",
"close": "19:00"
},
"THURSDAY": {
"open": "09:00",
"close": "19:00"
},
"TUESDAY": {
"open": "09:00",
"close": "19:00"
},
"FRIDAY": {
"open": "09:00",
"close": "19:00"
},
"SATURDAY": {
"open": "09:00",
"close": "18:00"
}
},
"distChain": "DE01",
"defaultCurrency": "EUR",
"paymentMethods": [
"SOZIALSCHEIN",
"TELECASH",
"PINPAD",
"CASH"
],
"taxId": "DE 12345678",
"properties": {
"language": "DE",
"priceCorrectionAllowed": false,
"manualPriceLimits": [],
"logoFilename": "Logo_Image.png",
"footerImageFilename": "Footer_Image.png",
"receiptFooterMessage": [
"Umtausch von ungetragener Ware",
"mit Bon innerhalb von 7 Tagen möglich.",
"Reduzierte Ware ist",
"vom Umtausch ausgeschlossen."
]
},
"active": true,
"apiResponseStatus": {
"responseCode": "I04001",
"message": "Created successfully"
}
}

Get store data

Stores can be queried by making a GET request to the /stores/{storeId} endpoint, no request body is required.

Example response:

{
"storeId": "9999",
"branchName": "Example store",
"address": {
"country": "DE",
"city": "Bielefeld",
"postalcode": "10180",
"street": "Randomplatz",
"houseNumber": "10"
},
"contact": {
"phone": "123 / 9876543"
},
"openHours": {
"WEDNESDAY": {
"open": "09:00",
"close": "19:00"
},
"MONDAY": {
"open": "09:00",
"close": "19:00"
},
"THURSDAY": {
"open": "09:00",
"close": "19:00"
},
"TUESDAY": {
"open": "09:00",
"close": "19:00"
},
"FRIDAY": {
"open": "09:00",
"close": "19:00"
},
"SATURDAY": {
"open": "09:00",
"close": "18:00"
}
},
"distChain": "DE01",
"defaultCurrency": "EUR",
"paymentMethods": [
"TELECASH",
"PINPAD",
"CASH"
],
"taxId": "DE 12345678",
"properties": {
"language": "DE",
"priceCorrectionAllowed": false,
"manualPriceLimits": [],
"logoFilename": "Logo_Image.png",
"footerImageFilename": "Footer_Image.png",
"receiptFooterMessage": [
"Umtausch von ungetragener Ware",
"mit Bon innerhalb von 7 Tagen möglich.",
"Reduzierte Ware ist",
"vom Umtausch ausgeschlossen."
]
},
"active": true,
"apiResponseStatus": {
"responseCode": "I04002",
"message": "Retrieved successfully"
}
}

Update a store

To modify a store's data a PATCH request need to be done to the /storess/{storeId} endpoint. Almost every attribute can be modified. As an example we'll update a store opening hours.

Example request body:

{
"openHours": {
"WEDNESDAY": {
"open": "08:00",
"close": "16:00"
},
"MONDAY": {
"open": "08:00",
"close": "18:00"
},
"THURSDAY": {
"open": "08:00",
"close": "18:00"
},
"TUESDAY": {
"open": "08:00",
"close": "18:00"
},
"FRIDAY": {
"open": "08:00",
"close": "18:00"
},
"SATURDAY": {
"open": "08:00",
"close": "18:00"
}
}
}

Example response:

{
"storeId": "9999",
"branchName": "Example store",
"address": {
"country": "DE",
"city": "Bielefeld",
"postalcode": "10180",
"street": "Randomplatz",
"houseNumber": "10"
},
"contact": {
"phone": "123 / 9876543"
},
"openHours": {
"WEDNESDAY": {
"open": "08:00",
"close": "16:00"
},
"MONDAY": {
"open": "08:00",
"close": "18:00"
},
"THURSDAY": {
"open": "08:00",
"close": "18:00"
},
"TUESDAY": {
"open": "08:00",
"close": "18:00"
},
"FRIDAY": {
"open": "08:00",
"close": "18:00"
},
"SATURDAY": {
"open": "08:00",
"close": "18:00"
}
},
"distChain": "DE01",
"defaultCurrency": "EUR",
"paymentMethods": [
"TELECASH",
"PINPAD",
"CASH"
],
"taxId": "DE 12345678",
"properties": {
"language": "DE",
"priceCorrectionAllowed": false,
"manualPriceLimits": [],
"logoFilename": "Logo_Image.png",
"footerImageFilename": "Footer_Image.png",
"receiptFooterMessage": [
"Umtausch von ungetragener Ware",
"mit Bon innerhalb von 7 Tagen möglich.",
"Reduzierte Ware ist",
"vom Umtausch ausgeschlossen."
]
},
"active": true,
"apiResponseStatus": {
"responseCode": "I04003",
"message": "Updated successfully"
}
}