Skip to main content

Business Resource

The Business resource represents a physical store that belongs to a chain in the Spaaza platform. Each business has properties for location information, contact details, and operational settings.

Contents

Introduction

A Business in Spaaza represents a physical store location that is part of a retailer's chain. The Business resource provides comprehensive information about store details including:

  • Basic information (name, contact details)
  • Location and address information
  • Geographic coordinates
  • Operational settings and preferences
  • Chain association and ownership details

The Business resource supports all standard REST operations and can be identified by either its numeric ID or a unique owner code within a chain.

Available Paths

The Business resource supports the following API paths:

Single Resource Operations

  • GET /resources/business/{id} - Retrieve a single business by ID
  • GET /resources/business?{identifier parameter}={value} - Retrieve a single business (by identifier parameter)
  • POST /resources/business - Create a new resource
  • PATCH /resources/business?{identifier parameter}={value} - Update an existing business (by identifier parameter)
  • PATCH /resources/business/{id} - Update an existing business (by ID)
  • PUT /resources/business?{identifier parameter}={value} - Update an existing business (by identifier parameter)
  • PUT /resources/business/{id} - Update an existing business (by ID)
  • DELETE /resources/business?{identifier parameter}={value} - Delete a business (by identifier parameter)
  • DELETE /resources/business/{id} - Delete a business (by ID)

Note: For single business retrieval by identifier parameter, you can use any property marked with identifier: true in the "Spaaza Vendor Attributes" column in the Properties table below.

Multiple Resource Operations

  • GET /resources/businesses - Retrieve a list of businesses with optional filtering and pagination

Properties

The Business resource includes the following properties, listed alphabetically:

NameDescriptionStandard Attributes(details)Spaaza Vendor Attributes(details)
address_1Store address line 1type: string
nullable: true
maxLength: 255
recursionLevel: 2
address_2Store address line 2type: string
nullable: true
minLength: 1
maxLength: 255
recursionLevel: 2
address_3Store address line 3type: string
nullable: true
maxLength: 255
recursionLevel: 2
business_distance_kmDistance in kilometres from the search coordinates when using location search. Only present when location search is used.type: number
format: float
nullable: true
readOnly: true
recursionLevel: 1
chainChain to which the store belongstype: object
nullable: false
required: ["id"]
recursionLevel: 1
filter-property: true
immutable: true
chain_memberWhether this business is a chain membertype: boolean
nullable: false
default: true
recursionLevel: 4
operations: ["post", "put", "patch"]
country_codeStore address ISO 3166-1 alpha-2 2-letter country codetype: string
nullable: true
pattern: "^[A-Z]{2}$"
minLength: 2
maxLength: 2
example: "NL"
recursionLevel: 2
filter-property: true
idBusiness identifiertype: integer
readOnly: true
nullable: false
recursionLevel: 0
filter-property: true
operations: ["get", "put", "patch", "delete"]
is_shut_downWhether the business is administratively shut downtype: boolean
nullable: false
default: false
recursionLevel: 2
filter-property: true
latitudeStore latitudetype: float
nullable: true
minimum: -90
maximum: 90
recursionLevel: 2
longitudeStore longitudetype: float
nullable: true
minimum: -180
maximum: 180
recursionLevel: 2
nameStore nametype: string
nullable: false
minLength: 1
maxLength: 255
recursionLevel: 1
filter-property: true
fulltext-search: true
required-in: ["post"]
operations: ["post", "put", "patch"]
owner_codeStore owner codetype: string
nullable: true
maxLength: 64
recursionLevel: 1
identifier: true
filter-property: true
fulltext-search: true
operations: ["get", "post", "put", "patch", "delete"]
required-in: ["post"]
phone_numberStore phone numbertype: string
nullable: true
maxLength: 32
recursionLevel: 2
postalcodeStore address postal codetype: string
nullable: true
maxLength: 20
recursionLevel: 2
regionStore address regiontype: string
nullable: true
maxLength: 255
recursionLevel: 2
filter-property: true
towncityStore address town or city nametype: string
nullable: true
maxLength: 255
recursionLevel: 2
filter-property: true

Property Notes

  • Chain Reference: The chain property refers to the Chain resource. For complete documentation of Chain properties, consult the Chain resource documentation (links will be added when available).
  • Identifier Properties: The owner_code property can be used as an alternative identifier to the numeric id for retrieving, updating, or deleting businesses. Properties marked with identifier: true can be used as identifier parameters for single resource operations.
  • Filter Properties: Properties marked with filter-property: true can be used to filter results when retrieving multiple businesses.
  • Text Search Properties: The name and owner_code properties support text search with partial matching. Use search[name]=value or search[owner_code]=value to filter by a specific property, or use search[*]=value to apply the search term across all text-search-enabled properties. See Text Search for details.
  • Location Search: The Business resource supports geospatial filtering using the location[latitude], location[longitude], and optional location[radius_km] parameters. When location search is used, results are ordered by distance and include the business_distance_km field. See Location Search for details.
  • Recursion Levels: The recursionLevel attribute controls at which API response detail levels each property is included.
  • Required Fields: Properties marked with required-in: ["post"] are required when creating new businesses.
  • Operations: The operations attribute indicates which HTTP methods can use each property as a parameter.

Sample Business JSON

Here is an example of a Business resource as returned by the API:

{
"address_1": "Damrak 123",
"address_2": "Unit 4B",
"address_3": null,
"chain": {
"id": 1743,
"name": "Example Retail Chain"
},
"chain_member": true,
"country_code": "NL",
"id": 12345,
"latitude": 52.3713,
"longitude": 4.8910,
"name": "Amsterdam Central Store",
"owner_code": "AMS001",
"phone_number": "+31 20 123 4567",
"postalcode": "1012 LP",
"region": "North Holland",
"towncity": "Amsterdam"
}

This example shows a typical Business resource with location information, chain association, and operational settings.