{"action":"created","issue":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/8862","repository_url":"https://api.github.com/repos/Sylius/Sylius","labels_url":"https://api.github.com/repos/Sylius/Sylius/issues/8862/labels{/name}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/8862/comments","events_url":"https://api.github.com/repos/Sylius/Sylius/issues/8862/events","html_url":"https://github.com/Sylius/Sylius/issues/8862","id":266069631,"number":8862,"title":"Products REST API - Error when Creating/Updating Products withouth channelPricings","user":{"login":"ce-bo","id":26900540,"avatar_url":"https://avatars3.githubusercontent.com/u/26900540?v=4","gravatar_id":"","url":"https://api.github.com/users/ce-bo","html_url":"https://github.com/ce-bo","followers_url":"https://api.github.com/users/ce-bo/followers","following_url":"https://api.github.com/users/ce-bo/following{/other_user}","gists_url":"https://api.github.com/users/ce-bo/gists{/gist_id}","starred_url":"https://api.github.com/users/ce-bo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ce-bo/subscriptions","organizations_url":"https://api.github.com/users/ce-bo/orgs","repos_url":"https://api.github.com/users/ce-bo/repos","events_url":"https://api.github.com/users/ce-bo/events{/privacy}","received_events_url":"https://api.github.com/users/ce-bo/received_events","type":"User","site_admin":false},"labels":[{"id":522407518,"url":"https://api.github.com/repos/Sylius/Sylius/labels/API","name":"API","color":"1abb9c","default":false},{"id":182603,"url":"https://api.github.com/repos/Sylius/Sylius/labels/Bug","name":"Bug","color":"e10c02","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Sylius/Sylius/milestones/18","html_url":"https://github.com/Sylius/Sylius/milestone/18","labels_url":"https://api.github.com/repos/Sylius/Sylius/milestones/18/labels","id":2765468,"number":18,"title":"1.0","description":"","creator":{"login":"pamil","id":1897953,"avatar_url":"https://avatars1.githubusercontent.com/u/1897953?v=4","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":129,"state":"open","created_at":"2017-09-14T13:55:04Z","updated_at":"2017-11-08T14:04:11Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-10-17T10:17:35Z","updated_at":"2017-11-09T10:19:02Z","closed_at":null,"author_association":"NONE","body":"| Q                | A\r\n| ---------------- | -----\r\n| Bug report?      | yes\r\n| Feature request? | no\r\n| BC Break report? | no\r\n| RFC?             | no\r\n| Sylius version   | 1.0.1\r\n\r\nIf I create a product via the REST API everything is fine. \r\nAfterwards I have created a new variant with channel prices and onHand information for this product and suddenly \"channelPricings\" seems to be required for the base product. But why? Any reasons for that?\r\nProduct update requests now crashes with the following error message:\r\n\"You must define price for every channel\"\r\n\r\nFull error response body:\r\n```json\r\n{\r\n  \"code\": 400,\r\n  \"message\": \"Validation Failed\",\r\n  \"errors\": {\r\n    \"children\": {\r\n      \"enabled\": {},\r\n      \"translations\": {\r\n        \"children\": {\r\n          \"en_US\": {\r\n            \"children\": {\r\n              \"name\": {},\r\n              \"slug\": {},\r\n              \"description\": {},\r\n              \"metaKeywords\": {},\r\n              \"metaDescription\": {},\r\n              \"shortDescription\": {}\r\n            }\r\n          },\r\n          \"de_DE\": {\r\n            \"children\": {\r\n              \"name\": {},\r\n              \"slug\": {},\r\n              \"description\": {},\r\n              \"metaKeywords\": {},\r\n              \"metaDescription\": {},\r\n              \"shortDescription\": {}\r\n            }\r\n          }\r\n        }\r\n      },\r\n      \"attributes\": {},\r\n      \"associations\": {\r\n        \"children\": {\r\n          \"similar_products\": {}\r\n        }\r\n      },\r\n      \"channels\": {\r\n        \"children\": [\r\n          {},\r\n          {}\r\n        ]\r\n      },\r\n      \"mainTaxon\": {},\r\n      \"images\": {},\r\n      \"code\": {},\r\n      \"variant\": {\r\n        \"children\": {\r\n          \"translations\": {\r\n            \"children\": {\r\n              \"en_US\": {\r\n                \"children\": {\r\n                  \"name\": {}\r\n                }\r\n              },\r\n              \"de_DE\": {\r\n                \"children\": {\r\n                  \"name\": {}\r\n                }\r\n              }\r\n            }\r\n          },\r\n          \"version\": {},\r\n          \"tracked\": {},\r\n          \"shippingRequired\": {},\r\n          \"onHand\": {\r\n            \"errors\": [\r\n              \"Please enter on hand.\"\r\n            ]\r\n          },\r\n          \"width\": {},\r\n          \"height\": {},\r\n          \"depth\": {},\r\n          \"weight\": {},\r\n          \"taxCategory\": {},\r\n          \"shippingCategory\": {},\r\n          \"code\": {},\r\n          \"channelPricings\": {\r\n            \"errors\": [\r\n              \"You must define price for every channel.\"\r\n            ],\r\n            \"children\": {\r\n              \"US_WEB\": {\r\n                \"children\": {\r\n                  \"price\": {},\r\n                  \"originalPrice\": {}\r\n                }\r\n              },\r\n              \"DE_WEB\": {\r\n                \"children\": {\r\n                  \"price\": {},\r\n                  \"originalPrice\": {}\r\n                }\r\n              }\r\n            }\r\n          }\r\n        }\r\n      },\r\n      \"productTaxons\": {}\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nPHP 7.1.8\r\nWindows\r\nMozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0\r\nApache/2.4.27 (Xampp Windows)"},"comment":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/comments/343110019","html_url":"https://github.com/Sylius/Sylius/issues/8862#issuecomment-343110019","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/8862","id":343110019,"user":{"login":"ce-bo","id":26900540,"avatar_url":"https://avatars3.githubusercontent.com/u/26900540?v=4","gravatar_id":"","url":"https://api.github.com/users/ce-bo","html_url":"https://github.com/ce-bo","followers_url":"https://api.github.com/users/ce-bo/followers","following_url":"https://api.github.com/users/ce-bo/following{/other_user}","gists_url":"https://api.github.com/users/ce-bo/gists{/gist_id}","starred_url":"https://api.github.com/users/ce-bo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ce-bo/subscriptions","organizations_url":"https://api.github.com/users/ce-bo/orgs","repos_url":"https://api.github.com/users/ce-bo/repos","events_url":"https://api.github.com/users/ce-bo/events{/privacy}","received_events_url":"https://api.github.com/users/ce-bo/received_events","type":"User","site_admin":false},"created_at":"2017-11-09T10:19:01Z","updated_at":"2017-11-09T10:19:01Z","author_association":"NONE","body":"@lchrusciel Okay... I think that is not really convenient. I don't want to check which fields are allowed/required before every product PUT request. This is a bit inconsitent and makes it more difficult to use the API.\r\n\r\nAny ideas how to solve this?"}}
{"actor":{"display_login":"ce-bo"}}