Link Search Menu Expand Document

Altering a business

Contents

Overview

  • Call name: alter-business
  • Endpoint URL: https://api0.spaaza.com/internal/alter-business
  • Request methods: PUT
  • 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 updates an existing business.

Note it is also possible to update an existing business by passing the update_if_exists parameter to the add-business endpoint.

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 write access to the chain to which the user is connected.

Headers

The following headers can/must be passed to the API call:

Parameter Description
N/A N/A

HTTP Parameters

The following HTTP parameters can be passed to the API:

Parameter Description
business_id (integer, mandatory) The ID of the business whose details are to be altered. This parameter can be used to identify the business.
address_1 (string, optional, max 255 chars) The first line of the business address.
address_2 (string, optional, max 255 chars) The second line of the business address.
address_3 (string, optional, max 255 chars) The third line of the business address.
countrycode (string, optional, max 2 chars) The ISO ALPHA-2 2-letter country code of the business.
format (string, optional, max 64 chars) This is used to set the business_format of a business.
google_place_id (string, optional, max 1024 chars) The google_place_id of the store/business.
image_url (string, optional, max 512 chars) The url link to the businesses image/logo.
is_shut_down (boolean, optional) Whether the business is administratively shut down true/false.
latitude (float) The latitude of the business in decimal degrees.
longitude (float) The longitude of the business in decimal degrees.
name (string, mandatory, max 255 chars) The name of the business.
opening_times (string, optional, max 2048 chars) The opening times of the business in escaped JSON format. Contact Spaaza for more details.
owner_code (string, optional, max 64 chars) The retailer owner_code for the store. This value will also be used as the branch_business_owner_code in add-basket and get-basket-price requests.
postalcode (string, optional, max 20 chars) The postalcode of the business.
region (string, optional, max 255 chars) The region or country of the business.
review_url (string, optional, max 255 chars) The url link to the review business page.
towncity (string, optional, max 255 chars) The postal city of the business.

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,
            "chain_id": 1743,
            "countrycode": "NL",
            "created_date": "2024-04-01T11:21:14+00:00",
            "email_address": "ops@spaaza.com",
            "id": 1383,
            "image_url": "https://media.licdn.com/dms/image/C4D0BAQEN6wx-nP_Crg/company-logo_400_400/0?e=1578528000&v=beta&t=1qKTWg0qbIJMydHHG02YPhD8N4LONyW5Rp06wn5DvN0",
            "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": "10001",
            "postalcode": "1017 CB",
            "region": "Noord Holland",
            "review_url": "https://g.page/spaaza/review",
            "towncity": "Amsterdam",
            "type": "business",
            "website_url": "https://www.spaaza.com"
        },
        "result_type": "alter-business"
    }
}