BokaMera.API.Host

<back to all web services

CreateCustomerArticle

Requires Authentication
The following routes are available for this service:
POST/customerarticleCreate a new CustomerArticle.Create a new CustomerArticle directly with price, status, and customer.
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)
    @ValidateRequest(Validator="IsAuthenticated")
    public static class CreateCustomerArticle implements ICompany
    {
        /**
        * 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.")
        public UUID CompanyId = null;

        /**
        * The article id to base this customer article on
        */
        @ApiMember(Description="The article id to base this customer article on", IsRequired=true)
        public Integer ArticleId = null;

        /**
        * The customer id to assign the article to
        */
        @ApiMember(Description="The customer id to assign the article to", IsRequired=true)
        public UUID CustomerId = null;

        /**
        * The status of the customer article
        */
        @ApiMember(Description="The status of the customer article")
        public CustomerArticleStatusEnum StatusId = null;

        /**
        * Optional price override. If not provided, uses the article price.
        */
        @ApiMember(Description="Optional price override. If not provided, uses the article price.")
        public BigDecimal Price = null;

        /**
        * Optional VAT override. If not provided, uses the article VAT.
        */
        @ApiMember(Description="Optional VAT override. If not provided, uses the article VAT.")
        public BigDecimal VAT = null;

        /**
        * Optional currency override. If not provided, uses the article currency.
        */
        @ApiMember(Description="Optional currency override. If not provided, uses the article currency.")
        public String CurrencyId = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public CreateCustomerArticle setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getArticleId() { return ArticleId; }
        public CreateCustomerArticle setArticleId(Integer value) { this.ArticleId = value; return this; }
        public UUID getCustomerId() { return CustomerId; }
        public CreateCustomerArticle setCustomerId(UUID value) { this.CustomerId = value; return this; }
        public CustomerArticleStatusEnum getStatusId() { return StatusId; }
        public CreateCustomerArticle setStatusId(CustomerArticleStatusEnum value) { this.StatusId = value; return this; }
        public BigDecimal getPrice() { return Price; }
        public CreateCustomerArticle setPrice(BigDecimal value) { this.Price = value; return this; }
        public BigDecimal getVat() { return VAT; }
        public CreateCustomerArticle setVat(BigDecimal value) { this.VAT = value; return this; }
        public String getCurrencyId() { return CurrencyId; }
        public CreateCustomerArticle setCurrencyId(String value) { this.CurrencyId = value; return this; }
    }

    public static enum CustomerArticleStatusEnum
    {
        AwaitingPayment(1),
        AwaitingPaymentFromProvider(2),
        AwaitingPaymentNoTimeLimit(3),
        Active(4),
        Off(5);

        private final int value;
        CustomerArticleStatusEnum(final int intValue) { value = intValue; }
        public int getValue() { return value; }
    }

    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 Integer Duration = null;
        public ArrayList<ArticleServiceRelation> Services = new ArrayList<ArticleServiceRelation>();
        public ArrayList<Integer> ServiceIds = new ArrayList<Integer>();
        public String PriceSign = null;
        public BigDecimal VAT = null;
        public Integer ValidDays = null;
        public Boolean SendNotification = null;
        public String NotificationEmail = 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 Integer getDuration() { return Duration; }
        public ArticleResponse setDuration(Integer value) { this.Duration = 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 Integer getValidDays() { return ValidDays; }
        public ArticleResponse setValidDays(Integer value) { this.ValidDays = value; return this; }
        public Boolean isSendNotification() { return SendNotification; }
        public ArticleResponse setSendNotification(Boolean value) { this.SendNotification = value; return this; }
        public String getNotificationEmail() { return NotificationEmail; }
        public ArticleResponse setNotificationEmail(String value) { this.NotificationEmail = 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 CreateCustomerArticle 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 HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	ArticleId: 0,
	StatusId: 0,
	Price: 0,
	VAT: 0,
	CurrencyId: 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,
		Duration: 0,
		Services: 
		[
			{
				Id: 0,
				ServiceId: 0,
				ArticleId: 0
			}
		],
		ServiceIds: 
		[
			0
		],
		PriceSign: String,
		VAT: 0,
		ValidDays: 0,
		SendNotification: False,
		NotificationEmail: String
	},
	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
		}
	}
}