This section will introduce the methods for being able to create and update stores (both online and physical) on the platform.
curl -XGET -H 'APIKEY: [the_tenant_api_key_string]'
https://[the_tenant_endpoint]/public-api/storeIt can be filtered by any payload fields, such as: name, storeCode, status, address, city, place, longitude, latitude, geographicArea or mobile.
Request examples
The request can be with a single query string or multiple query strings (two or more).
The limit and the offset can be added.
For example:
curl -XPOST -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
{
"name":"prt-downtown-store",
"storeCode": "prt-downtown-store",
"status" :1,
"address":"Av. dos Aliados, 345",
"city":"Porto",
"place":"Street",
"longitude":"48.98383838",
"latitude":"-8.9477839",
"geographicArea":"Portugal",
"mobile":"351-910000000"
}' 'https://[the_tenant_endpoint]/public-api/store'
Fields that are mandatory
Fields that are optional
If everything has gone as expected, the API response will be as follows:
{
"store_id": "107",
"name": "prt-downtown-store",
"address":"Av. dos Aliados, 345",
"city": "Porto",
"geographicArea": "Portugal",
"hash": null,
"latitude": "-8.94778",
"longitude": "48.9838",
"manager": "",
"manager_contact": "",
"mobile": "351-910000000",
"place": "Street",
"schedule": "",
"storeCode": "prt-downtown-store",
"status": "1",
"zipcode": "",
"created_on": "1668623717",
"created_log": "63752D6525D2C375625062",
"updated_on": "0",
"updated_log": "",
"store_type": "physical"
}
To update the store you must send only the fields that the data will change, you do not have to send all the store fields.
For example, if you want to change the address, place and the latitude of the store, the only fields that needed to be sent in the payload are “address”, “place” and the “latitude”.
curl -XPUT -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
{
"address":"Av. dos Aliados, 1345",
"latitude": "-8.83221",
"place": "Street Market",
}' 'https://[the_tenant_endpoint]/public-api/store/107'
If the update has proceeded as expected, we will have the following response from the API:
{
"store_id": "107",
"name": "prt-downtown-store",
"address":"Av. dos Aliados, 1345",
"city": "Porto",
"geographicArea": "Portugal",
"hash": null,
"latitude": "-8.83221",
"longitude": "48.9838",
"manager": "",
"manager_contact": "",
"mobile": "351-910000000",
"place": "Street Market",
"schedule": "",
"storeCode": "prt-downtown-store",
"status": "1",
"zipcode": "",
"created_on": "1668623717",
"created_log": "63752D6525D2C375625062",
"updated_on": "0",
"updated_log": "",
"store_type": "physical"
}
curl -XDELETE -H 'APIKEY: [the_tenant_api_key_string]' -H "Content-type: application/json" -d '
'https://[the_tenant_endpoint]/public-api/store/107'
If the delete has proceeded as expected, we will have the following response from the API:
{
“status”: “deleted”
}