Field Squared API Services

<back to all web services

PricingList

Represents a DTO for a pricing list in a workspace. Calls without an ObjectId will retrieve an array of all active pricing list objects for the workspace.

The following routes are available for this service:
GET,POST,PUT,DELETE/{Workspace}/PricingList/{ObjectId}
GET/{Workspace}/PricingList
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 PricingListItem:
    object_id: Optional[str] = None
    description: Optional[str] = None
    details: Optional[str] = None
    manufacturer: Optional[str] = None
    model: Optional[str] = None
    photo: Optional[str] = None
    is_taxable: bool = False
    unit: Optional[str] = None
    unit_price: float = 0.0
    barcode: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PricingListCat:
    object_id: Optional[str] = None
    name: Optional[str] = None
    categories: Optional[List[PricingListCat]] = None
    items: Optional[List[PricingListItem]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PricingList:
    """
    Represents a DTO for a pricing list in a workspace.  Calls without an ObjectId will retrieve an array of all active pricing list objects for the workspace.
    """

    workspace: Optional[str] = None
    object_id: Optional[str] = None
    version_id: Optional[str] = None
    based_on: Optional[str] = None
    name: Optional[str] = None
    categories: Optional[List[PricingListCat]] = None
    items: Optional[List[PricingListItem]] = None

Python PricingList 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 /{Workspace}/PricingList/{ObjectId} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Workspace: String,
	ObjectId: String,
	VersionId: String,
	BasedOn: String,
	Name: String,
	Categories: 
	[
		{
			ObjectId: String,
			Name: String,
			Categories: 
			[
				{
					ObjectId: String,
					Name: String,
					Categories: 
					[
						{
							ObjectId: String,
							Name: String,
							Items: 
							[
								{
									ObjectId: String,
									Description: String,
									Details: String,
									Manufacturer: String,
									Model: String,
									Photo: String,
									IsTaxable: False,
									Unit: String,
									UnitPrice: 0,
									Barcode: String
								}
							]
						}
					],
					Items: 
					[
						{
							ObjectId: String,
							Description: String,
							Details: String,
							Manufacturer: String,
							Model: String,
							Photo: String,
							IsTaxable: False,
							Unit: String,
							UnitPrice: 0,
							Barcode: String
						}
					]
				}
			],
			Items: 
			[
				{
					ObjectId: String,
					Description: String,
					Details: String,
					Manufacturer: String,
					Model: String,
					Photo: String,
					IsTaxable: False,
					Unit: String,
					UnitPrice: 0,
					Barcode: String
				}
			]
		}
	],
	Items: 
	[
		{
			ObjectId: String,
			Description: String,
			Details: String,
			Manufacturer: String,
			Model: String,
			Photo: String,
			IsTaxable: False,
			Unit: String,
			UnitPrice: 0,
			Barcode: String
		}
	]
}