Trendsic Platform Service

<back to all web services

GetInvoicesByProjectRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/invoice/project/{ProjectUID}
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 GetInvoicesByProjectRequest:
    project_u_i_d: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Invoice:
    invoice_i_d: int = 0
    invoice_u_i_d: Optional[str] = None
    project_u_i_d: Optional[str] = None
    invoice_number: Optional[str] = None
    invoice_date: Optional[datetime.datetime] = None
    due_date: Optional[datetime.datetime] = None
    from_name: Optional[str] = None
    from_phone: Optional[str] = None
    from_email: Optional[str] = None
    from_address: Optional[str] = None
    from_desc: Optional[str] = None
    to_name: Optional[str] = None
    to_phone: Optional[str] = None
    to_email: Optional[str] = None
    to_address: Optional[str] = None
    to_desc: Optional[str] = None
    notes: Optional[str] = None
    currency: Optional[str] = None
    status: int = 0
    total: Optional[Decimal] = None
    is_paid: Optional[bool] = None
    paid_date: Optional[datetime.datetime] = None
    is_deleted: Optional[bool] = None
    is_locked: 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 ProjectInvoiceData:
    invoiced_amount: Optional[Decimal] = None
    paid_amount: Optional[Decimal] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetInvoicesByProjectResponse:
    response_status: Optional[ResponseStatus] = None
    invoices: List[Invoice] = field(default_factory=list)
    project_invoice_data: Optional[ProjectInvoiceData] = None

Python GetInvoicesByProjectRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /v1/invoice/project/{ProjectUID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Invoices":[{"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"}],"ProjectInvoiceData":{"InvoicedAmount":0,"PaidAmount":0}}