| POST | /invoices/misc |
|---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BH.CloudAPI.Common4.DTO.SalesForce;
using BH.CloudAPI.Common.DTO;
namespace BH.CloudAPI.Common.DTO
{
public partial class Invoice
: IInvoiceValidation
{
public Invoice()
{
InvoiceItems = new List<InvoiceItem>{};
}
public virtual string UniqueId { get; set; }
public virtual int ClientId { get; set; }
public virtual string GroupId { get; set; }
public virtual string Description { get; set; }
public virtual string OpportunityId { get; set; }
public virtual int Installments { get; set; }
public virtual int Frequency { get; set; }
public virtual DateTime InvoiceDueDate { get; set; }
public virtual bool Deliver { get; set; }
public virtual string UserId { get; set; }
public virtual int BhUserId { get; set; }
public virtual string CurrencyType { get; set; }
public virtual List<InvoiceItem> InvoiceItems { get; set; }
public virtual int InvoiceNo { get; set; }
public virtual decimal InvoiceAmt { get; set; }
public virtual string ExternalInvBatchNo { get; set; }
public virtual bool ExemptFromLateFee { get; set; }
}
public partial class InvoiceItem
: IInvoiceItemValidation
{
public virtual string UniqueId { get; set; }
public virtual string ProductName { get; set; }
public virtual decimal AmountDue { get; set; }
public virtual string ProductType { get; set; }
public virtual int ActPatternTypeID { get; set; }
public virtual DateTime TermStartDate { get; set; }
public virtual DateTime TermEndDate { get; set; }
public virtual int RecognitionPeriod { get; set; }
public virtual string RevenueAccount { get; set; }
public virtual string AccountsReceivableAccount { get; set; }
public virtual string LiabilityAccount { get; set; }
public virtual string CreditExpenseAccount { get; set; }
public virtual string InvoiceClearingAccount { get; set; }
public virtual string CostCenter { get; set; }
public virtual string Region { get; set; }
}
}
namespace BH.CloudAPI.Common4.DTO.SalesForce
{
public partial class InvoiceCollection
{
public InvoiceCollection()
{
InvoiceList = new List<Invoice>{};
}
public virtual List<Invoice> InvoiceList { get; set; }
}
public partial class InvoiceCollectionReply
: IHaveErrorField
{
public InvoiceCollectionReply()
{
InvoiceReply = new List<InvoiceReply>{};
}
public virtual List<InvoiceReply> InvoiceReply { get; set; }
public virtual bool IsError { get; set; }
}
public partial class InvoiceReply
{
public virtual string UniqueId { get; set; }
public virtual int ErrorCode { get; set; }
public virtual string ErrorMessage { get; set; }
public virtual int InvBatchNo { get; set; }
public virtual decimal InvAmount { get; set; }
}
}
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 /invoices/misc HTTP/1.1
Host: devapi.billhighway.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
InvoiceList:
[
{
UniqueId: String,
ClientId: 0,
GroupId: String,
UserId: String,
OpportunityId: String,
InvoiceDueDate: 0001-01-01,
Installments: 0,
Frequency: 0,
BhUserId: 0,
Description: String,
Deliver: False,
CurrencyType: String,
InvoiceItems:
[
{
ProductName: String,
AmountDue: String,
RevenueAccount: String
}
],
InvoiceNo: 0,
InvoiceAmt: 0,
ExternalInvBatchNo: String,
ExemptFromLateFee: False
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
InvoiceReply:
[
{
UniqueId: String,
ErrorCode: 0,
ErrorMessage: String,
InvBatchNo: 0,
InvAmount: 0
}
],
IsError: False
}