| Required role: | Backoffice |
| POST | /place/add |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
# module BackofficeApi
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PlaceAddress:
street: Optional[str] = None
postal_code: Optional[str] = None
region: Optional[str] = None
country_code: Optional[str] = None
class PlaceState(str, Enum):
DRAFT = 'Draft'
ACTIVE = 'Active'
PAUSED = 'Paused'
ARCHIVED = 'Archived'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TimeZoneDto:
base_utc_offset: datetime.timedelta = datetime.timedelta()
daylight_name: Optional[str] = None
display_name: Optional[str] = None
id: Optional[str] = None
standard_name: Optional[str] = None
supports_daylight_saving_time: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PlaceContact:
phone: Optional[str] = None
email: Optional[str] = None
website: Optional[str] = None
web_shop: Optional[str] = None
class BusinessRole(str, Enum):
OWNER = 'Owner'
MANAGER = 'Manager'
SALES = 'Sales'
MARKETING = 'Marketing'
OTHER = 'Other'
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /place/add HTTP/1.1
Host: backoffice-api.brovs.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
name: String,
organizationNumber: String,
businessId: 0,
address:
{
street: String,
postalCode: String,
region: String,
countryCode: String
},
rootCategoryAbsoluteSlug: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
place:
{
id: 0,
name: String,
longitude: 0,
latitude: 0,
rootCategory:
{
id: 0,
name: String,
slug: String,
absoluteSlug: String,
parentId: 0,
state: String,
position: 0
},
claimed: False,
organizationNumber: String,
state: Draft,
countryCode: String,
overview: String,
timeZoneDto:
{
baseUtcOffset: PT0S,
daylightName: String,
displayName: String,
id: String,
standardName: String,
supportsDaylightSavingTime: False
},
businessId: 0,
contact:
{
phone: String,
email: String,
website: String,
webShop: String
},
address:
{
street: String,
postalCode: String,
region: String,
countryCode: String
},
backofficeGrantedStaffAccess:
[
{
id: 0,
firstName: String,
lastName: String,
email: String,
role: Owner,
placeId: 0,
businessId: 0,
userId: 0,
placeName: String,
businessName: String,
mobileNumber: String,
businessRole: Owner,
lastActiveOn: 0001-01-01T00:00:00.0000000+00:00
}
]
}
}