BackofficeApi

<back to all web services

PlaceAddRequest

Backoffice
Requires Authentication
Required role:Backoffice
The following routes are available for this service:
POST/place/add

library BackofficeApi;
import 'package:servicestack/servicestack.dart';

class PlaceAddress implements IConvertible
{
    String? street;
    String? postalCode;
    String? region;
    String? countryCode;

    PlaceAddress({this.street,this.postalCode,this.region,this.countryCode});
    PlaceAddress.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        street = json['street'];
        postalCode = json['postalCode'];
        region = json['region'];
        countryCode = json['countryCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'street': street,
        'postalCode': postalCode,
        'region': region,
        'countryCode': countryCode
    };

    getTypeName() => "PlaceAddress";
    TypeContext? context = _ctx;
}

enum PlaceState
{
    Draft,
    Active,
    Paused,
    Archived,
}

class TimeZoneDto implements IConvertible
{
    Duration? baseUtcOffset;
    String? daylightName;
    String? displayName;
    String? id;
    String? standardName;
    bool? supportsDaylightSavingTime;

    TimeZoneDto({this.baseUtcOffset,this.daylightName,this.displayName,this.id,this.standardName,this.supportsDaylightSavingTime});
    TimeZoneDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        baseUtcOffset = JsonConverters.fromJson(json['baseUtcOffset'],'Duration',context!);
        daylightName = json['daylightName'];
        displayName = json['displayName'];
        id = json['id'];
        standardName = json['standardName'];
        supportsDaylightSavingTime = json['supportsDaylightSavingTime'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'baseUtcOffset': JsonConverters.toJson(baseUtcOffset,'Duration',context!),
        'daylightName': daylightName,
        'displayName': displayName,
        'id': id,
        'standardName': standardName,
        'supportsDaylightSavingTime': supportsDaylightSavingTime
    };

    getTypeName() => "TimeZoneDto";
    TypeContext? context = _ctx;
}

class PlaceContact implements IConvertible
{
    String? phone;
    String? email;
    String? website;
    String? webShop;

    PlaceContact({this.phone,this.email,this.website,this.webShop});
    PlaceContact.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        phone = json['phone'];
        email = json['email'];
        website = json['website'];
        webShop = json['webShop'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'phone': phone,
        'email': email,
        'website': website,
        'webShop': webShop
    };

    getTypeName() => "PlaceContact";
    TypeContext? context = _ctx;
}

enum BusinessRole
{
    Owner,
    Manager,
    Sales,
    Marketing,
    Other,
}

TypeContext _ctx = TypeContext(library: 'BackofficeApi', types: <String, TypeInfo> {
    'PlaceAddress': TypeInfo(TypeOf.Class, create:() => PlaceAddress()),
    'PlaceState': TypeInfo(TypeOf.Enum, enumValues:PlaceState.values),
    'TimeZoneDto': TypeInfo(TypeOf.Class, create:() => TimeZoneDto()),
    'PlaceContact': TypeInfo(TypeOf.Class, create:() => PlaceContact()),
    'BusinessRole': TypeInfo(TypeOf.Enum, enumValues:BusinessRole.values),
});

Dart PlaceAddRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<PlaceAddRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BackofficeApi.Dto">
  <Address xmlns:d2p1="http://schemas.datacontract.org/2004/07/Entities.Common">
    <d2p1:CountryCode>String</d2p1:CountryCode>
    <d2p1:PostalCode>String</d2p1:PostalCode>
    <d2p1:Region>String</d2p1:Region>
    <d2p1:Street>String</d2p1:Street>
  </Address>
  <BusinessId>0</BusinessId>
  <Name>String</Name>
  <OrganizationNumber>String</OrganizationNumber>
  <RootCategoryAbsoluteSlug>String</RootCategoryAbsoluteSlug>
</PlaceAddRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PlaceAddResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BackofficeApi.Dto">
  <Place>
    <Address xmlns:d3p1="http://schemas.datacontract.org/2004/07/Entities.Common">
      <d3p1:CountryCode>String</d3p1:CountryCode>
      <d3p1:PostalCode>String</d3p1:PostalCode>
      <d3p1:Region>String</d3p1:Region>
      <d3p1:Street>String</d3p1:Street>
    </Address>
    <BackofficeGrantedStaffAccess>
      <StaffDto>
        <BusinessId>0</BusinessId>
        <BusinessName>String</BusinessName>
        <BusinessRole>Owner</BusinessRole>
        <Email>String</Email>
        <FirstName>String</FirstName>
        <Id>0</Id>
        <LastActiveOn xmlns:d5p1="http://schemas.datacontract.org/2004/07/System">
          <d5p1:DateTime>0001-01-01T00:00:00Z</d5p1:DateTime>
          <d5p1:OffsetMinutes>0</d5p1:OffsetMinutes>
        </LastActiveOn>
        <LastName>String</LastName>
        <MobileNumber>String</MobileNumber>
        <PlaceId>0</PlaceId>
        <PlaceName>String</PlaceName>
        <Role>Owner</Role>
        <UserId>0</UserId>
      </StaffDto>
    </BackofficeGrantedStaffAccess>
    <BusinessId>0</BusinessId>
    <Claimed>false</Claimed>
    <Contact xmlns:d3p1="http://schemas.datacontract.org/2004/07/Entities.Common">
      <d3p1:Email>String</d3p1:Email>
      <d3p1:Phone>String</d3p1:Phone>
      <d3p1:WebShop>String</d3p1:WebShop>
      <d3p1:Website>String</d3p1:Website>
    </Contact>
    <CountryCode>String</CountryCode>
    <Guid>00000000-0000-0000-0000-000000000000</Guid>
    <Id>0</Id>
    <Latitude>0</Latitude>
    <Longitude>0</Longitude>
    <Name>String</Name>
    <OrganizationNumber>String</OrganizationNumber>
    <Overview>String</Overview>
    <RootCategory>
      <AbsoluteSlug>String</AbsoluteSlug>
      <Id>0</Id>
      <Name>String</Name>
      <ParentId>0</ParentId>
      <Position>0</Position>
      <Slug>String</Slug>
      <State>String</State>
    </RootCategory>
    <State>Draft</State>
    <TimeZoneDto xmlns:d3p1="http://schemas.datacontract.org/2004/07/Entities.Common">
      <d3p1:BaseUtcOffset>PT0S</d3p1:BaseUtcOffset>
      <d3p1:DaylightName>String</d3p1:DaylightName>
      <d3p1:DisplayName>String</d3p1:DisplayName>
      <d3p1:Id>String</d3p1:Id>
      <d3p1:StandardName>String</d3p1:StandardName>
      <d3p1:SupportsDaylightSavingTime>false</d3p1:SupportsDaylightSavingTime>
    </TimeZoneDto>
  </Place>
</PlaceAddResponse>