Trendsic Platform Service

<back to all web services

PortalQuoteRequest

The following routes are available for this service:
GET,OPTIONS/portal/{Token}/quote
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 QuoteItem:
    quote_item_i_d: int = 0
    quote_i_d: int = 0
    item_type: Optional[str] = None
    source_ref_id: Optional[int] = None
    job_i_d: Optional[int] = None
    name: Optional[str] = None
    description: Optional[str] = None
    quantity: Optional[Decimal] = None
    unit_price: Optional[Decimal] = None
    is_taxable: Optional[bool] = None
    display_order: Optional[int] = None
    is_deleted: Optional[bool] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PortalQuoteResponse:
    response_status: Optional[ResponseStatus] = None
    name: Optional[str] = None
    status: Optional[str] = None
    currency: Optional[str] = None
    total: Decimal = decimal.Decimal(0)
    notes: Optional[str] = None
    from_name: Optional[str] = None
    from_address: Optional[str] = None
    to_name: Optional[str] = None
    to_address: Optional[str] = None
    expires_at: Optional[datetime.datetime] = None
    is_locked: bool = False
    final_price_after_completion: bool = False
    approved_by_name: Optional[str] = None
    approved_at: Optional[datetime.datetime] = None
    declined_by_name: Optional[str] = None
    declined_at: Optional[datetime.datetime] = None
    decline_reason: Optional[str] = None
    line_items: List[QuoteItem] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PortalQuoteRequest:
    token: Optional[str] = None

Python PortalQuoteRequest 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 /portal/{Token}/quote 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
		}
	},
	Name: String,
	Status: String,
	Currency: String,
	Total: 0,
	Notes: String,
	FromName: String,
	FromAddress: String,
	ToName: String,
	ToAddress: String,
	ExpiresAt: 0001-01-01,
	IsLocked: False,
	FinalPriceAfterCompletion: False,
	ApprovedByName: String,
	ApprovedAt: 0001-01-01,
	DeclinedByName: String,
	DeclinedAt: 0001-01-01,
	DeclineReason: String,
	LineItems: 
	[
		{
			QuoteItemID: 0,
			QuoteID: 0,
			ItemType: String,
			SourceRefId: 0,
			JobID: 0,
			Name: String,
			Description: String,
			Quantity: 0,
			UnitPrice: 0,
			IsTaxable: False,
			DisplayOrder: 0,
			IsDeleted: False
		}
	]
}