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 IDGET /resources/business?{identifier parameter}={value}- Retrieve a single business (by identifier parameter)POST /resources/business- Create a new resourcePATCH /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:
| Name | Description | Standard Attributes(details) | Spaaza Vendor Attributes(details) |
|---|---|---|---|
address_1 | Store address line 1 | type: string nullable: true maxLength: 255 | recursionLevel: 2 |
address_2 | Store address line 2 | type: string nullable: true minLength: 1 maxLength: 255 | recursionLevel: 2 |
address_3 | Store address line 3 | type: string nullable: true maxLength: 255 | recursionLevel: 2 |
chain | Chain to which the store belongs | type: object nullable: false required: [“id”] | recursionLevel: 1 filter-property: true immutable: true |
chain_member | Whether this business is a chain member | type: boolean nullable: false default: true | recursionLevel: 4 operations: [“post”, “put”, “patch”] |
country_code | Store address ISO 3166-1 alpha-2 2-letter country code | type: string nullable: true pattern: “^[A-Z]{2}$” minLength: 2 maxLength: 2 example: “NL” | recursionLevel: 2 filter-property: true |
id | Business identifier | type: integer readOnly: true nullable: false | recursionLevel: 0 filter-property: true operations: [“get”, “put”, “patch”, “delete”] |
latitude | Store latitude | type: float nullable: true minimum: -90 maximum: 90 | recursionLevel: 2 |
longitude | Store longitude | type: float nullable: true minimum: -180 maximum: 180 | recursionLevel: 2 |
name | Store name | type: string nullable: false minLength: 1 maxLength: 255 | recursionLevel: 1 filter-property: true required-in: [“post”] operations: [“post”, “put”, “patch”] |
owner_code | Store owner code | type: string nullable: true maxLength: 64 | recursionLevel: 1 identifier: true filter-property: true operations: [“get”, “post”, “put”, “patch”, “delete”] required-in: [“post”] |
phone_number | Store phone number | type: string nullable: true maxLength: 32 | recursionLevel: 2 |
postalcode | Store address postal code | type: string nullable: true maxLength: 20 | recursionLevel: 2 |
region | Store address region | type: string nullable: true maxLength: 255 | recursionLevel: 2 filter-property: true |
towncity | Store address town or city name | type: string nullable: true maxLength: 255 | recursionLevel: 2 filter-property: true |
Property Notes
- Chain Reference: The
chainproperty 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_codeproperty can be used as an alternative identifier to the numericidfor retrieving, updating, or deleting businesses. Properties marked withidentifier: truecan be used as identifier parameters for single resource operations. - Filter Properties: Properties marked with
filter-property: truecan be used to filter results when retrieving multiple businesses. - Recursion Levels: The
recursionLevelattribute 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
operationsattribute 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.