{"info":{"_postman_id":"35ddfeeb-8548-4cb6-ba8d-0c9162d9070c","name":"Magento 2 Custom Stock Status GraphQl & Examples","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"10589000","collectionId":"35ddfeeb-8548-4cb6-ba8d-0c9162d9070c","publishedId":"SzfDvjfh","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-04-28T08:52:55.000Z"},"item":[{"name":"Get label, image product","id":"0d8a89fc-8b32-4b2c-a693-461831d233cb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{admin_token}}","type":"text"}],"body":{"mode":"graphql","graphql":{"query":"{\r\nproducts(filter: {}) {\r\n\titems {\r\n    sku\r\n    mp_stock_status {\r\n      image\r\n      label\r\n    }\r\n}\r\n\ttotal_count\r\n\tpage_info {\r\n\t\tcurrent_page\r\n\t\tpage_size\r\n\t\ttotal_pages\r\n\t\t\t\t\t\t}\r\n\t\t\t}\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"bd2ec688-2b59-4745-a910-809ac56b317b","name":"Get label, image product Example","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{admin_token}}","type":"text"}],"body":{"mode":"graphql","graphql":{"query":"{\r\nproducts(filter: {}) {\r\n\titems {\r\n    sku\r\n    mp_stock_status {\r\n      image\r\n      label\r\n    }\r\n}\r\n\ttotal_count\r\n\tpage_info {\r\n\t\tcurrent_page\r\n\t\tpage_size\r\n\t\ttotal_pages\r\n\t\t\t\t\t\t}\r\n\t\t\t}\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 29 Apr 2020 07:37:54 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Set-Cookie","value":"PHPSESSID=2e9fem7lauaj615r4jql7o0vvs; expires=Wed, 29-Apr-2020 08:37:54 GMT; Max-Age=3600; path=/api/api2; domain=dev.mageplaza.vn; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=53cb5cd10f3df353a5dd243ff73962f6; expires=Sat, 27-Apr-2030 07:37:55 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=945277753bb55119714a0127283a7487; expires=Sat, 27-Apr-2030 07:37:55 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=0cce41c4ba9e622ec76845cb596a91c4; expires=Sat, 27-Apr-2030 07:37:55 GMT; Max-Age=315360000; path=/"},{"key":"Expires","value":"Mon, 29 Apr 2019 07:37:55 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Length","value":"2065"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"products\": {\n            \"items\": [\n                {\n                    \"sku\": \"24-MB01\",\n                    \"mp_stock_status\": {\n                        \"image\": \"http://dev.mageplaza.vn/api/api2/pub/media/attribute/swatch/swatch_thumb/110x90/5/_/5_2.jpg\",\n                        \"label\": \"Shoes\"\n                    }\n                },\n                {\n                    \"sku\": \"24-MB04\",\n                    \"mp_stock_status\": {\n                        \"image\": \"http://dev.mageplaza.vn/api/api2/pub/media/attribute/swatch/swatch_thumb/110x90/1/5/155894844136-15590104610771381720866-crop-1559010465257164816218.jpeg\",\n                        \"label\": \"Car Manufacturer\"\n                    }\n                },\n                {\n                    \"sku\": \"24-MB03\",\n                    \"mp_stock_status\": {\n                        \"image\": \"http://dev.mageplaza.vn/api/api2/pub/media/attribute/swatch/swatch_thumb/110x90/5/_/5_2.jpg\",\n                        \"label\": \"Shoes\"\n                    }\n                },\n                {\n                    \"sku\": \"24-MB05\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-MB06\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-MB02\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-UB02\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-WB01\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-WB02\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-WB05\",\n                    \"mp_stock_status\": {\n                        \"image\": \"http://dev.mageplaza.vn/api/api2/pub/media/attribute/swatch/swatch_thumb/110x90/1/5/155894844136-15590104610771381720866-crop-1559010465257164816218.jpeg\",\n                        \"label\": \"Car Manufacturer\"\n                    }\n                },\n                {\n                    \"sku\": \"24-WB06\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-WB03\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-WB07\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-WB04\",\n                    \"mp_stock_status\": {\n                        \"image\": \"http://dev.mageplaza.vn/api/api2/pub/media/attribute/swatch/swatch_thumb/110x90/5/_/5_2.jpg\",\n                        \"label\": \"Shoes\"\n                    }\n                },\n                {\n                    \"sku\": \"24-UG06\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-UG07\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-UG04\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-UG02\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-UG05\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                },\n                {\n                    \"sku\": \"24-UG01\",\n                    \"mp_stock_status\": {\n                        \"image\": null,\n                        \"label\": null\n                    }\n                }\n            ],\n            \"total_count\": 187,\n            \"page_info\": {\n                \"current_page\": 1,\n                \"page_size\": 20,\n                \"total_pages\": 10\n            }\n        }\n    }\n}"}],"_postman_id":"0d8a89fc-8b32-4b2c-a693-461831d233cb"},{"name":"Get label, image cart","id":"48f261e6-1978-4a47-abd3-3cf5fd53f28f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{admin_token}}"}],"body":{"mode":"graphql","graphql":{"query":"{\r\ncart(cart_id: \"Jue89UzhQwDPBRPvJkHVZwMDMgld2QTK\") {\r\n    items {\r\n      id\r\n         mp_stock_status{\r\n            label\r\n            image\r\n            }\r\n      product {\r\n        name\r\n        sku\r\n        stock_status\r\n      }\r\n      quantity\r\n    }\r\n    }\r\n  }","variables":""}},"url":"{{magento_base_url}}/graphql","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"421b925f-351c-4042-b617-62589ab04b60","name":"Get label, image cart Example","originalRequest":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{admin_token}}"}],"body":{"mode":"graphql","graphql":{"query":"{\r\ncart(cart_id: \"Jue89UzhQwDPBRPvJkHVZwMDMgld2QTK\") {\r\n    items {\r\n      id\r\n         mp_stock_status{\r\n            label\r\n            image\r\n            }\r\n      product {\r\n        name\r\n        sku\r\n        stock_status\r\n      }\r\n      quantity\r\n    }\r\n    }\r\n  }","variables":""}},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 29 Apr 2020 03:22:15 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Mon, 29 Apr 2019 03:22:16 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=2ipgt6413bb4qg8d8j71tl1gs5; expires=Wed, 29-Apr-2020 04:22:15 GMT; Max-Age=3600; path=/maianh/ce234h; domain=dev.mageplaza.vn; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=c9191f53c55e6f1e9bdb6a4037053a68; expires=Sat, 27-Apr-2030 03:22:15 GMT; Max-Age=315360000; path=/"},{"key":"X-Magento-Tags","value":"FPC"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Length","value":"294"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"cart\": {\n            \"items\": [\n                {\n                    \"id\": \"43\",\n                    \"mp_stock_status\": {\n                        \"label\": \"Shoes\",\n                        \"image\": \"http://dev.mageplaza.vn/maianh/ce234h/pub/media/attribute/swatch/swatch_thumb/110x90/5/_/5_1.jpg\"\n                    },\n                    \"product\": {\n                        \"name\": \"Strive Shoulder Pack\",\n                        \"sku\": \"24-MB04\",\n                        \"stock_status\": \"IN_STOCK\"\n                    },\n                    \"quantity\": 1\n                }\n            ]\n        }\n    }\n}"}],"_postman_id":"48f261e6-1978-4a47-abd3-3cf5fd53f28f"},{"name":"Step1: GraphQL Customer Token","id":"18a83a08-3aa6-4b36-8448-160b3074292b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n  generateCustomerToken(email: \"roni_cost@example.com\", password: \"roni_cost3@example.com\") {\r\n    token\r\n  }\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"febaceff-2c97-4660-a62d-5002a8b90fe8","name":"Step1: GraphQL Customer Token Example","originalRequest":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n  generateCustomerToken(email: \"roni_cost@example.com\", password: \"roni_cost3@example.com\") {\r\n    token\r\n  }\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 29 Apr 2020 07:38:38 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Mon, 29 Apr 2019 07:38:38 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=2e9fem7lauaj615r4jql7o0vvs; expires=Wed, 29-Apr-2020 08:38:38 GMT; Max-Age=3600; path=/api/api2; domain=dev.mageplaza.vn; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=34a987dda34d641728db2f87b96b5733; expires=Sat, 27-Apr-2030 07:38:38 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"form_key=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/api/api2; domain=dev.mageplaza.vn"},{"key":"Set-Cookie","value":"private_content_version=34cf2ee74976b3a84d783a64b820bb91; expires=Sat, 27-Apr-2030 07:38:38 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=0136a0094a27951e62edfe2e7e5f3dc1; expires=Sat, 27-Apr-2030 07:38:38 GMT; Max-Age=315360000; path=/"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Length","value":"79"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"generateCustomerToken\": {\n            \"token\": \"nid4yrt7e8l8ot0tijw91zxfzxtyuii9\"\n        }\n    }\n}"}],"_postman_id":"18a83a08-3aa6-4b36-8448-160b3074292b"},{"name":"Step2: GraphQL Create an empty cart (cart_id)","id":"76cd22e3-2feb-4f63-8cda-c7ceeaa4dc24","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"},{"warning":"This is a duplicate header and will be overridden by the Authorization header generated by Postman.","key":"Authorization","value":"Bearer {{customer_token}}","type":"text"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n  createEmptyCart\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"41c07108-bbf8-4600-aa9c-c99043bf9ece","name":"Step2: GraphQL Create an empty cart (cart_id) Example","originalRequest":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"},{"warning":"This is a duplicate header and will be overridden by the Authorization header generated by Postman.","key":"Authorization","value":"Bearer {{customer_token}}","type":"text"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n  createEmptyCart\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 29 Apr 2020 07:43:49 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Mon, 29 Apr 2019 07:43:49 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=2e9fem7lauaj615r4jql7o0vvs; expires=Wed, 29-Apr-2020 08:43:49 GMT; Max-Age=3600; path=/api/api2; domain=dev.mageplaza.vn; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=8df7cfb5c173974ed348bf0a68745fd6; expires=Sat, 27-Apr-2030 07:43:49 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=4108cf7687380de97f3e85252c91c242; expires=Sat, 27-Apr-2030 07:43:49 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=cf9859e48cc369540f867cf70da002e8; expires=Sat, 27-Apr-2030 07:43:49 GMT; Max-Age=315360000; path=/"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Length","value":"63"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"createEmptyCart\": \"ZG3OcSuB9Aaf0rG1L3Nkq3E9cBj293R1\"\n    }\n}"}],"_postman_id":"76cd22e3-2feb-4f63-8cda-c7ceeaa4dc24"},{"name":"Step3: GraphQL Add products to the cart","id":"0781e724-af93-427c-8844-14024de8635f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n  addSimpleProductsToCart(\r\n    input: {\r\n      cart_id: \"ZG3OcSuB9Aaf0rG1L3Nkq3E9cBj293R1\"\r\n      cart_items: [\r\n        {\r\n          data: {\r\n            quantity: 1\r\n            sku: \"24-MB04\"\r\n          }\r\n          \r\n        }\r\n      ]\r\n    }\r\n  ) {\r\n    cart {\r\n      items {\r\n        id\r\n        product {\r\n          sku\r\n          stock_status\r\n        }\r\n        quantity,\r\n        mp_stock_status{\r\n            label\r\n            image\r\n            }\r\n      }\r\n    }\r\n  }\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"7ed02a21-ad8e-4b76-a001-c7a55bc073bc","name":"Step3: GraphQL Add products to the cart Example","originalRequest":{"method":"POST","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n  addSimpleProductsToCart(\r\n    input: {\r\n      cart_id: \"ZG3OcSuB9Aaf0rG1L3Nkq3E9cBj293R1\"\r\n      cart_items: [\r\n        {\r\n          data: {\r\n            quantity: 1\r\n            sku: \"24-MB04\"\r\n          }\r\n          \r\n        }\r\n      ]\r\n    }\r\n  ) {\r\n    cart {\r\n      items {\r\n        id\r\n        product {\r\n          sku\r\n          stock_status\r\n        }\r\n        quantity,\r\n        mp_stock_status{\r\n            label\r\n            image\r\n            }\r\n      }\r\n    }\r\n  }\r\n}","variables":""}},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 29 Apr 2020 07:43:58 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Mon, 29 Apr 2019 07:43:58 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=2e9fem7lauaj615r4jql7o0vvs; expires=Wed, 29-Apr-2020 08:43:58 GMT; Max-Age=3600; path=/api/api2; domain=dev.mageplaza.vn; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=c4a0bbe36b41fd414c20b19e15a585cb; expires=Sat, 27-Apr-2030 07:43:58 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=3cb09593c199a72ca126950ea991e623; expires=Sat, 27-Apr-2030 07:43:58 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=42dafb1bfb8e5d1e212a77118b38d7aa; expires=Sat, 27-Apr-2030 07:43:58 GMT; Max-Age=315360000; path=/"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Content-Length","value":"360"},{"key":"Keep-Alive","value":"timeout=5, max=100"},{"key":"Connection","value":"Keep-Alive"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"addSimpleProductsToCart\": {\n            \"cart\": {\n                \"items\": [\n                    {\n                        \"id\": \"93\",\n                        \"product\": {\n                            \"sku\": \"24-MB04\",\n                            \"stock_status\": \"IN_STOCK\"\n                        },\n                        \"quantity\": 1,\n                        \"mp_stock_status\": {\n                            \"label\": \"Car Manufacturer\",\n                            \"image\": \"http://dev.mageplaza.vn/api/api2/pub/media/attribute/swatch/swatch_thumb/110x90/1/5/155894844136-15590104610771381720866-crop-1559010465257164816218.jpeg\"\n                        }\n                    }\n                ]\n            }\n        }\n    }\n}"}],"_postman_id":"0781e724-af93-427c-8844-14024de8635f"}]}