Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /billing/company/ | Add new billing information. | Add new billing information. |
---|
Imports System
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.Db
Namespace Global
Namespace BokaMera.API.ServiceModel.Db
Public Partial Class BaseModel
End Class
Public Partial Class BillingMethod
Inherits BaseModel
Public Sub New()
BillingMethodCountriesRelation = New List(Of BillingMethodCountriesRelation)
End Sub
Public Overridable Property BillingMethodCountriesRelation As List(Of BillingMethodCountriesRelation)
<Required>
Public Overridable Property Name As String
<Required>
Public Overridable Property Description As String
Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
Public Overridable Property Id As Integer
End Class
Public Partial Class BillingMethodCountriesRelation
Inherits BaseModel
<Required>
Public Overridable Property BillingMethodId As Integer
<Required>
Public Overridable Property CountryId As String
Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
End Class
End Namespace
Namespace BokaMera.API.ServiceModel.Dtos
<ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class AddBillingInformation
Implements ICompany
'''<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 Nullable(Of Guid)
'''<Summary>
'''The prefered billing method.
'''</Summary>
<ApiMember(Description:="The prefered billing method.", IsRequired:=true)>
Public Overridable Property BillingMethodId As Integer
'''<Summary>
'''The name that should be printed on the billing information, normally this would be your company name.
'''</Summary>
<ApiMember(Description:="The name that should be printed on the billing information, normally this would be your company name.")>
Public Overridable Property Name As String
'''<Summary>
'''If you want to add the attention to the billing address.
'''</Summary>
<ApiMember(Description:="If you want to add the attention to the billing address.")>
Public Overridable Property Attention As String
'''<Summary>
'''The street for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The street for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property Street1 As String
'''<Summary>
'''The street for the billing adress.
'''</Summary>
<ApiMember(Description:="The street for the billing adress.")>
Public Overridable Property Street2 As String
'''<Summary>
'''The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property ZipCode As String
'''<Summary>
'''The city for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The city for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property City As String
'''<Summary>
'''The country for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The country for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property CountryId As String
'''<Summary>
'''The billing email. This is required when having email invoice as billing method.
'''</Summary>
<ApiMember(Description:="The billing email. This is required when having email invoice as billing method.")>
Public Overridable Property Email As String
'''<Summary>
'''The billing payment terms in days. This is default 15 days.
'''</Summary>
<ApiMember(Description:="The billing payment terms in days. This is default 15 days.")>
Public Overridable Property PaymentTermsDays As Nullable(Of Integer)
'''<Summary>
'''The company vat registration number.
'''</Summary>
<ApiMember(Description:="The company vat registration number.")>
Public Overridable Property VatRegistrationNumber As String
'''<Summary>
'''The company global location number.
'''</Summary>
<ApiMember(Description:="The company global location number.")>
Public Overridable Property GLN As String
'''<Summary>
'''You're internal rereference.
'''</Summary>
<ApiMember(Description:="You're internal rereference.")>
Public Overridable Property ReferenceLine1 As String
'''<Summary>
'''You're internal rereference.
'''</Summary>
<ApiMember(Description:="You're internal rereference.")>
Public Overridable Property ReferenceLine2 As String
End Class
Public Partial Class BillingInformationResponse
Public Sub New()
BillingMethodOptions = New List(Of BillingMethod)
End Sub
'''<Summary>
'''The company id.
'''</Summary>
<ApiMember(Description:="The company id.")>
Public Overridable Property CompanyId As Guid
'''<Summary>
'''The prefered billing method.
'''</Summary>
<ApiMember(Description:="The prefered billing method.", IsRequired:=true)>
Public Overridable Property BillingMethodId As Integer
'''<Summary>
'''The name that should be printed on the billing information, normally this would be your company name.
'''</Summary>
<ApiMember(Description:="The name that should be printed on the billing information, normally this would be your company name.")>
Public Overridable Property Name As String
'''<Summary>
'''If you want to add the attention to the billing address.
'''</Summary>
<ApiMember(Description:="If you want to add the attention to the billing address.")>
Public Overridable Property Attention As String
'''<Summary>
'''The street for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The street for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property Street1 As String
'''<Summary>
'''The street for the billing adress.
'''</Summary>
<ApiMember(Description:="The street for the billing adress.")>
Public Overridable Property Street2 As String
'''<Summary>
'''The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The zip code (postal code) for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property ZipCode As String
'''<Summary>
'''The city for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The city for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property City As String
'''<Summary>
'''The country for the billing adress. This is required when having postal invoice as billing method.
'''</Summary>
<ApiMember(Description:="The country for the billing adress. This is required when having postal invoice as billing method.")>
Public Overridable Property CountryId As String
'''<Summary>
'''The billing email. This is required when having email invoice as billing method.
'''</Summary>
<ApiMember(Description:="The billing email. This is required when having email invoice as billing method.")>
Public Overridable Property Email As String
'''<Summary>
'''The company global location number.
'''</Summary>
<ApiMember(Description:="The company global location number.")>
Public Overridable Property GLN As String
'''<Summary>
'''You're internal rereference.
'''</Summary>
<ApiMember(Description:="You're internal rereference.")>
Public Overridable Property ReferenceLine1 As String
'''<Summary>
'''You're internal rereference.
'''</Summary>
<ApiMember(Description:="You're internal rereference.")>
Public Overridable Property ReferenceLine2 As String
'''<Summary>
'''The billing payment terms in days. This is default 15 days.
'''</Summary>
<ApiMember(Description:="The billing payment terms in days. This is default 15 days.")>
Public Overridable Property PaymentTermsDays As Integer
'''<Summary>
'''The company vat registration number.
'''</Summary>
<ApiMember(Description:="The company vat registration number.")>
Public Overridable Property VatRegistrationNumber As String
'''<Summary>
'''The billing method options to choose from
'''</Summary>
<ApiMember(Description:="The billing method options to choose from")>
Public Overridable Property BillingMethodOptions As List(Of BillingMethod)
End Class
End Namespace
End Namespace
VB.NET AddBillingInformation DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /billing/company/ HTTP/1.1
Host: testapi.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CompanyId: 00000000-0000-0000-0000-000000000000,
BillingMethodId: 0,
Name: String,
Attention: String,
Street1: String,
Street2: String,
ZipCode: String,
City: String,
CountryId: String,
Email: String,
PaymentTermsDays: 0,
VatRegistrationNumber: String,
GLN: String,
ReferenceLine1: String,
ReferenceLine2: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { BillingMethodId: 0, Name: String, Attention: String, Street1: String, Street2: String, ZipCode: String, City: String, CountryId: String, Email: String, GLN: String, ReferenceLine1: String, ReferenceLine2: String, PaymentTermsDays: 0, VatRegistrationNumber: String, BillingMethodOptions: [ { BillingMethodCountriesRelation: [ { BillingMethodId: 0, CountryId: String, ModifiedDate: 0001-01-01T00:00:00.0000000+00:00 } ], Name: String, Description: String, ModifiedDate: 0001-01-01T00:00:00.0000000+00:00, Id: 0 } ] }