Deleting a business
Contents
- Overview
- Version-specific information
- Permissions and Authentication
- Headers
- HTTP Parameters
- Example response JSON
Overview
- Call name: delete-business
- Endpoint URL: https://api0.spaaza.com/internal/delete-business
- Request methods: DELETE
- Request Content-Type: multipart/form-data or application/x-www-form-urlencoded or application/json
- Response Content-Type: application/json
- Auth required: yes
In Spaaza terminology, a “business” is a branch of a retailer (a “chain”). This API call deletes a business.
Version-specific information
The following version-specific changes apply to this endpoint. See the versioning page for more details.
Version | Change details |
---|---|
N/A | N/A |
Permissions and Authentication
This API call requires a valid Spaaza session. See the authentication page for more details. The session can be as follows:
- Admin authentication: The performing user needs to be logged in and have
delete access
to the chain to which the user is connected.
Headers
Standard headers are used for this endpoint. No special headers are required.
HTTP Parameters
The following HTTP parameters can be passed to the API:
Parameter | Description |
---|---|
business_id | (integer, mandatory) The ID of the business to delete |
Possible error responses
Code | Name | Description | HTTP Status |
---|---|---|---|
3 | http_vars_missing | Required parameter business_id is missing | 400 |
6 | no_valid_session | No valid session key provided or session has expired | 401 |
13 | http_request_method_non_DELETE_not_allowed | Only HTTP DELETE allowed for this API call | 405 |
15 | business_id_invalid | The business_id passed must be an integer | 400 |
68 | permission_denied_or_non_existent | User has insufficient permissions or the referenced business does not exist | 403 |
144 | business_id_not_found | No record has been found for that business_id | 404 |
441 | parameter_missing | A required parameter is missing | 400 |
Example response JSON
The endpoint returns JSON showing the details associated with the business. An example response is shown below:
{
"result": {
"code": 1,
"status": "ok"
},
"results": {
"business": {
"address_1": "Herengracht 504",
"address_2": null,
"address_3": null,
"business_format": "Metro",
"chain_id": 1743,
"created_date":"2024-04-03T12:43:54+00:00",
"countrycode": "NL",
"deleted": true,
"deleted_by": {
"name": "Admin Acme",
"user_id": 213112
},
"email_address": "ops@spaaza.com",
"format": "Metro",
"google_place_id": "ChIJMaAAt6KjMRkRwxomyCkN71w",
"id": 1383,
"image_url": "https://media.licdn.com/dms/image/C4D0BAQEN6wx-nP_Crg/company-logo_400_400/0?e=1578528000&v=beta&t=1qKTWg0qbIJMydHHG02YPhD8N4LONyW5Rp06wn5DvN0",
"is_shut_down": true,
"last_modified_date":"2024-04-03T12:43:54+00:00",
"latitude": "52.37021570",
"longitude": "1.89516789",
"name": "ACME Inc",
"opening_times": "{\"monday\": {\"open\": \"11:00\",\"close\": \"18:00\" }, \"tuesday\": { \"open\": \"09:30\", \"close\": \"18:00\" }, \"wednesday\": { \"open\": \"09:30\", \"close\": \"18:00\" }, \"thursday\": { \"open\": \"09:30\", \"close\": \"18:00\" }, \"friday\": { \"open\": \"09:30\", \"close\": \"21:00\" }, \"saturday\": { \"open\": \"09:30\", \"close\": \"17:00\" }, \"sunday\": { \"open\": \"Elke laatste zondag van de maand\", \"close\": \"12:00-17:00\" }, \"special_hours\": [ { \"date\": \"23\/02\/2020\", \"open\": \"12:00\", \"close\": \"17:00\", \"reason\": \"Laatste zondag van de maand\" }, { \"date\": \"23\/02\/2020\", \"open\": \"-\", \"close\": \"-\", \"reason\": \"Carnaval\" } ] }",
"owner_code": null,
"phone_number": "0124141",
"postalcode": "1017 CB",
"programme_opted_in": true,
"region": "Noord Holland",
"towncity": "Amsterdam",
"review_url" : "https://g.page/spaaza/review",
"type": "business",
"website_url": "https://www.spaaza.com"
},
"result_type": "delete-business"
}
}