Support for

FLAPI: Product Pricing

John Valentine
by John Valentine 10 years ago
 

Request 'product pricing' by 'product code'

GET Syntax
/products/<product.id>/prices

Retrieves pricing for the requested product. All available service levels are returned, though usually only one will be present.

selling = price that a workgroup sells at. 
transfer = price that a workgroup buys at. 
production = cost that a workgroup incurs from third party suppliers (Marketplace, or workgroup suppliers).

HTTP request
GET http://dev.flyerlink.com/api.php/products/MBG3L5T?/prices?format=json
HTTP response (JSON)
{
    "services" : [{
            "adddays" : "2",
            "batches" : [{
                    "selling" : 64,
                    "transfer" : <float>,
                    "production" : 0,
                    "_attrs" : {
                        "batch" : 1
                    }
                }
                ... <other 'batch' items> ...
                }, {
                    "selling" : 164,
                    "transfer" : <float>,
                    "production" : 0,
                    "_attrs" : {
                        "batch" : 10
                    }
                }, {
                    "selling" : 7, 
                    "transfer" : <float>,
                    "production" : 0,
                    "_attrs" : {
                        "batch" : "runon"
                    }
                }
            ]
        }
    ]
}

Set 'product pricing' by 'product code'

POST Syntax
/products/<product.id>/prices/

Sets pricing for the requested product. 

Important: Each price has three aspects, and all possible combinations of [turnaround], [batches], [transaction type] for the product must be set in one request. The pricing for a product is wiped immediately before your new data is entered, so any omitted combinations will be erased.

Be sure to include data for your product’s ‘base turnaround’ where turnaround = product.days. This is the only turnaround that you must specify; pricing for other turnaround values (within your allowed range) is optional.

The format of each entry is:

prices[turnaround][batches][type]=value.

All three must be included in a request.

  • Your assigned territory.
  • production turnaround, in working days.
  • batches (quantity = batches × product.units). 
  • transaction type: { selling | transfer | production }.
  • value: price amount.

Below is the simplest example, for a turnaround of 2 production days, and only 1 batch. Note: we've put line-feeds before each & for legibility.

HTTP request
POST http://dev.flyerlink.com/api.php/products/MBG3L5T/prices
territory=TEMP
&prices[2][1][selling]=50
&prices[2][1][transfer]=40
&prices[2][1][production]=0
&format=json
 

Jump to contents page of

FLAPI: Products

 
 
 

All content is (c) Nettl Systems Limited, 2024 and may not be used, copied or distributed without permission.