BokaMera.API.Host

<back to all web services

UpdateBillingInformation

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/billing/company/Update billing information.Update billing information.
import 'package:servicestack/servicestack.dart';

class BaseModel implements IConvertible
{
    BaseModel();
    BaseModel.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "BaseModel";
    TypeContext? context = _ctx;
}

class BillingMethodCountriesRelation extends BaseModel implements IConvertible
{
    // @Required()
    int? BillingMethodId;

    // @Required()
    String? CountryId;

    DateTime? ModifiedDate;

    BillingMethodCountriesRelation({this.BillingMethodId,this.CountryId,this.ModifiedDate});
    BillingMethodCountriesRelation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        BillingMethodId = json['BillingMethodId'];
        CountryId = json['CountryId'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'BillingMethodId': BillingMethodId,
        'CountryId': CountryId,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

class BillingMethod extends BaseModel implements IConvertible
{
    List<BillingMethodCountriesRelation>? BillingMethodCountriesRelation;
    // @Required()
    String? Name;

    // @Required()
    String? Description;

    DateTime? ModifiedDate;
    int? Id;

    BillingMethod({this.BillingMethodCountriesRelation,this.Name,this.Description,this.ModifiedDate,this.Id});
    BillingMethod.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        BillingMethodCountriesRelation = JsonConverters.fromJson(json['BillingMethodCountriesRelation'],'List<BillingMethodCountriesRelation>',context!);
        Name = json['Name'];
        Description = json['Description'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        Id = json['Id'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'BillingMethodCountriesRelation': JsonConverters.toJson(BillingMethodCountriesRelation,'List<BillingMethodCountriesRelation>',context!),
        'Name': Name,
        'Description': Description,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'Id': Id
    });

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

class BillingInformationResponse implements IConvertible
{
    /**
    * The company id.
    */
    // @ApiMember(Description="The company id.")
    String? CompanyId;

    /**
    * The prefered billing method.
    */
    // @ApiMember(Description="The prefered billing method.", IsRequired=true)
    int? BillingMethodId;

    /**
    * The name that should be printed on the billing information, normally this would be your company name.
    */
    // @ApiMember(Description="The name that should be printed on the billing information, normally this would be your company name.")
    String? Name;

    /**
    * If you want to add the attention to the billing address.
    */
    // @ApiMember(Description="If you want to add the attention to the billing address.")
    String? Attention;

    /**
    * The street for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The street for the billing adress. This is required when having postal invoice as billing method.")
    String? Street1;

    /**
    * The street for the billing adress.
    */
    // @ApiMember(Description="The street for the billing adress.")
    String? Street2;

    /**
    * The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.")
    String? ZipCode;

    /**
    * The city for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The city for the billing adress. This is required when having postal invoice as billing method.")
    String? City;

    /**
    * The country for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The country for the billing adress. This is required when having postal invoice as billing method.")
    String? CountryId;

    /**
    * The billing email. This is required when having email invoice as billing method.
    */
    // @ApiMember(Description="The billing email. This is required when having email invoice as billing method.")
    String? Email;

    /**
    * The company global location number.
    */
    // @ApiMember(Description="The company global location number.")
    String? GLN;

    /**
    * You're internal rereference.
    */
    // @ApiMember(Description="You're internal rereference.")
    String? ReferenceLine1;

    /**
    * You're internal rereference.
    */
    // @ApiMember(Description="You're internal rereference.")
    String? ReferenceLine2;

    /**
    * The billing payment terms in days. This is default 15 days.
    */
    // @ApiMember(Description="The billing payment terms in days. This is default 15 days.")
    int? PaymentTermsDays;

    /**
    * The company vat registration number.
    */
    // @ApiMember(Description="The company vat registration number.")
    String? VatRegistrationNumber;

    /**
    * The billing method options to choose from
    */
    // @ApiMember(Description="The billing method options to choose from")
    List<BillingMethod>? BillingMethodOptions;

    BillingInformationResponse({this.CompanyId,this.BillingMethodId,this.Name,this.Attention,this.Street1,this.Street2,this.ZipCode,this.City,this.CountryId,this.Email,this.GLN,this.ReferenceLine1,this.ReferenceLine2,this.PaymentTermsDays,this.VatRegistrationNumber,this.BillingMethodOptions});
    BillingInformationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        BillingMethodId = json['BillingMethodId'];
        Name = json['Name'];
        Attention = json['Attention'];
        Street1 = json['Street1'];
        Street2 = json['Street2'];
        ZipCode = json['ZipCode'];
        City = json['City'];
        CountryId = json['CountryId'];
        Email = json['Email'];
        GLN = json['GLN'];
        ReferenceLine1 = json['ReferenceLine1'];
        ReferenceLine2 = json['ReferenceLine2'];
        PaymentTermsDays = json['PaymentTermsDays'];
        VatRegistrationNumber = json['VatRegistrationNumber'];
        BillingMethodOptions = JsonConverters.fromJson(json['BillingMethodOptions'],'List<BillingMethod>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'BillingMethodId': BillingMethodId,
        'Name': Name,
        'Attention': Attention,
        'Street1': Street1,
        'Street2': Street2,
        'ZipCode': ZipCode,
        'City': City,
        'CountryId': CountryId,
        'Email': Email,
        'GLN': GLN,
        'ReferenceLine1': ReferenceLine1,
        'ReferenceLine2': ReferenceLine2,
        'PaymentTermsDays': PaymentTermsDays,
        'VatRegistrationNumber': VatRegistrationNumber,
        'BillingMethodOptions': JsonConverters.toJson(BillingMethodOptions,'List<BillingMethod>',context!)
    };

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateBillingInformation implements ICompany, IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? CompanyId;

    /**
    * The prefered billing method.
    */
    // @ApiMember(Description="The prefered billing method.", IsRequired=true)
    int? BillingMethodId;

    /**
    * The name that should be printed on the billing information, normally this would be your company name.
    */
    // @ApiMember(Description="The name that should be printed on the billing information, normally this would be your company name.")
    String? Name;

    /**
    * If you want to add the attention to the billing address.
    */
    // @ApiMember(Description="If you want to add the attention to the billing address.")
    String? Attention;

    /**
    * The street for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The street for the billing adress. This is required when having postal invoice as billing method.")
    String? Street1;

    /**
    * The street for the billing adress.
    */
    // @ApiMember(Description="The street for the billing adress.")
    String? Street2;

    /**
    * The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.")
    String? ZipCode;

    /**
    * The city for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The city for the billing adress. This is required when having postal invoice as billing method.")
    String? City;

    /**
    * The country for the billing adress. This is required when having postal invoice as billing method.
    */
    // @ApiMember(Description="The country for the billing adress. This is required when having postal invoice as billing method.")
    String? CountryId;

    /**
    * The billing email. This is required when having email invoice as billing method.
    */
    // @ApiMember(Description="The billing email. This is required when having email invoice as billing method.")
    String? Email;

    /**
    * The billing payment terms in days. This is default 15 days.
    */
    // @ApiMember(Description="The billing payment terms in days. This is default 15 days.")
    int? PaymentTermsDays;

    /**
    * The company vat registration number.
    */
    // @ApiMember(Description="The company vat registration number.")
    String? VatRegistrationNumber;

    /**
    * The company global location number.
    */
    // @ApiMember(Description="The company global location number.")
    String? GLN;

    /**
    * You're internal rereference.
    */
    // @ApiMember(Description="You're internal rereference.")
    String? ReferenceLine1;

    /**
    * You're internal rereference.
    */
    // @ApiMember(Description="You're internal rereference.")
    String? ReferenceLine2;

    UpdateBillingInformation({this.CompanyId,this.BillingMethodId,this.Name,this.Attention,this.Street1,this.Street2,this.ZipCode,this.City,this.CountryId,this.Email,this.PaymentTermsDays,this.VatRegistrationNumber,this.GLN,this.ReferenceLine1,this.ReferenceLine2});
    UpdateBillingInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        BillingMethodId = json['BillingMethodId'];
        Name = json['Name'];
        Attention = json['Attention'];
        Street1 = json['Street1'];
        Street2 = json['Street2'];
        ZipCode = json['ZipCode'];
        City = json['City'];
        CountryId = json['CountryId'];
        Email = json['Email'];
        PaymentTermsDays = json['PaymentTermsDays'];
        VatRegistrationNumber = json['VatRegistrationNumber'];
        GLN = json['GLN'];
        ReferenceLine1 = json['ReferenceLine1'];
        ReferenceLine2 = json['ReferenceLine2'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'BillingMethodId': BillingMethodId,
        'Name': Name,
        'Attention': Attention,
        'Street1': Street1,
        'Street2': Street2,
        'ZipCode': ZipCode,
        'City': City,
        'CountryId': CountryId,
        'Email': Email,
        'PaymentTermsDays': PaymentTermsDays,
        'VatRegistrationNumber': VatRegistrationNumber,
        'GLN': GLN,
        'ReferenceLine1': ReferenceLine1,
        'ReferenceLine2': ReferenceLine2
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
    'BillingMethodCountriesRelation': TypeInfo(TypeOf.Class, create:() => BillingMethodCountriesRelation()),
    'BillingMethod': TypeInfo(TypeOf.Class, create:() => BillingMethod()),
    'List<BillingMethodCountriesRelation>': TypeInfo(TypeOf.Class, create:() => <BillingMethodCountriesRelation>[]),
    'BillingInformationResponse': TypeInfo(TypeOf.Class, create:() => BillingInformationResponse()),
    'List<BillingMethod>': TypeInfo(TypeOf.Class, create:() => <BillingMethod>[]),
    'UpdateBillingInformation': TypeInfo(TypeOf.Class, create:() => UpdateBillingInformation()),
});

Dart UpdateBillingInformation 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.

PUT /billing/company/ HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateBillingInformation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Attention>String</Attention>
  <BillingMethodId>0</BillingMethodId>
  <City>String</City>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CountryId>String</CountryId>
  <Email>String</Email>
  <GLN>String</GLN>
  <Name>String</Name>
  <PaymentTermsDays>0</PaymentTermsDays>
  <ReferenceLine1>String</ReferenceLine1>
  <ReferenceLine2>String</ReferenceLine2>
  <Street1>String</Street1>
  <Street2>String</Street2>
  <VatRegistrationNumber>String</VatRegistrationNumber>
  <ZipCode>String</ZipCode>
</UpdateBillingInformation>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BillingInformationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Attention>String</Attention>
  <BillingMethodId>0</BillingMethodId>
  <BillingMethodOptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
    <d2p1:BillingMethod>
      <d2p1:BillingMethodCountriesRelation>
        <d2p1:BillingMethodCountriesRelation>
          <d2p1:BillingMethodId>0</d2p1:BillingMethodId>
          <d2p1:CountryId>String</d2p1:CountryId>
          <d2p1:ModifiedDate xmlns:d6p1="http://schemas.datacontract.org/2004/07/System">
            <d6p1:DateTime>0001-01-01T00:00:00Z</d6p1:DateTime>
            <d6p1:OffsetMinutes>0</d6p1:OffsetMinutes>
          </d2p1:ModifiedDate>
        </d2p1:BillingMethodCountriesRelation>
      </d2p1:BillingMethodCountriesRelation>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:ModifiedDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System">
        <d4p1:DateTime>0001-01-01T00:00:00Z</d4p1:DateTime>
        <d4p1:OffsetMinutes>0</d4p1:OffsetMinutes>
      </d2p1:ModifiedDate>
      <d2p1:Name>String</d2p1:Name>
    </d2p1:BillingMethod>
  </BillingMethodOptions>
  <City>String</City>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CountryId>String</CountryId>
  <Email>String</Email>
  <GLN>String</GLN>
  <Name>String</Name>
  <PaymentTermsDays>0</PaymentTermsDays>
  <ReferenceLine1>String</ReferenceLine1>
  <ReferenceLine2>String</ReferenceLine2>
  <Street1>String</Street1>
  <Street2>String</Street2>
  <VatRegistrationNumber>String</VatRegistrationNumber>
  <ZipCode>String</ZipCode>
</BillingInformationResponse>