| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/invoice |
|---|
"use strict";
export class Invoice {
/** @param {{InvoiceID?:number,InvoiceUID?:string,ProjectUID?:string,InvoiceNumber?:string,InvoiceDate?:string,DueDate?:string,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?:number,Total?:number,IsPaid?:boolean,PaidDate?:string,IsDeleted?:boolean,IsLocked?:boolean,CreatedDate?:string,ModifiedDate?:string,CreatedByUID?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
InvoiceID;
/** @type {?string} */
InvoiceUID;
/** @type {?string} */
ProjectUID;
/** @type {string} */
InvoiceNumber;
/** @type {?string} */
InvoiceDate;
/** @type {?string} */
DueDate;
/** @type {string} */
FromName;
/** @type {string} */
FromPhone;
/** @type {string} */
FromEmail;
/** @type {string} */
FromAddress;
/** @type {string} */
FromDesc;
/** @type {string} */
ToName;
/** @type {string} */
ToPhone;
/** @type {string} */
ToEmail;
/** @type {string} */
ToAddress;
/** @type {string} */
ToDesc;
/** @type {string} */
Notes;
/** @type {string} */
Currency;
/** @type {number} */
Status;
/** @type {?number} */
Total;
/** @type {?boolean} */
IsPaid;
/** @type {?string} */
PaidDate;
/** @type {?boolean} */
IsDeleted;
/** @type {?boolean} */
IsLocked;
/** @type {?string} */
CreatedDate;
/** @type {?string} */
ModifiedDate;
/** @type {?string} */
CreatedByUID;
}
export class InvoiceLineItem {
/** @param {{InvoiceLineItemID?:number,InvoiceID?:number,Type?:string,Name?:string,Quantity?:number,PercentageAdjust?:number,AmountAdjust?:number,Price?:number,Description?:string,Notes?:string,IsTaxable?:boolean,DisplayOrder?:number,IsLocked?:boolean,IsDeleted?:boolean,IsPaid?:boolean,CreatedDate?:string,ModifiedDate?:string,CreatedByUID?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
InvoiceLineItemID;
/** @type {number} */
InvoiceID;
/** @type {string} */
Type;
/** @type {string} */
Name;
/** @type {?number} */
Quantity;
/** @type {?number} */
PercentageAdjust;
/** @type {?number} */
AmountAdjust;
/** @type {?number} */
Price;
/** @type {string} */
Description;
/** @type {string} */
Notes;
/** @type {?boolean} */
IsTaxable;
/** @type {?number} */
DisplayOrder;
/** @type {?boolean} */
IsLocked;
/** @type {?boolean} */
IsDeleted;
/** @type {?boolean} */
IsPaid;
/** @type {?string} */
CreatedDate;
/** @type {?string} */
ModifiedDate;
/** @type {?string} */
CreatedByUID;
}
export class InsertInvoiceRequest {
/** @param {{Invoice?:Invoice,LineItems?:InvoiceLineItem[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {Invoice} */
Invoice;
/** @type {InvoiceLineItem[]} */
LineItems = [];
}
export class InvoiceIdentification {
/** @param {{InvoiceId?:number,InvoiceUid?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
InvoiceId;
/** @type {string} */
InvoiceUid;
}
export class InsertInvoiceResponse {
/** @param {{ResponseStatus?:ResponseStatus,NewInvoiceIdentification?:InvoiceIdentification}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ResponseStatus} */
ResponseStatus;
/** @type {InvoiceIdentification} */
NewInvoiceIdentification;
}
JavaScript InsertInvoiceRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Invoice":{"InvoiceID":0,"InvoiceUID":"00000000000000000000000000000000","ProjectUID":"00000000000000000000000000000000","InvoiceNumber":"String","InvoiceDate":"0001-01-01T00:00:00.0000000","DueDate":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000","IsDeleted":false,"IsLocked":false,"CreatedDate":"0001-01-01T00:00:00.0000000","ModifiedDate":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000","ModifiedDate":"0001-01-01T00:00:00.0000000","CreatedByUID":"00000000000000000000000000000000"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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"}}