Methods
ApiClient for call a constuctor(options)
Parameters:
Name |
Type |
Description |
options |
object
|
Properties
Name |
Type |
Attributes |
Description |
accountId |
number
|
|
|
apiKey |
string
|
|
|
useTestApi |
boolean
|
<optional>
|
|
|
- Source:
getItemList(filterOptions) make request for get list of items in account
with specified filter options(filterOptions) → {array.<items>}
Parameters:
Name |
Type |
Description |
filterOptions |
object
|
see documentation about this options on 'http://api-seller.ozon.ru/' |
- Source:
Returns:
array with filtered items
-
Type
-
array.<items>
Example
const Ozon = new ApiClient({ accountId: '000', apiKey: 'xxxxx' });
const filteredItems = Ozon.getItemList({visibility: 'ALL'});
console.log(filteredItems); // array with all visibility items in account
getItemsPrices()(options) → {array}
Parameters:
Name |
Type |
Description |
options |
object
|
Properties
Name |
Type |
Description |
page |
number
|
number of page |
page_size |
number
|
size of page |
|
- Source:
Returns:
array of arrays with items [[offer_id, price, old_price, premium_price]]
-
Type
-
array
Example
const Ozon = new ApiClient({ accountId: '000', apiKey: 'xxxxx' });
const arrayOfItemsWithPrices = Ozon.getItemsPrices({page: 1, page_size: 100});
console.log(arrayOfItemsWithPrices); // array with items [[offer_id, price, old_price, premium_price]]
updatePrices(itemsWithPrices) updates prices for specified items(…itemsWithPrices) → {object}
Parameters:
Name |
Type |
Attributes |
Description |
itemsWithPrices |
itemWithPrices
|
<repeatable>
|
(object instance of 'itemWithPrices') |
- Source:
Returns:
object with update status and errors example: {updated: ok, errors: [[i, offer_id, err.code, err.msg]]}
-
Type
-
object
Example
const Ozon = new ApiClient({accountId: '000', apiKey: 'xxxxx'});
const itemForUpdatePrices = new Ozon.itemWithPrices(["offer_id", 10, 5, 3]);
Ozon.updatePrices(itemForUpdatePrices); // ==> {updated:'ok'}
updateStock(itemsWithStock) updates stocks for specified items(…itemsWithStock) → {object}
Parameters:
Name |
Type |
Attributes |
Description |
itemsWithStock |
itemWithStock
|
<repeatable>
|
(object instance of 'itemWithStock') |
- Source:
Returns:
object with update status and errors example: {updated: ok, errors: [[i, offer_id, err.code, err.msg]]}
-
Type
-
object
Example
const Ozon = new ApiClient({ accountId: '000', apiKey: 'xxxxx' });
const itemForUpdateStock = new Ozon.itemWithStock(["offer_id", 5]);
Ozon.updatePrices(itemForUpdatePrices); // ==> {updated:'ok'}}