Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /billing/company/ | Add new billing information. | Add new 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 AddBillingInformation 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;
AddBillingInformation({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});
AddBillingInformation.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() => "AddBillingInformation";
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>[]),
'AddBillingInformation': TypeInfo(TypeOf.Class, create:() => AddBillingInformation()),
});
Dart AddBillingInformation DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /billing/company/ HTTP/1.1
Host: api.bokamera.se
Accept: application/json
Content-Type: application/json
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","BillingMethodId":0,"Name":"String","Attention":"String","Street1":"String","Street2":"String","ZipCode":"String","City":"String","CountryId":"String","Email":"String","PaymentTermsDays":0,"VatRegistrationNumber":"String","GLN":"String","ReferenceLine1":"String","ReferenceLine2":"String"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"BillingMethodId":0,"Name":"String","Attention":"String","Street1":"String","Street2":"String","ZipCode":"String","City":"String","CountryId":"String","Email":"String","GLN":"String","ReferenceLine1":"String","ReferenceLine2":"String","PaymentTermsDays":0,"VatRegistrationNumber":"String","BillingMethodOptions":[{"BillingMethodCountriesRelation":[{"BillingMethodId":0,"CountryId":"String","ModifiedDate":"0001-01-01T00:00:00.0000000+00:00"}],"Name":"String","Description":"String","ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":0}]}