BokaMera.API.Host

<back to all web services

CreateCustomerArticleFromArticle

The following routes are available for this service:
POST/customerarticle/fromarticleCreate CustomerArticle.Create CustomerArticle.
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
    public static class CreateCustomerArticleFromArticle extends FromArticleBase implements ICompany
    {
        
    }

    public static class FromArticleBase
    {
        /**
        * 
        */
        @ApiMember(Description="")
        public UUID CompanyId = null;

        /**
        * Article ID for the rebate code
        */
        @ApiMember(Description="Article ID for the rebate code", IsRequired=true)
        public Integer ArticleId = null;

        /**
        * Customer information
        */
        @ApiMember(Description="Customer information")
        public CustomerToHandle Customer = 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. ")
        public InvoiceAddressToHandle InvoiceAddress = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public FromArticleBase setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getArticleId() { return ArticleId; }
        public FromArticleBase setArticleId(Integer value) { this.ArticleId = value; return this; }
        public CustomerToHandle getCustomer() { return Customer; }
        public FromArticleBase setCustomer(CustomerToHandle value) { this.Customer = value; return this; }
        public InvoiceAddressToHandle getInvoiceAddress() { return InvoiceAddress; }
        public FromArticleBase setInvoiceAddress(InvoiceAddressToHandle value) { this.InvoiceAddress = value; return this; }
    }

    public static class CustomerToHandle extends CustomerBase
    {
        
    }

    public static class CustomerBase implements ICustomerBase
    {
        public UUID CustomerId = null;
        public String Firstname = null;
        public String Lastname = null;
        public String Email = null;
        public String Phone = null;
        public Boolean SubscribedToNewsletter = null;
        public String PersonalIdentityNumber = null;
        
        public UUID getCustomerId() { return CustomerId; }
        public CustomerBase setCustomerId(UUID value) { this.CustomerId = value; return this; }
        public String getFirstname() { return Firstname; }
        public CustomerBase setFirstname(String value) { this.Firstname = value; return this; }
        public String getLastname() { return Lastname; }
        public CustomerBase setLastname(String value) { this.Lastname = value; return this; }
        public String getEmail() { return Email; }
        public CustomerBase setEmail(String value) { this.Email = value; return this; }
        public String getPhone() { return Phone; }
        public CustomerBase setPhone(String value) { this.Phone = value; return this; }
        public Boolean isSubscribedToNewsletter() { return SubscribedToNewsletter; }
        public CustomerBase setSubscribedToNewsletter(Boolean value) { this.SubscribedToNewsletter = value; return this; }
        public String getPersonalIdentityNumber() { return PersonalIdentityNumber; }
        public CustomerBase setPersonalIdentityNumber(String value) { this.PersonalIdentityNumber = value; return this; }
    }

    public static class InvoiceAddressToHandle implements IInvoiceAddress
    {
        public String CorporateIdentityNumber = null;
        public String InvoiceAddress1 = null;
        public String InvoiceAddress2 = null;
        public String InvoiceCity = null;
        public String InvoicePostalCode = null;
        public String InvoiceCountryCode = null;
        
        public String getCorporateIdentityNumber() { return CorporateIdentityNumber; }
        public InvoiceAddressToHandle setCorporateIdentityNumber(String value) { this.CorporateIdentityNumber = value; return this; }
        public String getInvoiceAddress1() { return InvoiceAddress1; }
        public InvoiceAddressToHandle setInvoiceAddress1(String value) { this.InvoiceAddress1 = value; return this; }
        public String getInvoiceAddress2() { return InvoiceAddress2; }
        public InvoiceAddressToHandle setInvoiceAddress2(String value) { this.InvoiceAddress2 = value; return this; }
        public String getInvoiceCity() { return InvoiceCity; }
        public InvoiceAddressToHandle setInvoiceCity(String value) { this.InvoiceCity = value; return this; }
        public String getInvoicePostalCode() { return InvoicePostalCode; }
        public InvoiceAddressToHandle setInvoicePostalCode(String value) { this.InvoicePostalCode = value; return this; }
        public String getInvoiceCountryCode() { return InvoiceCountryCode; }
        public InvoiceAddressToHandle setInvoiceCountryCode(String value) { this.InvoiceCountryCode = value; return this; }
    }

    public static class CustomerArticleResponse
    {
        public Integer Id = null;
        public UUID CompanyId = null;
        public Integer ArticleId = null;
        public BigDecimal Price = null;
        public BigDecimal VAT = null;
        public String CurrencyId = null;
        public Integer StatusId = null;
        public String StatusName = null;
        public UUID CustomerId = null;
        public Date CreatedDate = null;
        public Date UpdatedDate = null;
        public ArticleResponse Article = null;
        public CustomerArticleCustomerResponse Customer = null;
        public CustomerArticleCompanyResponse Company = null;
        public ArrayList<PaymentLogResponse> PaymentLog = new ArrayList<PaymentLogResponse>();
        public ResponseStatus ResponseStatus = null;
        
        public Integer getId() { return Id; }
        public CustomerArticleResponse setId(Integer value) { this.Id = value; return this; }
        public UUID getCompanyId() { return CompanyId; }
        public CustomerArticleResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getArticleId() { return ArticleId; }
        public CustomerArticleResponse setArticleId(Integer value) { this.ArticleId = value; return this; }
        public BigDecimal getPrice() { return Price; }
        public CustomerArticleResponse setPrice(BigDecimal value) { this.Price = value; return this; }
        public BigDecimal getVat() { return VAT; }
        public CustomerArticleResponse setVat(BigDecimal value) { this.VAT = value; return this; }
        public String getCurrencyId() { return CurrencyId; }
        public CustomerArticleResponse setCurrencyId(String value) { this.CurrencyId = value; return this; }
        public Integer getStatusId() { return StatusId; }
        public CustomerArticleResponse setStatusId(Integer value) { this.StatusId = value; return this; }
        public String getStatusName() { return StatusName; }
        public CustomerArticleResponse setStatusName(String value) { this.StatusName = value; return this; }
        public UUID getCustomerId() { return CustomerId; }
        public CustomerArticleResponse setCustomerId(UUID value) { this.CustomerId = value; return this; }
        public Date getCreatedDate() { return CreatedDate; }
        public CustomerArticleResponse setCreatedDate(Date value) { this.CreatedDate = value; return this; }
        public Date getUpdatedDate() { return UpdatedDate; }
        public CustomerArticleResponse setUpdatedDate(Date value) { this.UpdatedDate = value; return this; }
        public ArticleResponse getArticle() { return Article; }
        public CustomerArticleResponse setArticle(ArticleResponse value) { this.Article = value; return this; }
        public CustomerArticleCustomerResponse getCustomer() { return Customer; }
        public CustomerArticleResponse setCustomer(CustomerArticleCustomerResponse value) { this.Customer = value; return this; }
        public CustomerArticleCompanyResponse getCompany() { return Company; }
        public CustomerArticleResponse setCompany(CustomerArticleCompanyResponse value) { this.Company = value; return this; }
        public ArrayList<PaymentLogResponse> getPaymentLog() { return PaymentLog; }
        public CustomerArticleResponse setPaymentLog(ArrayList<PaymentLogResponse> value) { this.PaymentLog = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public CustomerArticleResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class ArticleResponse
    {
        public UUID CompanyId = null;
        public Integer Id = null;
        public String Name = null;
        public Integer ArticleTypeId = null;
        public String Description = null;
        public String ImageUrl = null;
        public Boolean Active = null;
        public Integer Amount = null;
        public Double Price = null;
        public String CurrencyId = null;
        public Integer SortOrder = null;
        public Date UpdatedDate = null;
        public Date CreatedDate = null;
        public ArrayList<ArticleServiceRelation> Services = new ArrayList<ArticleServiceRelation>();
        public ArrayList<Integer> ServiceIds = new ArrayList<Integer>();
        public String PriceSign = null;
        public BigDecimal VAT = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public ArticleResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public ArticleResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public ArticleResponse setName(String value) { this.Name = value; return this; }
        public Integer getArticleTypeId() { return ArticleTypeId; }
        public ArticleResponse setArticleTypeId(Integer value) { this.ArticleTypeId = value; return this; }
        public String getDescription() { return Description; }
        public ArticleResponse setDescription(String value) { this.Description = value; return this; }
        public String getImageUrl() { return ImageUrl; }
        public ArticleResponse setImageUrl(String value) { this.ImageUrl = value; return this; }
        public Boolean isActive() { return Active; }
        public ArticleResponse setActive(Boolean value) { this.Active = value; return this; }
        public Integer getAmount() { return Amount; }
        public ArticleResponse setAmount(Integer value) { this.Amount = value; return this; }
        public Double getPrice() { return Price; }
        public ArticleResponse setPrice(Double value) { this.Price = value; return this; }
        public String getCurrencyId() { return CurrencyId; }
        public ArticleResponse setCurrencyId(String value) { this.CurrencyId = value; return this; }
        public Integer getSortOrder() { return SortOrder; }
        public ArticleResponse setSortOrder(Integer value) { this.SortOrder = value; return this; }
        public Date getUpdatedDate() { return UpdatedDate; }
        public ArticleResponse setUpdatedDate(Date value) { this.UpdatedDate = value; return this; }
        public Date getCreatedDate() { return CreatedDate; }
        public ArticleResponse setCreatedDate(Date value) { this.CreatedDate = value; return this; }
        public ArrayList<ArticleServiceRelation> getServices() { return Services; }
        public ArticleResponse setServices(ArrayList<ArticleServiceRelation> value) { this.Services = value; return this; }
        public ArrayList<Integer> getServiceIds() { return ServiceIds; }
        public ArticleResponse setServiceIds(ArrayList<Integer> value) { this.ServiceIds = value; return this; }
        public String getPriceSign() { return PriceSign; }
        public ArticleResponse setPriceSign(String value) { this.PriceSign = value; return this; }
        public BigDecimal getVat() { return VAT; }
        public ArticleResponse setVat(BigDecimal value) { this.VAT = value; return this; }
    }

    public static class ArticleServiceRelation extends BaseModel
    {
        @Required()
        public UUID CompanyId = null;

        public Integer Id = null;
        @Required()
        public Integer ServiceId = null;

        @Required()
        public Integer ArticleId = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public ArticleServiceRelation setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public ArticleServiceRelation setId(Integer value) { this.Id = value; return this; }
        public Integer getServiceId() { return ServiceId; }
        public ArticleServiceRelation setServiceId(Integer value) { this.ServiceId = value; return this; }
        public Integer getArticleId() { return ArticleId; }
        public ArticleServiceRelation setArticleId(Integer value) { this.ArticleId = value; return this; }
    }

    public static class BaseModel
    {
        
    }

    public static class CustomerArticleCustomerResponse
    {
        public UUID Id = null;
        public String Firstname = null;
        public String Lastname = null;
        public String Email = null;
        public String Phone = null;
        
        public UUID getId() { return Id; }
        public CustomerArticleCustomerResponse setId(UUID value) { this.Id = value; return this; }
        public String getFirstname() { return Firstname; }
        public CustomerArticleCustomerResponse setFirstname(String value) { this.Firstname = value; return this; }
        public String getLastname() { return Lastname; }
        public CustomerArticleCustomerResponse setLastname(String value) { this.Lastname = value; return this; }
        public String getEmail() { return Email; }
        public CustomerArticleCustomerResponse setEmail(String value) { this.Email = value; return this; }
        public String getPhone() { return Phone; }
        public CustomerArticleCustomerResponse setPhone(String value) { this.Phone = value; return this; }
    }

    public static class CustomerArticleCompanyResponse
    {
        public UUID Id = null;
        public String Name = null;
        public String LogoType = null;
        public String Email = null;
        public String Phone = null;
        public String City = null;
        public String Street1 = null;
        public String ZipCode = null;
        public String CountryId = null;
        
        public UUID getId() { return Id; }
        public CustomerArticleCompanyResponse setId(UUID value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public CustomerArticleCompanyResponse setName(String value) { this.Name = value; return this; }
        public String getLogoType() { return LogoType; }
        public CustomerArticleCompanyResponse setLogoType(String value) { this.LogoType = value; return this; }
        public String getEmail() { return Email; }
        public CustomerArticleCompanyResponse setEmail(String value) { this.Email = value; return this; }
        public String getPhone() { return Phone; }
        public CustomerArticleCompanyResponse setPhone(String value) { this.Phone = value; return this; }
        public String getCity() { return City; }
        public CustomerArticleCompanyResponse setCity(String value) { this.City = value; return this; }
        public String getStreet1() { return Street1; }
        public CustomerArticleCompanyResponse setStreet1(String value) { this.Street1 = value; return this; }
        public String getZipCode() { return ZipCode; }
        public CustomerArticleCompanyResponse setZipCode(String value) { this.ZipCode = value; return this; }
        public String getCountryId() { return CountryId; }
        public CustomerArticleCompanyResponse setCountryId(String value) { this.CountryId = value; return this; }
    }

    public static class PaymentLogResponse
    {
        public Integer Id = null;
        public Double Amount = null;
        public Double AmountCredited = null;
        public String CurrencyId = null;
        public String Comments = null;
        public Date Created = null;
        public Date Updated = null;
        
        public Integer getId() { return Id; }
        public PaymentLogResponse setId(Integer value) { this.Id = value; return this; }
        public Double getAmount() { return Amount; }
        public PaymentLogResponse setAmount(Double value) { this.Amount = value; return this; }
        public Double getAmountCredited() { return AmountCredited; }
        public PaymentLogResponse setAmountCredited(Double value) { this.AmountCredited = value; return this; }
        public String getCurrencyId() { return CurrencyId; }
        public PaymentLogResponse setCurrencyId(String value) { this.CurrencyId = value; return this; }
        public String getComments() { return Comments; }
        public PaymentLogResponse setComments(String value) { this.Comments = value; return this; }
        public Date getCreated() { return Created; }
        public PaymentLogResponse setCreated(Date value) { this.Created = value; return this; }
        public Date getUpdated() { return Updated; }
        public PaymentLogResponse setUpdated(Date value) { this.Updated = value; return this; }
    }

}

Java CreateCustomerArticleFromArticle DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

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/jsv
Content-Type: text/jsv
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/jsv
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
		}
	}
}