V
V
Valeriu Vodnicear2019-06-28 17:25:47
PHP
Valeriu Vodnicear, 2019-06-28 17:25:47

How to update the category parent in MySklad?

On the site, when editing categories, you can change the parent.
For the given parent, I have externalCode.
The documentation says what needs to be updated $item->productFolder.
I try to update like this:

$item->name = $new['name'];
$item->description = htmlspecialchars_decode($new['description']);
$parent_id = 'cd1676e3-5a04-11e9-9ff4-31500040606a';
$item->relations->productFolder->fields->meta->href = 'https://online.moysklad.ru/api/remap/1.1/entity/productfolder/' . $parent_id;
$item->relations->productFolder->fields->meta->uuidHref = 'https://online.moysklad.ru/app/#good/edit?id=' . $parent_id;
$res_ms = $item->buildUpdate()->execute();

The name and description change, but the "parent category" does not.
Can you suggest how to fix it?
Ready to make a request and update via curl, only there is not enough information in the documentation.
I'm using the SDK .
issue

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question