Trendsic Platform Service

<back to all web services

InsertInvoiceRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/invoice
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    public static class InsertInvoiceRequest
    {
        public Invoice Invoice = null;
        public ArrayList<InvoiceLineItem> LineItems = new ArrayList<InvoiceLineItem>();
        
        public Invoice getInvoice() { return Invoice; }
        public InsertInvoiceRequest setInvoice(Invoice value) { this.Invoice = value; return this; }
        public ArrayList<InvoiceLineItem> getLineItems() { return LineItems; }
        public InsertInvoiceRequest setLineItems(ArrayList<InvoiceLineItem> value) { this.LineItems = value; return this; }
    }

    public static class Invoice
    {
        public Integer InvoiceID = null;
        public UUID InvoiceUID = null;
        public UUID ProjectUID = null;
        public String InvoiceNumber = null;
        public Date InvoiceDate = null;
        public Date DueDate = null;
        public String FromName = null;
        public String FromPhone = null;
        public String FromEmail = null;
        public String FromAddress = null;
        public String FromDesc = null;
        public String ToName = null;
        public String ToPhone = null;
        public String ToEmail = null;
        public String ToAddress = null;
        public String ToDesc = null;
        public String Notes = null;
        public String Currency = null;
        public Integer Status = null;
        public BigDecimal Total = null;
        public Boolean IsPaid = null;
        public Date PaidDate = null;
        public Boolean IsDeleted = null;
        public Boolean IsLocked = null;
        public Date CreatedDate = null;
        public Date ModifiedDate = null;
        public UUID CreatedByUID = null;
        
        public Integer getInvoiceID() { return InvoiceID; }
        public Invoice setInvoiceID(Integer value) { this.InvoiceID = value; return this; }
        public UUID getInvoiceUID() { return InvoiceUID; }
        public Invoice setInvoiceUID(UUID value) { this.InvoiceUID = value; return this; }
        public UUID getProjectUID() { return ProjectUID; }
        public Invoice setProjectUID(UUID value) { this.ProjectUID = value; return this; }
        public String getInvoiceNumber() { return InvoiceNumber; }
        public Invoice setInvoiceNumber(String value) { this.InvoiceNumber = value; return this; }
        public Date getInvoiceDate() { return InvoiceDate; }
        public Invoice setInvoiceDate(Date value) { this.InvoiceDate = value; return this; }
        public Date getDueDate() { return DueDate; }
        public Invoice setDueDate(Date value) { this.DueDate = value; return this; }
        public String getFromName() { return FromName; }
        public Invoice setFromName(String value) { this.FromName = value; return this; }
        public String getFromPhone() { return FromPhone; }
        public Invoice setFromPhone(String value) { this.FromPhone = value; return this; }
        public String getFromEmail() { return FromEmail; }
        public Invoice setFromEmail(String value) { this.FromEmail = value; return this; }
        public String getFromAddress() { return FromAddress; }
        public Invoice setFromAddress(String value) { this.FromAddress = value; return this; }
        public String getFromDesc() { return FromDesc; }
        public Invoice setFromDesc(String value) { this.FromDesc = value; return this; }
        public String getToName() { return ToName; }
        public Invoice setToName(String value) { this.ToName = value; return this; }
        public String getToPhone() { return ToPhone; }
        public Invoice setToPhone(String value) { this.ToPhone = value; return this; }
        public String getToEmail() { return ToEmail; }
        public Invoice setToEmail(String value) { this.ToEmail = value; return this; }
        public String getToAddress() { return ToAddress; }
        public Invoice setToAddress(String value) { this.ToAddress = value; return this; }
        public String getToDesc() { return ToDesc; }
        public Invoice setToDesc(String value) { this.ToDesc = value; return this; }
        public String getNotes() { return Notes; }
        public Invoice setNotes(String value) { this.Notes = value; return this; }
        public String getCurrency() { return Currency; }
        public Invoice setCurrency(String value) { this.Currency = value; return this; }
        public Integer getStatus() { return Status; }
        public Invoice setStatus(Integer value) { this.Status = value; return this; }
        public BigDecimal getTotal() { return Total; }
        public Invoice setTotal(BigDecimal value) { this.Total = value; return this; }
        public Boolean getIsPaid() { return IsPaid; }
        public Invoice setIsPaid(Boolean value) { this.IsPaid = value; return this; }
        public Date getPaidDate() { return PaidDate; }
        public Invoice setPaidDate(Date value) { this.PaidDate = value; return this; }
        public Boolean getIsDeleted() { return IsDeleted; }
        public Invoice setIsDeleted(Boolean value) { this.IsDeleted = value; return this; }
        public Boolean getIsLocked() { return IsLocked; }
        public Invoice setIsLocked(Boolean value) { this.IsLocked = value; return this; }
        public Date getCreatedDate() { return CreatedDate; }
        public Invoice setCreatedDate(Date value) { this.CreatedDate = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public Invoice setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public UUID getCreatedByUID() { return CreatedByUID; }
        public Invoice setCreatedByUID(UUID value) { this.CreatedByUID = value; return this; }
    }

    public static class InvoiceLineItem
    {
        public Integer InvoiceLineItemID = null;
        public Integer InvoiceID = null;
        public String Type = null;
        public String Name = null;
        public Integer Quantity = null;
        public BigDecimal PercentageAdjust = null;
        public BigDecimal AmountAdjust = null;
        public BigDecimal Price = null;
        public String Description = null;
        public String Notes = null;
        public Boolean IsTaxable = null;
        public Integer DisplayOrder = null;
        public Boolean IsLocked = null;
        public Boolean IsDeleted = null;
        public Boolean IsPaid = null;
        public Date CreatedDate = null;
        public Date ModifiedDate = null;
        public UUID CreatedByUID = null;
        
        public Integer getInvoiceLineItemID() { return InvoiceLineItemID; }
        public InvoiceLineItem setInvoiceLineItemID(Integer value) { this.InvoiceLineItemID = value; return this; }
        public Integer getInvoiceID() { return InvoiceID; }
        public InvoiceLineItem setInvoiceID(Integer value) { this.InvoiceID = value; return this; }
        public String getType() { return Type; }
        public InvoiceLineItem setType(String value) { this.Type = value; return this; }
        public String getName() { return Name; }
        public InvoiceLineItem setName(String value) { this.Name = value; return this; }
        public Integer getQuantity() { return Quantity; }
        public InvoiceLineItem setQuantity(Integer value) { this.Quantity = value; return this; }
        public BigDecimal getPercentageAdjust() { return PercentageAdjust; }
        public InvoiceLineItem setPercentageAdjust(BigDecimal value) { this.PercentageAdjust = value; return this; }
        public BigDecimal getAmountAdjust() { return AmountAdjust; }
        public InvoiceLineItem setAmountAdjust(BigDecimal value) { this.AmountAdjust = value; return this; }
        public BigDecimal getPrice() { return Price; }
        public InvoiceLineItem setPrice(BigDecimal value) { this.Price = value; return this; }
        public String getDescription() { return Description; }
        public InvoiceLineItem setDescription(String value) { this.Description = value; return this; }
        public String getNotes() { return Notes; }
        public InvoiceLineItem setNotes(String value) { this.Notes = value; return this; }
        public Boolean getIsTaxable() { return IsTaxable; }
        public InvoiceLineItem setIsTaxable(Boolean value) { this.IsTaxable = value; return this; }
        public Integer getDisplayOrder() { return DisplayOrder; }
        public InvoiceLineItem setDisplayOrder(Integer value) { this.DisplayOrder = value; return this; }
        public Boolean getIsLocked() { return IsLocked; }
        public InvoiceLineItem setIsLocked(Boolean value) { this.IsLocked = value; return this; }
        public Boolean getIsDeleted() { return IsDeleted; }
        public InvoiceLineItem setIsDeleted(Boolean value) { this.IsDeleted = value; return this; }
        public Boolean getIsPaid() { return IsPaid; }
        public InvoiceLineItem setIsPaid(Boolean value) { this.IsPaid = value; return this; }
        public Date getCreatedDate() { return CreatedDate; }
        public InvoiceLineItem setCreatedDate(Date value) { this.CreatedDate = value; return this; }
        public Date getModifiedDate() { return ModifiedDate; }
        public InvoiceLineItem setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
        public UUID getCreatedByUID() { return CreatedByUID; }
        public InvoiceLineItem setCreatedByUID(UUID value) { this.CreatedByUID = value; return this; }
    }

    public static class InsertInvoiceResponse
    {
        public ResponseStatus ResponseStatus = null;
        public InvoiceIdentification NewInvoiceIdentification = null;
        
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public InsertInvoiceResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
        public InvoiceIdentification getNewInvoiceIdentification() { return NewInvoiceIdentification; }
        public InsertInvoiceResponse setNewInvoiceIdentification(InvoiceIdentification value) { this.NewInvoiceIdentification = value; return this; }
    }

    public static class InvoiceIdentification
    {
        public Integer InvoiceId = null;
        public UUID InvoiceUid = null;
        
        public Integer getInvoiceId() { return InvoiceId; }
        public InvoiceIdentification setInvoiceId(Integer value) { this.InvoiceId = value; return this; }
        public UUID getInvoiceUid() { return InvoiceUid; }
        public InvoiceIdentification setInvoiceUid(UUID value) { this.InvoiceUid = value; return this; }
    }

}

Java InsertInvoiceRequest DTOs

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

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/invoice HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Invoice: 
	{
		InvoiceID: 0,
		InvoiceUID: 00000000000000000000000000000000,
		ProjectUID: 00000000000000000000000000000000,
		InvoiceNumber: String,
		InvoiceDate: 0001-01-01,
		DueDate: 0001-01-01,
		FromName: String,
		FromPhone: String,
		FromEmail: String,
		FromAddress: String,
		FromDesc: String,
		ToName: String,
		ToPhone: String,
		ToEmail: String,
		ToAddress: String,
		ToDesc: String,
		Notes: String,
		Currency: String,
		Status: 0,
		Total: 0,
		IsPaid: False,
		PaidDate: 0001-01-01,
		IsDeleted: False,
		IsLocked: False,
		CreatedDate: 0001-01-01,
		ModifiedDate: 0001-01-01,
		CreatedByUID: 00000000000000000000000000000000
	},
	LineItems: 
	[
		{
			InvoiceLineItemID: 0,
			InvoiceID: 0,
			Type: String,
			Name: String,
			Quantity: 0,
			PercentageAdjust: 0,
			AmountAdjust: 0,
			Price: 0,
			Description: String,
			Notes: String,
			IsTaxable: False,
			DisplayOrder: 0,
			IsLocked: False,
			IsDeleted: False,
			IsPaid: False,
			CreatedDate: 0001-01-01,
			ModifiedDate: 0001-01-01,
			CreatedByUID: 00000000000000000000000000000000
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	NewInvoiceIdentification: 
	{
		InvoiceId: 0,
		InvoiceUid: 00000000000000000000000000000000
	}
}