Price lists
The Price list API is used for inserting and updating prices in the CloudSuite platform. Below we include a few methods and examples. This includes customer-specific prices, contracts, and individual prices, including price tiers.
See: https://cloudsuite.atlassian.net/wiki/spaces/CFL/pages/1802502560/Data+API#Price-list-API
Below only describes how to add the pricelist itself. In order to connect the pricelist to a customer you need to add this field in the customer message
Fields
Pricelist
Field | Value |
---|---|
key | A unique key for this list |
origin | The origin for this pricelist |
type | group, party, action, contract |
name | Name of the list |
rounding | The way the prices are rounded. 0.01 means rounded by cents on 2 decimals |
kind | sale |
active | True / false |
currency | Currency for the pricelist, eq. EUR of USD |
company | Import_key of the company |
prodiuct_contracts | List of contacts |
Contract
Field | Value |
---|---|
key | Unique key for the contract within the pricelist |
origin | The origin of this contract (same as the pricelist) |
active | True / false |
lines | List of lines |
start_date | Start date of the contract |
end_date | End date of the contract |
Priceline
Field | Value | Remarks |
---|---|---|
product | The import_key of the product | |
base | Cost_price, purchase_price, list_price, nothing | Insert a value or do not set the base. Only use base when percentage=true is used. |
create_netprice | Create a net price for this product | |
additional_discount | In case of additional discounts on top of this discount | |
price_uom | The UOM of the price. | If the price is given in Kg and the sale UOM is different (per box of 12 kilos), you can use it. |
tiers - quantity | Number of items for this price/percentage | |
tiers - value | The percentage of the price itself | Use positive values for discount. |
percentage | The value in the tier is a percentage or not |
Method 1
With this method, you add one pricelist at a time and product by product.
Step 1 : Add an empty pricelist
URL
https://test.cloudsuite.io/api/origin/CLOUDSUITE/pricelist/PrijslijstA/
Method
PUT
Response
Step 2 : Add an empty contract
URL
https://test.cloudsuite.io/api/origin/CLOUDSUITE/pricelist/PrijslijstA/product_contracts/PrijslijstA_contract/
Method
PUT
Response
Step 3a : Add or update a price line
URL
https://test.cloudsuite.io/api/origin/CLOUDSUITE/pricelist/PrijslijstA/product_contracts/PrijslijstA_contract/line/PRODUCTID1/
Method
PUT / PATCH
Response
Step 3b : Delete a price line
URL
Method
DELETE
Method 2
URL
Method
PUT
Request
Method 3
If the PUT, POST, or request has a header X-CS-HANDLE-ASYNC with a value of 'yes', '1', or 'true' (case insensitive), the request will be added to a job queue and picked up by a background worker.
The response of this request should be 202 Accepted and contain a Location header with a URI where the job status can be queried. See the task endpoint for more information.
In order to get the status you need to do a task request with the given URL in the location header
This will return the status of the task. If the task is finished, it will return the result of the pricelist. Just like you send the pricelist in the sync method.
Speed comparison
Method 1
pricelist with 20K partnumbers.
1 thread ~56 min
5 threads ~13 min
10 threads ~7 min
Method 3
Full list ~ 5 minutes
© 2024 CloudSuite BV, All rights reserved