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.
namespace BokaMera.API.ServiceModel.Db

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type BaseModel() = 
        class end

    [<AllowNullLiteral>]
    type ArticleServiceRelation() = 
        inherit BaseModel()
        [<Required>]
        member val CompanyId:Guid = new Guid() with get,set

        member val Id:Int32 = new Int32() with get,set
        [<Required>]
        member val ServiceId:Int32 = new Int32() with get,set

        [<Required>]
        member val ArticleId:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type ArticleResponse() = 
        member val CompanyId:Guid = new Guid() with get,set
        member val Id:Int32 = new Int32() with get,set
        member val Name:String = null with get,set
        member val ArticleTypeId:Int32 = new Int32() with get,set
        member val Description:String = null with get,set
        member val ImageUrl:String = null with get,set
        member val Active:Boolean = new Boolean() with get,set
        member val Amount:Int32 = new Int32() with get,set
        member val Price:Double = new Double() with get,set
        member val CurrencyId:String = null with get,set
        member val SortOrder:Int32 = new Int32() with get,set
        member val UpdatedDate:DateTime = new DateTime() with get,set
        member val CreatedDate:DateTime = new DateTime() with get,set
        member val Duration:Int32 = new Int32() with get,set
        member val Services:ResizeArray<ArticleServiceRelation> = null with get,set
        member val ServiceIds:ResizeArray<Int32> = null with get,set
        member val PriceSign:String = null with get,set
        member val VAT:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val ValidDays:Int32 = new Int32() with get,set
        member val SendNotification:Boolean = new Boolean() with get,set
        member val NotificationEmail:String = null with get,set

    [<AllowNullLiteral>]
    type CustomerArticleCustomerResponse() = 
        member val Id:Guid = new Guid() with get,set
        member val Firstname:String = null with get,set
        member val Lastname:String = null with get,set
        member val Email:String = null with get,set
        member val Phone:String = null with get,set

    [<AllowNullLiteral>]
    type CustomerArticleCompanyResponse() = 
        member val Id:Guid = new Guid() with get,set
        member val Name:String = null with get,set
        member val LogoType:String = null with get,set
        member val Email:String = null with get,set
        member val Phone:String = null with get,set
        member val City:String = null with get,set
        member val Street1:String = null with get,set
        member val ZipCode:String = null with get,set
        member val CountryId:String = null with get,set

    [<AllowNullLiteral>]
    type PaymentLogResponse() = 
        member val Id:Int32 = new Int32() with get,set
        member val Amount:Nullable<Double> = new Nullable<Double>() with get,set
        member val AmountCredited:Nullable<Double> = new Nullable<Double>() with get,set
        member val CurrencyId:String = null with get,set
        member val Comments:String = null with get,set
        member val Created:DateTime = new DateTime() with get,set
        member val Updated:DateTime = new DateTime() with get,set

    [<AllowNullLiteral>]
    type CustomerArticleResponse() = 
        member val Id:Int32 = new Int32() with get,set
        member val CompanyId:Guid = new Guid() with get,set
        member val ArticleId:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val Price:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val VAT:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val CurrencyId:String = null with get,set
        member val StatusId:Int32 = new Int32() with get,set
        member val StatusName:String = null with get,set
        member val CustomerId:Nullable<Guid> = new Nullable<Guid>() with get,set
        member val CreatedDate:DateTime = new DateTime() with get,set
        member val UpdatedDate:DateTime = new DateTime() with get,set
        member val Article:ArticleResponse = null with get,set
        member val Customer:CustomerArticleCustomerResponse = null with get,set
        member val Company:CustomerArticleCompanyResponse = null with get,set
        member val PaymentLog:ResizeArray<PaymentLogResponse> = null with get,set
        member val ResponseStatus:ResponseStatus = null with get,set

    type CustomerArticleStatusEnum =
        | AwaitingPayment = 1
        | AwaitingPaymentFromProvider = 2
        | AwaitingPaymentNoTimeLimit = 3
        | Active = 4
        | Off = 5

    [<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
    [<ValidateRequest(Validator="IsAuthenticated")>]
    [<AllowNullLiteral>]
    type UpdateCustomerArticle() = 
        ///<summary>
        ///The customer article id
        ///</summary>
        [<ApiMember(Description="The customer article id", IsRequired=true, ParameterType="path")>]
        member val Id:Int32 = new Int32() with get,set

        ///<summary>
        ///The company id, if empty will use the company id for the user you are logged in with.
        ///</summary>
        [<ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")>]
        member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set

        ///<summary>
        ///The new status of the customer article
        ///</summary>
        [<ApiMember(Description="The new status of the customer article")>]
        member val StatusId:Nullable<CustomerArticleStatusEnum> = new Nullable<CustomerArticleStatusEnum>() with get,set

        ///<summary>
        ///Updated price
        ///</summary>
        [<ApiMember(Description="Updated price")>]
        member val Price:Nullable<Decimal> = new Nullable<Decimal>() with get,set

        ///<summary>
        ///Updated VAT
        ///</summary>
        [<ApiMember(Description="Updated VAT")>]
        member val VAT:Nullable<Decimal> = new Nullable<Decimal>() with get,set

        ///<summary>
        ///Updated currency
        ///</summary>
        [<ApiMember(Description="Updated currency")>]
        member val CurrencyId:String = null with get,set

F# UpdateCustomerArticle 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.

PUT /customerarticle/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
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/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
		}
	}
}