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

export class PricingListItem
{
    public ObjectId: string;
    public Description: string;
    public Details: string;
    public Manufacturer: string;
    public Model: string;
    public Photo: string;
    public IsTaxable: boolean;
    public Unit: string;
    public UnitPrice: number;
    public Barcode: string;

    public constructor(init?: Partial<PricingListItem>) { (Object as any).assign(this, init); }
}

export class PricingListCat
{
    public ObjectId: string;
    public Name: string;
    public Categories: PricingListCat[];
    public Items: PricingListItem[];

    public constructor(init?: Partial<PricingListCat>) { (Object as any).assign(this, init); }
}

/** @description 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. */
export class PricingList
{
    public Workspace: string;
    public ObjectId: string;
    public VersionId: string;
    public BasedOn: string;
    public Name: string;
    public Categories: PricingListCat[];
    public Items: PricingListItem[];

    public constructor(init?: Partial<PricingList>) { (Object as any).assign(this, init); }
}

TypeScript PricingList DTOs

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

HTTP + CSV

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/csv
Content-Type: text/csv
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"}]}