| POST | /customerarticle/fromarticle | Create CustomerArticle. | Create CustomerArticle. |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
open class CreateCustomerArticleFromArticle : FromArticleBase(), ICompany
{
}
open class FromArticleBase
{
/**
*
*/
@ApiMember(Description="")
open var CompanyId:UUID? = null
/**
* Article ID for the rebate code
*/
@ApiMember(Description="Article ID for the rebate code", IsRequired=true)
open var ArticleId:Int? = null
/**
* Customer information
*/
@ApiMember(Description="Customer information")
open var Customer:CustomerToHandle? = null
/**
* 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.
*/
@ApiMember(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. ")
open var InvoiceAddress:InvoiceAddressToHandle? = null
}
open class CustomerToHandle : CustomerBase()
{
}
open class CustomerBase : ICustomerBase
{
override var CustomerId:UUID? = null
override var Firstname:String? = null
override var Lastname:String? = null
override var Email:String? = null
override var Phone:String? = null
override var SubscribedToNewsletter:Boolean? = null
override var PersonalIdentityNumber:String? = null
}
open class InvoiceAddressToHandle : IInvoiceAddress
{
override var CorporateIdentityNumber:String? = null
override var InvoiceAddress1:String? = null
override var InvoiceAddress2:String? = null
override var InvoiceCity:String? = null
override var InvoicePostalCode:String? = null
override var InvoiceCountryCode:String? = null
}
open class CustomerArticleResponse
{
open var Id:Int? = null
open var CompanyId:UUID? = null
open var ArticleId:Int? = null
open var Price:BigDecimal? = null
open var VAT:BigDecimal? = null
open var CurrencyId:String? = null
open var StatusId:Int? = null
open var StatusName:String? = null
open var CustomerId:UUID? = null
open var CreatedDate:Date? = null
open var UpdatedDate:Date? = null
open var Article:ArticleResponse? = null
open var Customer:CustomerArticleCustomerResponse? = null
open var Company:CustomerArticleCompanyResponse? = null
open var PaymentLog:ArrayList<PaymentLogResponse> = ArrayList<PaymentLogResponse>()
open var ResponseStatus:ResponseStatus? = null
}
open class ArticleResponse
{
open var CompanyId:UUID? = null
open var Id:Int? = null
open var Name:String? = null
open var ArticleTypeId:Int? = null
open var Description:String? = null
open var ImageUrl:String? = null
open var Active:Boolean? = null
open var Amount:Int? = null
open var Price:Double? = null
open var CurrencyId:String? = null
open var SortOrder:Int? = null
open var UpdatedDate:Date? = null
open var CreatedDate:Date? = null
open var Services:ArrayList<ArticleServiceRelation> = ArrayList<ArticleServiceRelation>()
open var ServiceIds:ArrayList<Int> = ArrayList<Int>()
open var PriceSign:String? = null
open var VAT:BigDecimal? = null
}
open class ArticleServiceRelation : BaseModel()
{
@Required()
open var CompanyId:UUID? = null
open var Id:Int? = null
@Required()
open var ServiceId:Int? = null
@Required()
open var ArticleId:Int? = null
}
open class BaseModel
{
}
open class CustomerArticleCustomerResponse
{
open var Id:UUID? = null
open var Firstname:String? = null
open var Lastname:String? = null
open var Email:String? = null
open var Phone:String? = null
}
open class CustomerArticleCompanyResponse
{
open var Id:UUID? = null
open var Name:String? = null
open var LogoType:String? = null
open var Email:String? = null
open var Phone:String? = null
open var City:String? = null
open var Street1:String? = null
open var ZipCode:String? = null
open var CountryId:String? = null
}
open class PaymentLogResponse
{
open var Id:Int? = null
open var Amount:Double? = null
open var AmountCredited:Double? = null
open var CurrencyId:String? = null
open var Comments:String? = null
open var Created:Date? = null
open var Updated:Date? = null
}
Kotlin CreateCustomerArticleFromArticle DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","ArticleId":0,"Customer":{"CustomerId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Email":"String","Phone":"String","SubscribedToNewsletter":false,"PersonalIdentityNumber":"String"},"InvoiceAddress":{"CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Id":0,"ArticleId":0,"Price":0,"VAT":0,"CurrencyId":"String","StatusId":0,"StatusName":"String","CustomerId":"00000000-0000-0000-0000-000000000000","Article":{"Id":0,"Name":"String","ArticleTypeId":0,"Description":"String","ImageUrl":"String","Active":false,"Amount":0,"Price":0,"CurrencyId":"String","SortOrder":0,"Services":[{"Id":0,"ServiceId":0,"ArticleId":0}],"ServiceIds":[0],"PriceSign":"String","VAT":0},"Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String"},"Company":{"Name":"String","LogoType":"String","Email":"String","Phone":"String","City":"String","Street1":"String","ZipCode":"String","CountryId":"String"},"PaymentLog":[{"Id":0,"Amount":0,"AmountCredited":0,"CurrencyId":"String","Comments":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}