| POST | /invoices/misc |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BH.CloudAPI.Common4.DTO.SalesForce
Imports BH.CloudAPI.Common.DTO
Namespace Global
Namespace BH.CloudAPI.Common.DTO
Public Partial Class Invoice
Implements IInvoiceValidation
Public Sub New()
InvoiceItems = New List(Of InvoiceItem)
End Sub
Public Overridable Property UniqueId As String
Public Overridable Property ClientId As Integer
Public Overridable Property GroupId As String
Public Overridable Property Description As String
Public Overridable Property OpportunityId As String
Public Overridable Property Installments As Integer
Public Overridable Property Frequency As Integer
Public Overridable Property InvoiceDueDate As Date
Public Overridable Property Deliver As Boolean
Public Overridable Property UserId As String
Public Overridable Property BhUserId As Integer
Public Overridable Property CurrencyType As String
Public Overridable Property InvoiceItems As List(Of InvoiceItem)
Public Overridable Property InvoiceNo As Integer
Public Overridable Property InvoiceAmt As Decimal
Public Overridable Property ExternalInvBatchNo As String
Public Overridable Property ExemptFromLateFee As Boolean
End Class
Public Partial Class InvoiceItem
Implements IInvoiceItemValidation
Public Overridable Property UniqueId As String
Public Overridable Property ProductName As String
Public Overridable Property AmountDue As Decimal
Public Overridable Property ProductType As String
Public Overridable Property ActPatternTypeID As Integer
Public Overridable Property TermStartDate As Date
Public Overridable Property TermEndDate As Date
Public Overridable Property RecognitionPeriod As Integer
Public Overridable Property RevenueAccount As String
Public Overridable Property AccountsReceivableAccount As String
Public Overridable Property LiabilityAccount As String
Public Overridable Property CreditExpenseAccount As String
Public Overridable Property InvoiceClearingAccount As String
Public Overridable Property CostCenter As String
Public Overridable Property Region As String
End Class
End Namespace
Namespace BH.CloudAPI.Common4.DTO.SalesForce
Public Partial Class InvoiceCollection
Public Sub New()
InvoiceList = New List(Of Invoice)
End Sub
Public Overridable Property InvoiceList As List(Of Invoice)
End Class
Public Partial Class InvoiceCollectionReply
Implements IHaveErrorField
Public Sub New()
InvoiceReply = New List(Of InvoiceReply)
End Sub
Public Overridable Property InvoiceReply As List(Of InvoiceReply)
Public Overridable Property IsError As Boolean
End Class
Public Partial Class InvoiceReply
Public Overridable Property UniqueId As String
Public Overridable Property ErrorCode As Integer
Public Overridable Property ErrorMessage As String
Public Overridable Property InvBatchNo As Integer
Public Overridable Property InvAmount As Decimal
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /invoices/misc HTTP/1.1
Host: devapi.billhighway.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<InvoiceCollection xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
<InvoiceList>
<Invoice>
<BhUserId>0</BhUserId>
<ClientId>0</ClientId>
<CurrencyType>String</CurrencyType>
<Deliver>false</Deliver>
<Description>String</Description>
<ExemptFromLateFee>false</ExemptFromLateFee>
<ExternalInvBatchNo>String</ExternalInvBatchNo>
<Frequency>0</Frequency>
<GroupId>String</GroupId>
<Installments>0</Installments>
<InvoiceAmt>0</InvoiceAmt>
<InvoiceDueDate>0001-01-01T00:00:00</InvoiceDueDate>
<InvoiceItems>
<InvoiceItem>
<AmountDue>String</AmountDue>
<ProductName>String</ProductName>
<RevenueAccount>String</RevenueAccount>
</InvoiceItem>
</InvoiceItems>
<InvoiceNo>0</InvoiceNo>
<OpportunityId>String</OpportunityId>
<UniqueId>String</UniqueId>
<UserId>String</UserId>
</Invoice>
</InvoiceList>
</InvoiceCollection>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<InvoiceCollectionReply xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
<InvoiceReply>
<InvoiceReply>
<ErrorCode>0</ErrorCode>
<ErrorMessage>String</ErrorMessage>
<InvAmount>0</InvAmount>
<InvBatchNo>0</InvBatchNo>
<UniqueId>String</UniqueId>
</InvoiceReply>
</InvoiceReply>
</InvoiceCollectionReply>