| GET,POST,PUT,DELETE | /{Workspace}/PricingList/{ObjectId} | ||
|---|---|---|---|
| GET | /{Workspace}/PricingList |
import Foundation
import ServiceStack
/**
* 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.
*/
public class PricingList : Codable
{
public var workspace:String
public var objectId:String
public var versionId:String
public var basedOn:String
public var name:String
public var categories:[PricingListCat] = []
public var items:[PricingListItem] = []
required public init(){}
}
public class PricingListCat : Codable
{
public var objectId:String
public var name:String
public var categories:[PricingListCat] = []
public var items:[PricingListItem] = []
required public init(){}
}
public class PricingListItem : Codable
{
public var objectId:String
public var Description:String
public var details:String
public var manufacturer:String
public var model:String
public var photo:String
public var isTaxable:Bool
public var unit:String
public var unitPrice:Double
public var barcode:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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
}
]
}