BokaMera.API.Host

<back to all web services

CreateCustomerArticleFromArticle

The following routes are available for this service:
POST/customerarticle/fromarticleCreate CustomerArticle.Create 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.Dtos.Commons
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 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?
        End Class

        <ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
        Public Partial Class CreateCustomerArticleFromArticle
            Inherits FromArticleBase
            Implements ICompany
        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 CustomerToHandle
            Inherits CustomerBase
        End Class

        Public Partial Class FromArticleBase
            '''<Summary>
            '''
            '''</Summary>
            <ApiMember(Description:="")>
            Public Overridable Property CompanyId As Guid?

            '''<Summary>
            '''Article ID for the rebate code
            '''</Summary>
            <ApiMember(Description:="Article ID for the rebate code", IsRequired:=true)>
            Public Overridable Property ArticleId As Integer

            '''<Summary>
            '''Customer information
            '''</Summary>
            <ApiMember(Description:="Customer information")>
            Public Overridable Property Customer As CustomerToHandle

            '''<Summary>
            '''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. 
            '''</Summary>
            <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 Overridable Property InvoiceAddress As InvoiceAddressToHandle
        End Class

        Public Partial Class InvoiceAddressToHandle
            Implements IInvoiceAddress
            Public Overridable Property CorporateIdentityNumber As String Implements IInvoiceAddress.CorporateIdentityNumber
            Public Overridable Property InvoiceAddress1 As String Implements IInvoiceAddress.InvoiceAddress1
            Public Overridable Property InvoiceAddress2 As String Implements IInvoiceAddress.InvoiceAddress2
            Public Overridable Property InvoiceCity As String Implements IInvoiceAddress.InvoiceCity
            Public Overridable Property InvoicePostalCode As String Implements IInvoiceAddress.InvoicePostalCode
            Public Overridable Property InvoiceCountryCode As String Implements IInvoiceAddress.InvoiceCountryCode
        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
    End Namespace

    Namespace BokaMera.API.ServiceModel.Dtos.Commons

        Public Partial Class CustomerBase
            Implements ICustomerBase
            Public Overridable Property CustomerId As Guid? Implements ICustomerBase.CustomerId
            Public Overridable Property Firstname As String Implements ICustomerBase.Firstname
            Public Overridable Property Lastname As String Implements ICustomerBase.Lastname
            Public Overridable Property Email As String Implements ICustomerBase.Email
            Public Overridable Property Phone As String Implements ICustomerBase.Phone
            Public Overridable Property SubscribedToNewsletter As Boolean Implements ICustomerBase.SubscribedToNewsletter
            Public Overridable Property PersonalIdentityNumber As String Implements ICustomerBase.PersonalIdentityNumber
        End Class
    End Namespace
End Namespace

VB.NET CreateCustomerArticleFromArticle DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CreateCustomerArticleFromArticle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <ArticleId>0</ArticleId>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Customer>
    <CustomerId xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">00000000-0000-0000-0000-000000000000</CustomerId>
    <Email xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Email>
    <Firstname xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Firstname>
    <Lastname xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Lastname>
    <PersonalIdentityNumber xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</PersonalIdentityNumber>
    <Phone xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">String</Phone>
    <SubscribedToNewsletter xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos.Commons">false</SubscribedToNewsletter>
  </Customer>
  <InvoiceAddress>
    <CorporateIdentityNumber>String</CorporateIdentityNumber>
    <InvoiceAddress1>String</InvoiceAddress1>
    <InvoiceAddress2>String</InvoiceAddress2>
    <InvoiceCity>String</InvoiceCity>
    <InvoiceCountryCode>String</InvoiceCountryCode>
    <InvoicePostalCode>String</InvoicePostalCode>
  </InvoiceAddress>
</CreateCustomerArticleFromArticle>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerArticleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Article>
    <Active>false</Active>
    <Amount>0</Amount>
    <ArticleTypeId>0</ArticleTypeId>
    <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <CurrencyId>String</CurrencyId>
    <Description>String</Description>
    <Id>0</Id>
    <ImageUrl>String</ImageUrl>
    <Name>String</Name>
    <Price>0</Price>
    <PriceSign>String</PriceSign>
    <ServiceIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </ServiceIds>
    <Services xmlns:d3p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
      <d3p1:ArticleServiceRelation>
        <d3p1:ArticleId>0</d3p1:ArticleId>
        <d3p1:CompanyId>00000000-0000-0000-0000-000000000000</d3p1:CompanyId>
        <d3p1:Id>0</d3p1:Id>
        <d3p1:ServiceId>0</d3p1:ServiceId>
      </d3p1:ArticleServiceRelation>
    </Services>
    <SortOrder>0</SortOrder>
    <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
    <VAT>0</VAT>
  </Article>
  <ArticleId>0</ArticleId>
  <Company>
    <City>String</City>
    <CountryId>String</CountryId>
    <Email>String</Email>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <LogoType>String</LogoType>
    <Name>String</Name>
    <Phone>String</Phone>
    <Street1>String</Street1>
    <ZipCode>String</ZipCode>
  </Company>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CreatedDate>0001-01-01T00:00:00</CreatedDate>
  <CurrencyId>String</CurrencyId>
  <Customer>
    <Email>String</Email>
    <Firstname>String</Firstname>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <Lastname>String</Lastname>
    <Phone>String</Phone>
  </Customer>
  <CustomerId>00000000-0000-0000-0000-000000000000</CustomerId>
  <Id>0</Id>
  <PaymentLog>
    <PaymentLogResponse>
      <Amount>0</Amount>
      <AmountCredited>0</AmountCredited>
      <Comments>String</Comments>
      <Created>0001-01-01T00:00:00</Created>
      <CurrencyId>String</CurrencyId>
      <Id>0</Id>
      <Updated>0001-01-01T00:00:00</Updated>
    </PaymentLogResponse>
  </PaymentLog>
  <Price>0</Price>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <StatusId>0</StatusId>
  <StatusName>String</StatusName>
  <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
  <VAT>0</VAT>
</CustomerArticleResponse>