| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| GET | /voss/customers | Search voss customers by organization number, customer number or external id | Raw passthrough to the Voss customer search. Returns all matching customers with their full fields (externalId, customerNumber, expiryDate, ...). |
|---|
import 'package:servicestack/servicestack.dart';
enum CountryCodeEnum
{
AD,
AE,
AF,
AG,
AI,
AL,
AM,
AO,
AQ,
AR,
AS,
AT,
AU,
AW,
AX,
AZ,
BA,
BB,
BD,
BE,
BF,
BG,
BH,
BI,
BJ,
BL,
BM,
BN,
BO,
BQ,
BR,
BS,
BT,
BV,
BW,
BY,
BZ,
CA,
CC,
CD,
CF,
CG,
CH,
CI,
CK,
CL,
CM,
CN,
CO,
CR,
CU,
CV,
CW,
CX,
CY,
CZ,
DE,
DJ,
DK,
DM,
DO,
DZ,
EC,
EE,
EG,
EH,
ER,
ES,
ET,
FI,
FJ,
FK,
FM,
FO,
FR,
GA,
GB,
GD,
GE,
GF,
GG,
GH,
GI,
GL,
GM,
GN,
GP,
GQ,
GR,
GS,
GT,
GU,
GW,
GY,
HK,
HM,
HN,
HR,
HT,
HU,
ID,
IE,
IL,
IM,
IN,
IO,
IQ,
IR,
IS,
IT,
JE,
JM,
JO,
JP,
KE,
KG,
KH,
KI,
KM,
KN,
KP,
KR,
KW,
KY,
KZ,
LA,
LB,
LC,
LI,
LK,
LR,
LS,
LT,
LU,
LV,
LY,
MA,
MC,
MD,
ME,
MF,
MG,
MH,
MK,
ML,
MM,
MN,
MO,
MP,
MQ,
MR,
MS,
MT,
MU,
MV,
MW,
MX,
MY,
MZ,
NA,
NC,
NE,
NF,
NG,
NI,
NL,
NO,
NP,
NR,
NU,
NZ,
OM,
PA,
PE,
PF,
PG,
PH,
PK,
PL,
PM,
PN,
PR,
PS,
PT,
PW,
PY,
QA,
RE,
RO,
RS,
RU,
RW,
SA,
SB,
SC,
SD,
SE,
SG,
SH,
SI,
SJ,
SK,
SL,
SM,
SN,
SO,
SR,
SS,
ST,
SV,
SX,
SY,
SZ,
TC,
TD,
TF,
TG,
TH,
TJ,
TK,
TL,
TM,
TN,
TO,
TR,
TT,
TV,
TW,
TZ,
UA,
UG,
UM,
US,
UY,
UZ,
VA,
VC,
VE,
VG,
VI,
VN,
VU,
WF,
WS,
YE,
YT,
ZA,
ZM,
ZW,
}
// @DataContract(Name="CustomerContactPersonDto")
class CustomerContactPersonDto implements IConvertible
{
// @DataMember(Name="email", IsRequired=true)
String email = "";
// @DataMember(Name="firstName", IsRequired=true)
String firstName = "";
// @DataMember(Name="lastName", IsRequired=true)
String lastName = "";
// @DataMember(Name="phoneNumber")
String phoneNumber = "";
CustomerContactPersonDto({this.email,this.firstName,this.lastName,this.phoneNumber});
CustomerContactPersonDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
email = json['Email'];
firstName = json['FirstName'];
lastName = json['LastName'];
phoneNumber = json['PhoneNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'email': email,
'firstName': firstName,
'lastName': lastName,
'phoneNumber': phoneNumber
};
getTypeName() => "CustomerContactPersonDto";
TypeContext? context = _ctx;
}
// @DataContract(Name="CustomerTargetGroupDto")
class CustomerTargetGroupDto implements IConvertible
{
// @DataMember(Name="id", IsRequired=true)
String id = "";
// @DataMember(Name="name", IsRequired=true)
String name = "";
// @DataMember(Name="isDefault")
bool isDefault;
// @DataMember(Name="externalId")
String externalId = "";
CustomerTargetGroupDto({this.id,this.name,this.isDefault,this.externalId});
CustomerTargetGroupDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['Id'];
name = json['Name'];
isDefault = json['IsDefault'];
externalId = json['ExternalId'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'isDefault': isDefault,
'externalId': externalId
};
getTypeName() => "CustomerTargetGroupDto";
TypeContext? context = _ctx;
}
// @DataContract(Name="CustomerResult")
class CustomerResult implements IConvertible
{
// @DataMember(Name="countryCode")
CountryCodeEnum? countryCode;
// @DataMember(Name="id", IsRequired=true)
String id = "";
// @DataMember(Name="name", IsRequired=true)
String name = "";
// @DataMember(Name="customerNumber")
int? customerNumber;
// @DataMember(Name="organizationNumber")
String organizationNumber = "";
// @DataMember(Name="email")
String email = "";
// @DataMember(Name="careOf")
String careOf = "";
// @DataMember(Name="address")
String address = "";
// @DataMember(Name="postalCode")
String postalCode = "";
// @DataMember(Name="city")
String city = "";
// @DataMember(Name="electronicInvoiceOperatorCode")
String electronicInvoiceOperatorCode = "";
// @DataMember(Name="electronicInvoiceAddress")
String electronicInvoiceAddress = "";
// @DataMember(Name="customerGroup")
int? customerGroup;
// @DataMember(Name="contactPerson")
CustomerContactPersonDto contactPerson;
// @DataMember(Name="targetGroups", EmitDefaultValue=false)
List<CustomerTargetGroupDto> targetGroups = [];
// @DataMember(Name="expiryDate")
DateTime? expiryDate;
// @DataMember(Name="created", IsRequired=true)
DateTime created = DateTime(0);
// @DataMember(Name="externalId")
String externalId = "";
CustomerResult({this.countryCode,this.id,this.name,this.customerNumber,this.organizationNumber,this.email,this.careOf,this.address,this.postalCode,this.city,this.electronicInvoiceOperatorCode,this.electronicInvoiceAddress,this.customerGroup,this.contactPerson,this.targetGroups,this.expiryDate,this.created,this.externalId});
CustomerResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
countryCode = JsonConverters.fromJson(json['CountryCode'],'CountryCodeEnum',context!);
id = json['Id'];
name = json['Name'];
customerNumber = json['CustomerNumber'];
organizationNumber = json['OrganizationNumber'];
email = json['Email'];
careOf = json['CareOf'];
address = json['Address'];
postalCode = json['PostalCode'];
city = json['City'];
electronicInvoiceOperatorCode = json['ElectronicInvoiceOperatorCode'];
electronicInvoiceAddress = json['ElectronicInvoiceAddress'];
customerGroup = json['CustomerGroup'];
contactPerson = JsonConverters.fromJson(json['ContactPerson'],'CustomerContactPersonDto',context!);
targetGroups = JsonConverters.fromJson(json['TargetGroups'],'List<CustomerTargetGroupDto>',context!);
expiryDate = JsonConverters.fromJson(json['ExpiryDate'],'DateTime',context!);
created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
externalId = json['ExternalId'];
return this;
}
Map<String, dynamic> toJson() => {
'countryCode': JsonConverters.toJson(countryCode,'CountryCodeEnum',context!),
'id': id,
'name': name,
'customerNumber': customerNumber,
'organizationNumber': organizationNumber,
'email': email,
'careOf': careOf,
'address': address,
'postalCode': postalCode,
'city': city,
'electronicInvoiceOperatorCode': electronicInvoiceOperatorCode,
'electronicInvoiceAddress': electronicInvoiceAddress,
'customerGroup': customerGroup,
'contactPerson': JsonConverters.toJson(contactPerson,'CustomerContactPersonDto',context!),
'targetGroups': JsonConverters.toJson(targetGroups,'List<CustomerTargetGroupDto>',context!),
'expiryDate': JsonConverters.toJson(expiryDate,'DateTime',context!),
'created': JsonConverters.toJson(created,'DateTime',context!),
'externalId': externalId
};
getTypeName() => "CustomerResult";
TypeContext? context = _ctx;
}
class SearchVossCustomersResponse implements IConvertible
{
int TotalCount = 0;
List<CustomerResult> Items = [];
SearchVossCustomersResponse({this.TotalCount,this.Items});
SearchVossCustomersResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TotalCount = json['TotalCount'];
Items = JsonConverters.fromJson(json['Items'],'List<CustomerResult>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'TotalCount': TotalCount,
'Items': JsonConverters.toJson(Items,'List<CustomerResult>',context!)
};
getTypeName() => "SearchVossCustomersResponse";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class SearchVossCustomers implements IConvertible
{
/**
* Organization number to search for.
*/
// @ApiMember(Description="Organization number to search for.")
String OrganizationNumber = "";
/**
* Voss customer number to search for.
*/
// @ApiMember(Description="Voss customer number to search for.")
int? CustomerNumber;
/**
* External id to search for.
*/
// @ApiMember(Description="External id to search for.")
String ExternalId = "";
SearchVossCustomers({this.OrganizationNumber,this.CustomerNumber,this.ExternalId});
SearchVossCustomers.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
OrganizationNumber = json['OrganizationNumber'];
CustomerNumber = json['CustomerNumber'];
ExternalId = json['ExternalId'];
return this;
}
Map<String, dynamic> toJson() => {
'OrganizationNumber': OrganizationNumber,
'CustomerNumber': CustomerNumber,
'ExternalId': ExternalId
};
getTypeName() => "SearchVossCustomers";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
'CountryCodeEnum': TypeInfo(TypeOf.Enum, enumValues:CountryCodeEnum.values),
'CustomerContactPersonDto': TypeInfo(TypeOf.Class, create:() => CustomerContactPersonDto()),
'CustomerTargetGroupDto': TypeInfo(TypeOf.Class, create:() => CustomerTargetGroupDto()),
'CustomerResult': TypeInfo(TypeOf.Class, create:() => CustomerResult()),
'List<CustomerTargetGroupDto>': TypeInfo(TypeOf.Class, create:() => <CustomerTargetGroupDto>[]),
'SearchVossCustomersResponse': TypeInfo(TypeOf.Class, create:() => SearchVossCustomersResponse()),
'List<CustomerResult>': TypeInfo(TypeOf.Class, create:() => <CustomerResult>[]),
'SearchVossCustomers': TypeInfo(TypeOf.Class, create:() => SearchVossCustomers()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /voss/customers HTTP/1.1 Host: testapi.bokamera.se Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"TotalCount":0,"Items":[{}]}