Billhighway Cloud API

<back to all web services

Company

The following routes are available for this service:
POST/company
import 'package:servicestack/servicestack.dart';

class Company implements IConvertible
{
    String? UniqueId;
    DateTime? CreatedDateTime;
    int? ClientId;
    String? GroupId;
    int? CompanyId;
    String? ExternalCompanyId;
    String? CompanyName;
    String? Address1;
    String? Address2;
    String? City;
    String? State;
    String? ZipCode;
    String? Country;
    String? Website;
    String? PhoneNumber;
    String? Fax;
    int? StateId;
    int? CountryId;
    int? ChapId;

    Company({this.UniqueId,this.CreatedDateTime,this.ClientId,this.GroupId,this.CompanyId,this.ExternalCompanyId,this.CompanyName,this.Address1,this.Address2,this.City,this.State,this.ZipCode,this.Country,this.Website,this.PhoneNumber,this.Fax,this.StateId,this.CountryId,this.ChapId});
    Company.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        UniqueId = json['UniqueId'];
        CreatedDateTime = JsonConverters.fromJson(json['CreatedDateTime'],'DateTime',context!);
        ClientId = json['ClientId'];
        GroupId = json['GroupId'];
        CompanyId = json['CompanyId'];
        ExternalCompanyId = json['ExternalCompanyId'];
        CompanyName = json['CompanyName'];
        Address1 = json['Address1'];
        Address2 = json['Address2'];
        City = json['City'];
        State = json['State'];
        ZipCode = json['ZipCode'];
        Country = json['Country'];
        Website = json['Website'];
        PhoneNumber = json['PhoneNumber'];
        Fax = json['Fax'];
        StateId = json['StateId'];
        CountryId = json['CountryId'];
        ChapId = json['ChapId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'UniqueId': UniqueId,
        'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
        'ClientId': ClientId,
        'GroupId': GroupId,
        'CompanyId': CompanyId,
        'ExternalCompanyId': ExternalCompanyId,
        'CompanyName': CompanyName,
        'Address1': Address1,
        'Address2': Address2,
        'City': City,
        'State': State,
        'ZipCode': ZipCode,
        'Country': Country,
        'Website': Website,
        'PhoneNumber': PhoneNumber,
        'Fax': Fax,
        'StateId': StateId,
        'CountryId': CountryId,
        'ChapId': ChapId
    };

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

class ReplyBase implements IHaveErrorField, IConvertible
{
    int? ErrorCode;
    String? ErrorMessage;
    bool? IsError;

    ReplyBase({this.ErrorCode,this.ErrorMessage,this.IsError});
    ReplyBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ErrorCode = json['ErrorCode'];
        ErrorMessage = json['ErrorMessage'];
        IsError = json['IsError'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ErrorCode': ErrorCode,
        'ErrorMessage': ErrorMessage,
        'IsError': IsError
    };

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

class CompanyReply extends ReplyBase implements IConvertible
{
    String? UniqueId;
    int? CompanyId;

    CompanyReply({this.UniqueId,this.CompanyId});
    CompanyReply.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        UniqueId = json['UniqueId'];
        CompanyId = json['CompanyId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'UniqueId': UniqueId,
        'CompanyId': CompanyId
    });

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

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'Company': TypeInfo(TypeOf.Class, create:() => Company()),
    'ReplyBase': TypeInfo(TypeOf.Class, create:() => ReplyBase()),
    'CompanyReply': TypeInfo(TypeOf.Class, create:() => CompanyReply()),
});

Dart Company 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 /company HTTP/1.1 
Host: devapi.billhighway.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<Company xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
  <Address1>String</Address1>
  <Address2>String</Address2>
  <ChapId>0</ChapId>
  <City>String</City>
  <ClientId>0</ClientId>
  <CompanyId>0</CompanyId>
  <CompanyName>String</CompanyName>
  <Country>String</Country>
  <CountryId>0</CountryId>
  <CreatedDateTime>0001-01-01T00:00:00</CreatedDateTime>
  <ExternalCompanyId>String</ExternalCompanyId>
  <Fax>String</Fax>
  <GroupId>String</GroupId>
  <PhoneNumber>String</PhoneNumber>
  <State>String</State>
  <StateId>0</StateId>
  <UniqueId>String</UniqueId>
  <Website>String</Website>
  <ZipCode>String</ZipCode>
</Company>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CompanyReply xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
  <ErrorCode xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">0</ErrorCode>
  <ErrorMessage xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">String</ErrorMessage>
  <CompanyId>0</CompanyId>
  <UniqueId>String</UniqueId>
</CompanyReply>