|
| 1 | +### Product draft UUID |
| 2 | + |
| 3 | +::: info |
| 4 | +The following endpoints are largely the same as for [products](/php-client/resources.html#products-draft). The difference? Here, you can query or drafts identified by their uuid. More information [here](/content/getting-started/from-identifiers-to-uuid-7x/welcome.md). |
| 5 | +::: |
| 6 | + |
| 7 | +#### Get a product draft |
| 8 | +::: php-client-availability versions=10.0 |
| 9 | + |
| 10 | +```php |
| 11 | +$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin'); |
| 12 | + |
| 13 | +/* |
| 14 | + * Returns an array like this: |
| 15 | + * [ |
| 16 | + * 'uuid' => '12951d98-210e-4bRC-ab18-7fdgf1bd14f3', |
| 17 | + * 'enabled' => true, |
| 18 | + * 'family' => 'tshirt', |
| 19 | + * 'categories' => ['summer_collection'], |
| 20 | + * 'groups' => [], |
| 21 | + * 'values' => [ |
| 22 | + * 'name' => [ |
| 23 | + * [ |
| 24 | + * 'data' => 'Top', |
| 25 | + * 'locale' => 'en_US', |
| 26 | + * 'scope' => null |
| 27 | + * ], |
| 28 | + * [ |
| 29 | + * 'data' => 'Débardeur', |
| 30 | + * 'locale' => 'fr_FR', |
| 31 | + * 'scope' => null |
| 32 | + * ], |
| 33 | + * ], |
| 34 | + * ], |
| 35 | + * 'created' => '2016-06-23T18:24:44+02:00', |
| 36 | + * 'updated' => '2016-06-25T17:56:12+02:00', |
| 37 | + * 'associations' => [ |
| 38 | + * 'PACK' => [ |
| 39 | + * 'products' => [ |
| 40 | + * 'sunglass' |
| 41 | + * ], |
| 42 | + * 'groups' => [], |
| 43 | + * 'product_models' => [] |
| 44 | + * ], |
| 45 | + * ], |
| 46 | + * 'quantified_associations' => [ |
| 47 | + * 'PRODUCT_SET' => [ |
| 48 | + * 'products' => [ |
| 49 | + * ['uuid' => '5719e119-613c-49af-9244-fa39a9e0cb1d', 'quantity' => 2], |
| 50 | + * ], |
| 51 | + * 'product_models' => [], |
| 52 | + * ], |
| 53 | + * ], |
| 54 | + * 'metadata' => [ |
| 55 | + * 'workflow_status' => 'draft_in_progress', |
| 56 | + * ], |
| 57 | + * ] |
| 58 | + */ |
| 59 | +$draftProduct = $client->getProductDraftUuidApi()->get('12951d98-210e-4bRC-ab18-7fdgf1bd14f3'); |
| 60 | +``` |
| 61 | + |
| 62 | +You can get more information about the returned format of the product values [here](/concepts/products.html#focus-on-the-product-values). |
| 63 | + |
| 64 | +The field `metadata` is specific to Akeneo PIM Enterprise Edition. The status of the draft is specified in this field. |
| 65 | + |
| 66 | +#### Submit a product draft for approval |
| 67 | +::: php-client-availability versions=10.0 |
| 68 | + |
| 69 | +```php |
| 70 | +$client = new \Akeneo\Pim\ApiClient\AkeneoPimClientBuilder('http://akeneo.com/')->buildAuthenticatedByPassword('client_id', 'secret', 'admin', 'admin'); |
| 71 | + |
| 72 | +$client->getProductDraftUuidApi()->submitForApproval('12951d98-210e-4bRC-ab18-7fdgf1bd14f3'); |
| 73 | +``` |
| 74 | + |
| 75 | +It is mandatory that the user already created a draft for this product, and that this draft was not approved yet. |
0 commit comments