Purchase Prices v3
Get Price Lists
get /price-listsGet list of price lists. The returned list is sorted by created_at
in ascending order.
Filter on Eshop ID, the returned items will include price lists owned by the eshop and also price lists assigned by other eshops.
Maximum numbers of items to return.
The next cursor from previous request to continue pagination.
{ "items": [ { "id": "A", "created_at": 123456789, "modified_at": 123456789, "owner_eshop_id": 1, "name": "Franchise A", "currency": "SEK" } ], "next": ""}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns an envelope for price lists. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
500 | Internal Server Error |
Add Price List
post /price-listsAdd a price list.
{ "id": "A", "owner_eshop_id": 1, "name": "Franchise A", "currency": "SEK"}
{ "id": "A", "created_at": 123456789, "modified_at": 123456789, "owner_eshop_id": 1, "name": "Franchise A", "currency": "SEK"}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns a price list. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
500 | Internal Server Error |
Get Price List
get /price-lists/{price_list_id}Returns a price list with the specified ID.
The price list ID.
{ "id": "A", "created_at": 123456789, "modified_at": 123456789, "owner_eshop_id": 1, "name": "Franchise A", "currency": "SEK"}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns a price list. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Update Price List
put /price-lists/{price_list_id}Update a price list with the specified ID.
{ "id": "A", "owner_eshop_id": 1, "name": "Franchise A", "currency": "SEK"}
{ "id": "A", "created_at": 123456789, "modified_at": 123456789, "owner_eshop_id": 1, "name": "Franchise A", "currency": "SEK"}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns a price list. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Delete Price List
delete /price-lists/{price_list_id}Delete a price lists and all of it's items.
The price list ID.
HTTP Status Code Summary | |
---|---|
200 | Successful. Deleted the price list. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Get Price List Items
get /price-lists/{price_list_id}/itemsGet items (prices) for the price lists with the specified ID. The items will be sorted by SKU ascending except when sku_list is provided which will sort it in same order as the sku_list.
Filter on SKU. Use comma as separator for multiple values.
Maximum numbers of items to return.
The next cursor from previous request to continue pagination.
The price list ID.
{ "items": [ { "sku": "123456", "price": 12300 }, { "sku": "234567", "price": 23400 } ], "next": ""}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns an envelope for price list items. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Set Price List Items
put /price-lists/{price_list_id}/itemsSet items (prices) for the price lists with the specified ID.
The price list ID.
An object with a property containing price list items.
Successful. Returns an object with a property containing the updated price list items.
{ "items": [ { "sku": "123456", "price": 12300 }, { "sku": "234567", "price": 23400 } ]}
{ "items": [ { "sku": "123456", "price": 12300 }, { "sku": "234567", "price": 23400 } ]}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns an object with a property containing the updated price list items. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Delete Price List Items
delete /price-lists/{price_list_id}/itemsDelete items (prices) for the price lists with the specified ID.
SKUs to delete prices for. Use comma as separator for multiple values.
The price list ID.
HTTP Status Code Summary | |
---|---|
200 | Successful. Deleted the price list items for the SKUs provided. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Get Mapping
get /mappings/{mapping_id}Get mapping between eshop and price lists.
Eshop ID used to identify a mapping.
{ "id": 1, "assigned": { "price_list_id": "A" }, "shared": { "2": { "price_list_id": "A", "stores": { "200": { "price_list_id": "B" } } } }}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns a mapping. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
404 | The specified resource was not found |
500 | Internal Server Error |
Set Mapping
put /mappings/{mapping_id}Set mapping between eshop and price lists.
{ "assigned": { "price_list_id": "A" }, "shared": { "2": { "price_list_id": "A", "stores": { "200": { "price_list_id": "B" } } } }}
{ "id": 1, "assigned": { "price_list_id": "A" }, "shared": { "2": { "price_list_id": "A", "stores": { "200": { "price_list_id": "B" } } } }}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns a mapping. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
500 | Internal Server Error |
Get Computed Purchase Prices
post /computed-pricesGet computed prices for SKUs according to the mappings between eshop and price lists. If multiple price lists are shared, they are evaluted in price list ID ascending order meaning it will pick the first encountered price for the SKU.
Computed purchase prices.
{ "eshop_id": 2, "target_eshop_id": 1, "store_id": "200", "currency": "SEK", "sku_list": [ "123456", "234567", "345678" ]}
{ "eshop_id": 2, "target_eshop_id": 1, "store_id": "200", "currency": "SEK", "purchase_prices": { "123456": { "price": 12300, "price_list_id": "A" }, "234567": { "price": 23400, "price_list_id": "A" } }}
HTTP Status Code Summary | |
---|---|
200 | Successful. Returns computed purchase prices. |
400 | Invalid request. Data sent from client is invalid |
401 | Missing or bad authentication |
403 | User is not authorized to perform operation |
500 | Internal Server Error |
Objects
PriceListEnvelopeobject
Envelope for get price list operation.
Returned price lists
Next cursor, used to continue pagination. Empty string will be returned if all data has been delivered.
PriceListItemEnvelopeobject
Envelope for get price list item operation.
Returned price list items
Next cursor, used to continue pagination. Empty string will be returned if all data has been delivered.
PriceListobject
A price list.
Unique ID of the price list. If ID is passed as empty string when creating a price list, one will be generated.
The timestamp for when the price list was created.
Date last modified. Will also be updated if any items have changed.
The eshop ID that is the owner of this price list.
The name of the price list.
The currency for this price list. (ISO 4217, Alpha-3 uppercased)
Store ID's that the price list is shared to (externalid
property of the Store in Sitoo).
PriceListItemobject
The SKU of the product which the price is for.
Price in cents (1/100 of the currency, e.g. 100 in currency euro is 1.00 euro).
PriceListItemsobject
Array of price list items.
MappingItemobject
Mapping for an eshop.
The default price list for the eshop.
Stores can have their own price list. Key for this map is store_id
(externalid
property of the Store in Sitoo).
Mappingobject
In order to use a price list they must be mapped to an eshop or store. Only price lists owned can be mapped.
Owner eshop of the mapping. Can only be one mapping per eshop.
The mapping for the owner eshop.
<eshop_id, MappingItem>. The shared mapping.
ComputedPricesobject
The ID for the eshop that is requesting the computed purchase prices.
Optional ID for another eshop that the purchase prices returned should be computed for.
Optional ID for the store that the computed purchase prices should be calculated for (externalid
property of the Store in Sitoo).
The currency prices will be computed for, only price lists with this currency will be used. (ISO 4217, Alpha-3 uppercased)
A list of SKUs that you want to return purchase prices for.
Map of prices with SKU as key.
ErrorCodestring
Error codes and additional info in error_data:
Error code Additional info field-missing field field-unknown field field-readonly field field-type field field-validation field condition-failed none other none
ErrorMessageobject
Error object returned when a request is not successful
ID of request
The error code returned.
More data depending on the error code