| POST | /customerarticle/fromarticle | Create CustomerArticle. | Create CustomerArticle. |
|---|
"use strict";
export class CustomerBase {
/** @param {{CustomerId?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string,SubscribedToNewsletter?:boolean,PersonalIdentityNumber?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?string} */
CustomerId;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Email;
/** @type {string} */
Phone;
/** @type {boolean} */
SubscribedToNewsletter;
/** @type {string} */
PersonalIdentityNumber;
}
export class CustomerToHandle extends CustomerBase {
/** @param {{CustomerId?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string,SubscribedToNewsletter?:boolean,PersonalIdentityNumber?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
export class InvoiceAddressToHandle {
/** @param {{CorporateIdentityNumber?:string,InvoiceAddress1?:string,InvoiceAddress2?:string,InvoiceCity?:string,InvoicePostalCode?:string,InvoiceCountryCode?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
CorporateIdentityNumber;
/** @type {string} */
InvoiceAddress1;
/** @type {string} */
InvoiceAddress2;
/** @type {string} */
InvoiceCity;
/** @type {string} */
InvoicePostalCode;
/** @type {string} */
InvoiceCountryCode;
}
export class FromArticleBase {
/** @param {{CompanyId?:string,ArticleId?:number,Customer?:CustomerToHandle,InvoiceAddress?:InvoiceAddressToHandle}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?string} */
CompanyId;
/**
* @type {number}
* @description Article ID for the rebate code */
ArticleId;
/**
* @type {CustomerToHandle}
* @description Customer information */
Customer;
/**
* @type {InvoiceAddressToHandle}
* @description If you want to book with customer information instead of the Customer Id send the customer information here. Note: If customer profile already exists with the same email the information will not be changed, instead the provided information will be added as BookingsComments if it differs from the ordinairy profile. */
InvoiceAddress;
}
export class BaseModel {
constructor(init) { Object.assign(this, init) }
}
export class ArticleServiceRelation extends BaseModel {
/** @param {{CompanyId?:string,Id?:number,ServiceId?:number,ArticleId?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {string} */
CompanyId;
/** @type {number} */
Id;
/** @type {number} */
ServiceId;
/** @type {number} */
ArticleId;
}
export class ArticleResponse {
/** @param {{CompanyId?:string,Id?:number,Name?:string,ArticleTypeId?:number,Description?:string,ImageUrl?:string,Active?:boolean,Amount?:number,Price?:number,CurrencyId?:string,SortOrder?:number,UpdatedDate?:string,CreatedDate?:string,Services?:ArticleServiceRelation[],ServiceIds?:number[],PriceSign?:string,VAT?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
CompanyId;
/** @type {number} */
Id;
/** @type {string} */
Name;
/** @type {number} */
ArticleTypeId;
/** @type {string} */
Description;
/** @type {string} */
ImageUrl;
/** @type {boolean} */
Active;
/** @type {number} */
Amount;
/** @type {number} */
Price;
/** @type {string} */
CurrencyId;
/** @type {number} */
SortOrder;
/** @type {string} */
UpdatedDate;
/** @type {string} */
CreatedDate;
/** @type {ArticleServiceRelation[]} */
Services = [];
/** @type {number[]} */
ServiceIds = [];
/** @type {string} */
PriceSign;
/** @type {?number} */
VAT;
}
export class CustomerArticleCustomerResponse {
/** @param {{Id?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Email;
/** @type {string} */
Phone;
}
export class CustomerArticleCompanyResponse {
/** @param {{Id?:string,Name?:string,LogoType?:string,Email?:string,Phone?:string,City?:string,Street1?:string,ZipCode?:string,CountryId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Name;
/** @type {string} */
LogoType;
/** @type {string} */
Email;
/** @type {string} */
Phone;
/** @type {string} */
City;
/** @type {string} */
Street1;
/** @type {string} */
ZipCode;
/** @type {string} */
CountryId;
}
export class PaymentLogResponse {
/** @param {{Id?:number,Amount?:number,AmountCredited?:number,CurrencyId?:string,Comments?:string,Created?:string,Updated?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {?number} */
Amount;
/** @type {?number} */
AmountCredited;
/** @type {string} */
CurrencyId;
/** @type {string} */
Comments;
/** @type {string} */
Created;
/** @type {string} */
Updated;
}
export class CustomerArticleResponse {
/** @param {{Id?:number,CompanyId?:string,ArticleId?:number,Price?:number,VAT?:number,CurrencyId?:string,StatusId?:number,StatusName?:string,CustomerId?:string,CreatedDate?:string,UpdatedDate?:string,Article?:ArticleResponse,Customer?:CustomerArticleCustomerResponse,Company?:CustomerArticleCompanyResponse,PaymentLog?:PaymentLogResponse[],ResponseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
CompanyId;
/** @type {?number} */
ArticleId;
/** @type {?number} */
Price;
/** @type {?number} */
VAT;
/** @type {string} */
CurrencyId;
/** @type {number} */
StatusId;
/** @type {string} */
StatusName;
/** @type {?string} */
CustomerId;
/** @type {string} */
CreatedDate;
/** @type {string} */
UpdatedDate;
/** @type {ArticleResponse} */
Article;
/** @type {CustomerArticleCustomerResponse} */
Customer;
/** @type {CustomerArticleCompanyResponse} */
Company;
/** @type {PaymentLogResponse[]} */
PaymentLog = [];
/** @type {ResponseStatus} */
ResponseStatus;
}
export class CreateCustomerArticleFromArticle extends FromArticleBase {
/** @param {{CompanyId?:string,ArticleId?:number,Customer?:CustomerToHandle,InvoiceAddress?:InvoiceAddressToHandle}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
JavaScript CreateCustomerArticleFromArticle DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /customerarticle/fromarticle HTTP/1.1
Host: testapi.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateCustomerArticleFromArticle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<ArticleId>0</ArticleId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Customer>
<CustomerId xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">00000000-0000-0000-0000-000000000000</CustomerId>
<Email xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Email>
<Firstname xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Firstname>
<Lastname xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Lastname>
<PersonalIdentityNumber xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</PersonalIdentityNumber>
<Phone xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Phone>
<SubscribedToNewsletter xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">false</SubscribedToNewsletter>
</Customer>
<InvoiceAddress>
<CorporateIdentityNumber>String</CorporateIdentityNumber>
<InvoiceAddress1>String</InvoiceAddress1>
<InvoiceAddress2>String</InvoiceAddress2>
<InvoiceCity>String</InvoiceCity>
<InvoiceCountryCode>String</InvoiceCountryCode>
<InvoicePostalCode>String</InvoicePostalCode>
</InvoiceAddress>
</CreateCustomerArticleFromArticle>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CustomerArticleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<Article>
<Active>false</Active>
<Amount>0</Amount>
<ArticleTypeId>0</ArticleTypeId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<CurrencyId>String</CurrencyId>
<Description>String</Description>
<Id>0</Id>
<ImageUrl>String</ImageUrl>
<Name>String</Name>
<Price>0</Price>
<PriceSign>String</PriceSign>
<ServiceIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:int>0</d3p1:int>
</ServiceIds>
<Services xmlns:d3p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
<d3p1:ArticleServiceRelation>
<d3p1:ArticleId>0</d3p1:ArticleId>
<d3p1:CompanyId>00000000-0000-0000-0000-000000000000</d3p1:CompanyId>
<d3p1:Id>0</d3p1:Id>
<d3p1:ServiceId>0</d3p1:ServiceId>
</d3p1:ArticleServiceRelation>
</Services>
<SortOrder>0</SortOrder>
<UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
<VAT>0</VAT>
</Article>
<ArticleId>0</ArticleId>
<Company>
<City>String</City>
<CountryId>String</CountryId>
<Email>String</Email>
<Id>00000000-0000-0000-0000-000000000000</Id>
<LogoType>String</LogoType>
<Name>String</Name>
<Phone>String</Phone>
<Street1>String</Street1>
<ZipCode>String</ZipCode>
</Company>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<CurrencyId>String</CurrencyId>
<Customer>
<Email>String</Email>
<Firstname>String</Firstname>
<Id>00000000-0000-0000-0000-000000000000</Id>
<Lastname>String</Lastname>
<Phone>String</Phone>
</Customer>
<CustomerId>00000000-0000-0000-0000-000000000000</CustomerId>
<Id>0</Id>
<PaymentLog>
<PaymentLogResponse>
<Amount>0</Amount>
<AmountCredited>0</AmountCredited>
<Comments>String</Comments>
<Created>0001-01-01T00:00:00</Created>
<CurrencyId>String</CurrencyId>
<Id>0</Id>
<Updated>0001-01-01T00:00:00</Updated>
</PaymentLogResponse>
</PaymentLog>
<Price>0</Price>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<StatusId>0</StatusId>
<StatusName>String</StatusName>
<UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
<VAT>0</VAT>
</CustomerArticleResponse>