Trendsic Platform Service

<back to all web services

InvoiceGenerateRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/invoice/generate/{ProjectUID}/{InvoiceStartDate}/{InvoiceEndDate}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InvoiceLineItem:
    invoice_line_item_i_d: int = 0
    invoice_i_d: int = 0
    type: Optional[str] = None
    name: Optional[str] = None
    quantity: Optional[int] = None
    percentage_adjust: Optional[Decimal] = None
    amount_adjust: Optional[Decimal] = None
    price: Optional[Decimal] = None
    description: Optional[str] = None
    notes: Optional[str] = None
    is_taxable: Optional[bool] = None
    display_order: Optional[int] = None
    is_locked: Optional[bool] = None
    is_deleted: Optional[bool] = None
    is_paid: Optional[bool] = None
    created_date: Optional[datetime.datetime] = None
    modified_date: Optional[datetime.datetime] = None
    created_by_u_i_d: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InvoiceGenerateResponse:
    response_status: Optional[ResponseStatus] = None
    project_invoice: List[InvoiceLineItem] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InvoiceGenerateRequest:
    project_u_i_d: Optional[str] = None
    invoice_start_date: datetime.datetime = datetime.datetime(1, 1, 1)
    invoice_end_date: datetime.datetime = datetime.datetime(1, 1, 1)

Python InvoiceGenerateRequest 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.

GET /v1/invoice/generate/{ProjectUID}/{InvoiceStartDate}/{InvoiceEndDate} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
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
		}
	},
	ProjectInvoice: 
	[
		{
			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
		}
	]
}