Purchase Prices v3

Get Price Lists

get /price-lists

Get list of price lists. The returned list is sorted by created_at in ascending order.

PARAMETERS
eshop_id
integer
query
REQUIRED

Filter on Eshop ID, the returned items will include price lists owned by the eshop and also price lists assigned by other eshops.

num
integer
query

Maximum numbers of items to return.

Default: 10
next
string
query

The next cursor from previous request to continue pagination.

Returns

Successful. Returns an envelope for price lists.

gethttps://purchaseprices.sitooapis.com/v3/price-lists?eshop_id=1
RESPONSE JSON
{
"items": [
{
"id": "A",
"created_at": 123456789,
"modified_at": 123456789,
"owner_eshop_id": 1,
"name": "Franchise A",
"currency": "SEK"
}
],
"next": ""
}
HTTP Status Code Summary
200Successful. Returns an envelope for price lists.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
500Internal Server Error

Add Price List

post /price-lists

Add a price list.

REQUEST BODY
object
REQUIRED

A price list.

PriceList
Returns

Successful. Returns a price list.

posthttps://purchaseprices.sitooapis.com/v3/price-lists
{
"id": "A",
"owner_eshop_id": 1,
"name": "Franchise A",
"currency": "SEK"
}
RESPONSE JSON
{
"id": "A",
"created_at": 123456789,
"modified_at": 123456789,
"owner_eshop_id": 1,
"name": "Franchise A",
"currency": "SEK"
}
HTTP Status Code Summary
201Successful. Returns a price list.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
500Internal Server Error

Get Price List

get /price-lists/{price_list_id}

Returns a price list with the specified ID.

PARAMETERS
price_list_id
string
path
REQUIRED

The price list ID.

Returns

Successful. Returns a price list.

gethttps://purchaseprices.sitooapis.com/v3/price-lists/A
RESPONSE JSON
{
"id": "A",
"created_at": 123456789,
"modified_at": 123456789,
"owner_eshop_id": 1,
"name": "Franchise A",
"currency": "SEK"
}
HTTP Status Code Summary
200Successful. Returns a price list.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Update Price List

put /price-lists/{price_list_id}

Update a price list with the specified ID.

PARAMETERS
price_list_id
string
path
REQUIRED

The price list ID.

REQUEST BODY
object
REQUIRED

A price list.

PriceList
Returns

Successful. Returns a price list.

puthttps://purchaseprices.sitooapis.com/v3/price-lists/A
{
"id": "A",
"owner_eshop_id": 1,
"name": "Franchise A",
"currency": "SEK"
}
RESPONSE JSON
{
"id": "A",
"created_at": 123456789,
"modified_at": 123456789,
"owner_eshop_id": 1,
"name": "Franchise A",
"currency": "SEK"
}
HTTP Status Code Summary
200Successful. Returns a price list.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Delete Price List

delete /price-lists/{price_list_id}

Delete a price lists and all of it's items.

PARAMETERS
price_list_id
string
path
REQUIRED

The price list ID.

deletehttps://purchaseprices.sitooapis.com/v3/price-lists/A
HTTP Status Code Summary
200Successful. Deleted the price list.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Get Price List Items

get /price-lists/{price_list_id}/items

Get 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.

PARAMETERS
sku_list
array (string)
query

Filter on SKU. Use comma as separator for multiple values.

num
integer
query

Maximum numbers of items to return.

Default: 10
next
string
query

The next cursor from previous request to continue pagination.

price_list_id
string
path
REQUIRED

The price list ID.

Returns

Successful. Returns an envelope for price list items.

gethttps://purchaseprices.sitooapis.com/v3/price-lists/A/items?sku_list=123456,234567
RESPONSE JSON
{
"items": [
{
"sku": "123456",
"price": 12300
},
{
"sku": "234567",
"price": 23400
}
],
"next": ""
}
HTTP Status Code Summary
200Successful. Returns an envelope for price list items.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Set Price List Items

put /price-lists/{price_list_id}/items

Set items (prices) for the price lists with the specified ID.

PARAMETERS
price_list_id
string
path
REQUIRED

The price list ID.

REQUEST BODY
object
REQUIRED

An object with a property containing price list items.

PriceListItems
Returns

Successful. Returns an object with a property containing the updated price list items.

puthttps://purchaseprices.sitooapis.com/v3/price-lists/A/items
{
"items": [
{
"sku": "123456",
"price": 12300
},
{
"sku": "234567",
"price": 23400
}
]
}
RESPONSE JSON
{
"items": [
{
"sku": "123456",
"price": 12300
},
{
"sku": "234567",
"price": 23400
}
]
}
HTTP Status Code Summary
200Successful. Returns an object with a property containing the updated price list items.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Delete Price List Items

delete /price-lists/{price_list_id}/items

Delete items (prices) for the price lists with the specified ID.

PARAMETERS
sku_list
array (string)
query
REQUIRED

SKUs to delete prices for. Use comma as separator for multiple values.

price_list_id
string
path
REQUIRED

The price list ID.

deletehttps://purchaseprices.sitooapis.com/v3/price-lists/A/items?sku_list=123456,234567,345678
HTTP Status Code Summary
200Successful. Deleted the price list items for the SKUs provided.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Get Mapping

get /mappings/{mapping_id}

Get mapping between eshop and price lists.

PARAMETERS
mapping_id
integer
path
REQUIRED

Eshop ID used to identify a mapping.

Returns

Successful. Returns eshop mapping.

gethttps://purchaseprices.sitooapis.com/v3/mappings/1
RESPONSE JSON
{
"id": 1,
"assigned": {
"price_list_id": "A"
},
"shared": {
"2": {
"price_list_id": "A",
"stores": {
"200": {
"price_list_id": "B"
}
}
}
}
}
HTTP Status Code Summary
200Successful. Returns eshop mapping.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
404The specified resource was not found
500Internal Server Error

Set Mapping

put /mappings/{mapping_id}

Set mapping between eshop and price lists.

PARAMETERS
mapping_id
integer
path
REQUIRED

Eshop ID used to identify a mapping.

REQUEST BODY
object
REQUIRED

The object mapping between an eshop and purchase price lists.

Mapping
Returns

Successful. Returns a mapping.

puthttps://purchaseprices.sitooapis.com/v3/mappings/1
{
"assigned": {
"price_list_id": "A"
},
"shared": {
"2": {
"price_list_id": "A",
"stores": {
"200": {
"price_list_id": "B"
}
}
}
}
}
RESPONSE JSON
{
"id": 1,
"assigned": {
"price_list_id": "A"
},
"shared": {
"2": {
"price_list_id": "A",
"stores": {
"200": {
"price_list_id": "B"
}
}
}
}
}
HTTP Status Code Summary
200Successful. Returns a mapping.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
500Internal Server Error

Get Computed Purchase Prices

post /computed-prices

Get 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.

REQUEST BODY
object
REQUIRED

Computed purchase prices.

ComputedPrices
Returns

Successful. Returns computed purchase prices.

posthttps://purchaseprices.sitooapis.com/v3/computed-prices
{
"eshop_id": 2,
"target_eshop_id": 1,
"store_id": "200",
"currency": "SEK",
"sku_list": [
"123456",
"234567",
"345678"
]
}
RESPONSE JSON
{
"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
200Successful. Returns computed purchase prices.
400Invalid request. Data sent from client is invalid
401Missing or bad authentication
403User is not authorized to perform operation
500Internal Server Error

Objects

PriceListEnvelope
object

Envelope for get price list operation.

PROPERTIES
items
array
REQUIRED

Returned price lists

next
string
REQUIRED

Next cursor, used to continue pagination. Empty string will be returned if all data has been delivered.

PriceListItemEnvelope
object

Envelope for get price list item operation.

PROPERTIES
items
REQUIRED

Returned price list items

next
string
REQUIRED

Next cursor, used to continue pagination. Empty string will be returned if all data has been delivered.

PriceList
object

A price list.

PROPERTIES
id
string
REQUIRED

Unique ID of the price list. If ID is passed as empty string when creating a price list, one will be generated.

Pattern: ^[A-Za-z0-9\._-]{0,64}$
created_at
integer
(int64)
READ ONLY
REQUIRED

The timestamp for when the price list was created.

modified_at
integer
(int64)
READ ONLY
REQUIRED

Date last modified. Will also be updated if any items have changed.

owner_eshop_id
integer
(int64)
REQUIRED

The eshop ID that is the owner of this price list.

name
string
REQUIRED

The name of the price list.

Max Length: 128
Min Length: 1
currency
string
(iso-4217)
REQUIRED

The currency for this price list. (ISO 4217, Alpha-3 uppercased)

shared_store_ids
array
(string)
READ ONLY

Store ID's that the price list is shared to

PriceListItem
object

PROPERTIES
sku
string
REQUIRED

The SKU of the product which the price is for.

Pattern: ^[^\x00-\x1F\x7F\s]{1,2}$|^[^\x00-\x1F\x7F\s][^\x00-\x1F\x7F]{1,126}[^\x00-\x1F\x7F\s]$
Max Length: 128
Min Length: 1
price
integer
(int64)
REQUIRED

Price in cents (1/100 of the currency, e.g. 100 in currency euro is 1.00 euro).

Minimum: 0

PriceListItems
object

PROPERTIES
items
REQUIRED

Array of price list items.

MappingItem
object

Mapping for an eshop.

PROPERTIES
price_list_id
string
REQUIRED

The default price list for the eshop.

stores

Stores can have their own price list. Key for this map is store_id (externalid of a store in Sitoo).

Default: {}
<*>
object

Mapping
object

In order to use a price list they must be mapped to an eshop or store. Only price lists owned can be mapped.

PROPERTIES
id
integer
(int64)
READ ONLY
REQUIRED

Owner eshop of the mapping. Can only be one mapping per eshop.

assigned

The mapping for the owner eshop.

price_list_id
string
REQUIRED

The default price list for the eshop.

stores

Stores can have their own price list. Key for this map is store_id (externalid of a store in Sitoo).

Default: {}
shared
object

<eshop_id, MappingItem>. The shared mapping.

<*>
object

ComputedPrices
object

PROPERTIES
eshop_id
integer
(int64)
REQUIRED

The ID for the eshop that is requesting the computed purchase prices.

target_eshop_id
integer
(int64)

Optional ID for another eshop that the purchase prices returned should be computed for.

store_id
string

Optional ID for the store that the computed purchase prices should be calculated for.

currency
string
(iso-4217)
REQUIRED

The currency prices will be computed for, only price lists with this currency will be used. (ISO 4217, Alpha-3 uppercased)

sku_list
array
(string)
WRITE ONLY
REQUIRED

A list of SKUs that you want to return purchase prices for.

Pattern: ^[^\x00-\x1F\x7F\s]{1,2}$|^[^\x00-\x1F\x7F\s][^\x00-\x1F\x7F]{1,126}[^\x00-\x1F\x7F\s]$
purchase_prices
object
READ ONLY
REQUIRED

Map of prices with SKU as key.

<*>
object

ErrorCode
string

Error codes and additional info in error_data:

Error codeAdditional info
field-missingfield
field-unknownfield
field-readonlyfield
field-typefield
field-validationfield
condition-failednone
othernone

ErrorMessage
object

Error object returned when a request is not successful

PROPERTIES
request_id
string
REQUIRED

ID of request

error_code
REQUIRED

The error code returned.

error_data
object
REQUIRED

More data depending on the error code

<*>
string