| PUT | /customerarticle/{Id} | Update an existing CustomerArticle. | Update an existing CustomerArticle. |
|---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Enums
Imports BokaMera.API.ServiceModel.Db
Namespace Global
Namespace BokaMera.API.ServiceModel.Db
Public Partial Class ArticleServiceRelation
Inherits BaseModel
<Required>
Public Overridable Property CompanyId As Guid
Public Overridable Property Id As Integer
<Required>
Public Overridable Property ServiceId As Integer
<Required>
Public Overridable Property ArticleId As Integer
End Class
Public Partial Class BaseModel
End Class
End Namespace
Namespace BokaMera.API.ServiceModel.Dtos
Public Partial Class ArticleResponse
Public Overridable Property CompanyId As Guid
Public Overridable Property Id As Integer
Public Overridable Property Name As String
Public Overridable Property ArticleTypeId As Integer
Public Overridable Property Description As String
Public Overridable Property ImageUrl As String
Public Overridable Property Active As Boolean
Public Overridable Property Amount As Integer
Public Overridable Property Price As Double
Public Overridable Property CurrencyId As String
Public Overridable Property SortOrder As Integer
Public Overridable Property UpdatedDate As Date
Public Overridable Property CreatedDate As Date
Public Overridable Property Duration As Integer
Public Overridable Property Services As List(Of ArticleServiceRelation) = New List(Of ArticleServiceRelation)
Public Overridable Property ServiceIds As List(Of Integer) = New List(Of Integer)
Public Overridable Property PriceSign As String
Public Overridable Property VAT As Decimal?
Public Overridable Property ValidDays As Integer
Public Overridable Property SendNotification As Boolean
Public Overridable Property NotificationEmail As String
End Class
Public Partial Class CustomerArticleCompanyResponse
Public Overridable Property Id As Guid
Public Overridable Property Name As String
Public Overridable Property LogoType As String
Public Overridable Property Email As String
Public Overridable Property Phone As String
Public Overridable Property City As String
Public Overridable Property Street1 As String
Public Overridable Property ZipCode As String
Public Overridable Property CountryId As String
End Class
Public Partial Class CustomerArticleCustomerResponse
Public Overridable Property Id As Guid
Public Overridable Property Firstname As String
Public Overridable Property Lastname As String
Public Overridable Property Email As String
Public Overridable Property Phone As String
End Class
Public Partial Class CustomerArticleResponse
Public Overridable Property Id As Integer
Public Overridable Property CompanyId As Guid
Public Overridable Property ArticleId As Integer?
Public Overridable Property Price As Decimal?
Public Overridable Property VAT As Decimal?
Public Overridable Property CurrencyId As String
Public Overridable Property StatusId As Integer
Public Overridable Property StatusName As String
Public Overridable Property CustomerId As Guid?
Public Overridable Property CreatedDate As Date
Public Overridable Property UpdatedDate As Date
Public Overridable Property Article As ArticleResponse
Public Overridable Property Customer As CustomerArticleCustomerResponse
Public Overridable Property Company As CustomerArticleCompanyResponse
Public Overridable Property PaymentLog As List(Of PaymentLogResponse) = New List(Of PaymentLogResponse)
Public Overridable Property ResponseStatus As ResponseStatus
End Class
Public Partial Class PaymentLogResponse
Public Overridable Property Id As Integer
Public Overridable Property Amount As Double?
Public Overridable Property AmountCredited As Double?
Public Overridable Property CurrencyId As String
Public Overridable Property Comments As String
Public Overridable Property Created As Date
Public Overridable Property Updated As Date
End Class
<ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class UpdateCustomerArticle
Implements ICompany
'''<Summary>
'''The customer article id
'''</Summary>
<ApiMember(Description:="The customer article id", IsRequired:=true, ParameterType:="path")>
Public Overridable Property Id As Integer
'''<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.")>
Public Overridable Property CompanyId As Guid? Implements ICompany.CompanyId
'''<Summary>
'''The new status of the customer article
'''</Summary>
<ApiMember(Description:="The new status of the customer article")>
Public Overridable Property StatusId As CustomerArticleStatusEnum?
'''<Summary>
'''Updated price
'''</Summary>
<ApiMember(Description:="Updated price")>
Public Overridable Property Price As Decimal?
'''<Summary>
'''Updated VAT
'''</Summary>
<ApiMember(Description:="Updated VAT")>
Public Overridable Property VAT As Decimal?
'''<Summary>
'''Updated currency
'''</Summary>
<ApiMember(Description:="Updated currency")>
Public Overridable Property CurrencyId As String
End Class
End Namespace
Namespace BokaMera.API.ServiceModel.Enums
Public Enum CustomerArticleStatusEnum
AwaitingPayment = 1
AwaitingPaymentFromProvider = 2
AwaitingPaymentNoTimeLimit = 3
Active = 4
Off = 5
End Enum
End Namespace
End Namespace
VB.NET UpdateCustomerArticle DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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: application/json
Content-Type: application/json
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: application/json
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"}}}