BokaMera.API.Host

<back to all web services

UpdateCustomerArticle

Requires Authentication
The following routes are available for this service:
PUT/customerarticle/{Id}Update an existing CustomerArticle.Update an existing 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)
@ValidateRequest(Validator="IsAuthenticated")
open class UpdateCustomerArticle : ICompany
{
    /**
    * The customer article id
    */
    @ApiMember(Description="The customer article id", IsRequired=true, ParameterType="path")
    open var Id:Int? = null

    /**
    * 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.")
    override var CompanyId:UUID? = null

    /**
    * The new status of the customer article
    */
    @ApiMember(Description="The new status of the customer article")
    open var StatusId:CustomerArticleStatusEnum? = null

    /**
    * Updated price
    */
    @ApiMember(Description="Updated price")
    open var Price:BigDecimal? = null

    /**
    * Updated VAT
    */
    @ApiMember(Description="Updated VAT")
    open var VAT:BigDecimal? = null

    /**
    * Updated currency
    */
    @ApiMember(Description="Updated currency")
    open var CurrencyId:String? = null
}

enum class CustomerArticleStatusEnum(val value:Int)
{
    AwaitingPayment(1),
    AwaitingPaymentFromProvider(2),
    AwaitingPaymentNoTimeLimit(3),
    Active(4),
    Off(5),
}

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 Duration:Int? = 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 var ValidDays:Int? = null
    open var SendNotification:Boolean? = null
    open var NotificationEmail:String? = 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 UpdateCustomerArticle DTOs

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

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /customerarticle/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Id":0,"CompanyId":"00000000-0000-0000-0000-000000000000","StatusId":"0","Price":0,"VAT":0,"CurrencyId":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
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"}}}