{"info":{"_postman_id":"8ca7682e-9089-4499-bc45-bee994a6bee6","name":"GraphQL Store Credit","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"10589000","collectionId":"8ca7682e-9089-4499-bc45-bee994a6bee6","publishedId":"SzRxXqok","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-03-10T02:35:50.000Z"},"item":[{"name":"Spend Store Credit","id":"5f88fa2d-3cc4-449a-bfed-e7a638ef4f46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"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 SpendCredit ($cart_id: String!, $amount: Float!) {\r\n  MpStoreCreditCustomerSpending(cart_id:$cart_id, amount:$amount){\r\n    code\r\n    title\r\n    value\r\n  }\r\n}","variables":"{\n\t\"cart_id\":\"9Gppdq28fU2SU2JYyBiuvMcV0cQkuMfH\",\n\t\"amount\":50\n}"}},"url":"{{magento_base_url}}/graphql","description":"<p>To cancel credit in cart, please set the amount equal to zero :\n{ \"amount\" : 0}</p>\n","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"ec23cb73-d8a5-41dd-9eba-a7acf6abb52e","name":"Spend Credit Example","originalRequest":{"method":"POST","header":[{"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"},"url":"{{magento_base_url}}graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 24 Feb 2020 03:53:04 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Sun, 24 Feb 2019 03:53:05 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=d5v2pf0naugvgpb4t18sci70po; expires=Mon, 24-Feb-2020 04:53:04 GMT; Max-Age=3600; path=/quynh/ce234; domain=192.168.1.200; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=7d44a92e83afd0578cd2015761b18b47; expires=Thu, 21-Feb-2030 03:53:04 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=98b9ced6586a5eed7dd5b670d0a5da6b; expires=Thu, 21-Feb-2030 03:53:05 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=0f0b1c282c1b6f7b8a91c586f876c7db; expires=Thu, 21-Feb-2030 03:53:05 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":"366"},{"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        \"MpStoreCreditCustomerSpending\": [\n            {\n                \"code\": \"subtotal\",\n                \"title\": \"Subtotal\",\n                \"value\": \"45.0000\"\n            },\n            {\n                \"code\": \"shipping\",\n                \"title\": \"Shipping & Handling (Flat Rate - Fixed)\",\n                \"value\": \"5.0000\"\n            },\n            {\n                \"code\": \"tax\",\n                \"title\": \"Tax\",\n                \"value\": \"3.7100\"\n            },\n            {\n                \"code\": \"grand_total\",\n                \"title\": \"Grand Total\",\n                \"value\": \"8.7100\"\n            },\n            {\n                \"code\": \"mp_store_credit_spent\",\n                \"title\": \"Store Credit\",\n                \"value\": \"-45\"\n            }\n        ]\n    }\n}"}],"_postman_id":"5f88fa2d-3cc4-449a-bfed-e7a638ef4f46"},{"name":"Get info and transaction of customer","id":"16142e2c-54ac-4036-8bc1-762cac4a31bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"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":"query{\r\n  customer{\r\n    mp_store_credit  {\r\n      customer_id\r\n      mp_credit_balance\r\n      mp_credit_notification\r\n      transactions(filter:{transaction_id:{eq:\"5\"}}) {\r\n        total_count\r\n        items {\r\n          action\r\n          admin_note\r\n          amount\r\n          balance\r\n          created_at\r\n          customer_id\r\n          customer_note\r\n          order_id\r\n          status\r\n          title\r\n          transaction_id\r\n          \r\n        }\r\n      }\r\n    }\r\n  }\r\n}","variables":""}},"url":"{{magento_base_url}}graphql","urlObject":{"host":["{{magento_base_url}}graphql"],"query":[],"variable":[]}},"response":[{"id":"e60dd949-d1db-4a51-9f68-a8f7ed7a0886","name":"Get info and transaction of customer example","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{customer_token}}","type":"text"}],"body":{"mode":"graphql"},"url":"{{magento_base_url}}graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 24 Feb 2020 03:47:24 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Sun, 24 Feb 2019 03:47:24 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=6p349blp1hfkns4phtfpco5mst; expires=Mon, 24-Feb-2020 04:47:24 GMT; Max-Age=3600; path=/api/api; domain=develop.mageplaza.com; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=7fca349f54a673eaf0a8f45f82979e01; expires=Thu, 21-Feb-2030 03:47:24 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=945c65cbea918e39fbbb13d805f8ccb3; expires=Thu, 21-Feb-2030 03:47:24 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=69b796e4c972e4652c8e955b1389ec33; expires=Thu, 21-Feb-2030 03:47:24 GMT; Max-Age=315360000; path=/"},{"key":"X-Magento-Debug","value":"1"},{"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":"411"},{"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        \"customer\": {\n            \"mp_store_credit\": {\n                \"customer_id\": 28,\n                \"mp_credit_balance\": 157.9,\n                \"mp_credit_notification\": 1,\n                \"transactions\": {\n                    \"total_count\": 1,\n                    \"items\": [\n                        {\n                            \"action\": \"spending_refund\",\n                            \"admin_note\": null,\n                            \"amount\": 79.9,\n                            \"balance\": 139.9,\n                            \"created_at\": \"2020-02-17 10:14:37\",\n                            \"customer_id\": 28,\n                            \"customer_note\": null,\n                            \"order_id\": 36,\n                            \"status\": 1,\n                            \"title\": \"Retrieve credit spent on refunded order #000000036\",\n                            \"transaction_id\": 5\n                        }\n                    ]\n                }\n            }\n        }\n    }\n}"}],"_postman_id":"16142e2c-54ac-4036-8bc1-762cac4a31bf"},{"name":"Get Store Credit Product","id":"311f17c5-b9bb-41b9-9140-fa7f596826ad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query{\r\n  products(filter:{sku:{eq:\"Store Credit Product\"}}) {\r\n    total_count\r\n    items {\r\n      id\r\n      sku\r\n      credit_amount\r\n      mp_store_credit_attributes {\r\n        attribute_code\r\n        value\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":"09f62d9d-72b8-4410-84e1-84b6616e2a57","name":"Get product example","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql"},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 24 Feb 2020 03:56:01 GMT"},{"key":"Server","value":"Apache/2.4.38 (Ubuntu)"},{"key":"Expires","value":"Sun, 24 Feb 2019 03:56:01 GMT"},{"key":"Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Set-Cookie","value":"PHPSESSID=6p349blp1hfkns4phtfpco5mst; expires=Mon, 24-Feb-2020 04:56:01 GMT; Max-Age=3600; path=/api/api; domain=develop.mageplaza.com; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=64b716a43d0460aa0f4bb2a53b5851bc; expires=Thu, 21-Feb-2030 03:56:01 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=5687117a45bc8e685b1ccafda792cc2a; expires=Thu, 21-Feb-2030 03:56:01 GMT; Max-Age=315360000; path=/"},{"key":"Set-Cookie","value":"private_content_version=8fbd03d5214e7bd7a13cc7aa04c24987; expires=Thu, 21-Feb-2030 03:56:01 GMT; Max-Age=315360000; path=/"},{"key":"X-Magento-Debug","value":"1"},{"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":"405"},{"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            \"total_count\": 1,\n            \"items\": [\n                {\n                    \"id\": 2050,\n                    \"sku\": \"Store Credit Product\",\n                    \"credit_amount\": 30,\n                    \"mp_store_credit_attributes\": [\n                        {\n                            \"attribute_code\": \"min_credit\",\n                            \"value\": \"10.000000\"\n                        },\n                        {\n                            \"attribute_code\": \"max_credit\",\n                            \"value\": \"100.000000\"\n                        },\n                        {\n                            \"attribute_code\": \"credit_rate\",\n                            \"value\": \"60.000000\"\n                        },\n                        {\n                            \"attribute_code\": \"credit_amount\",\n                            \"value\": \"30.000000\"\n                        },\n                        {\n                            \"attribute_code\": \"allow_credit_range\",\n                            \"value\": \"1\"\n                        }\n                    ]\n                }\n            ]\n        }\n    }\n}"}],"_postman_id":"311f17c5-b9bb-41b9-9140-fa7f596826ad"},{"name":"Add Store Credit Product to Cart","id":"de9218a5-4a40-48c2-b35b-ce961a4f275b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Bearer {{customer_token}}","type":"text"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n\taddStoreCreditProductsToCart(\r\n\t\tinput: {\r\n\t\t\tcart_id: \"AopfuBLMCyVVhhPH5CSacH23D7FYjrJS\"\r\n\t\t\tstore_credit_input: { credit_amount: 40, sku: \"Store Credit Product\" }\r\n\t\t}\r\n\t) {\r\n\t\tcart {\r\n\t\t\tid\r\n\t\t\titems {\r\n\t\t\t\tid\r\n\r\n\t\t\t\tproduct {\r\n\t\t\t\t\tname\r\n\t\t\t\t\tsku\r\n\t\t\t\t}\r\n\t\t\t\tquantity\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","variables":""}},"url":"{{magento_base_url}}/graphql","urlObject":{"path":["graphql"],"host":["{{magento_base_url}}"],"query":[],"variable":[]}},"response":[{"id":"6ce2d833-c8f7-4894-b755-7bb7069ca404","name":"Add Store Credit Product to Cart Example","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{customer_token}}","type":"text"}],"body":{"mode":"graphql","graphql":{"query":"mutation {\r\n\taddStoreCreditProductsToCart(\r\n\t\tinput: {\r\n\t\t\tcart_id: \"AopfuBLMCyVVhhPH5CSacH23D7FYjrJS\"\r\n\t\t\tstore_credit_input: { credit_amount: 40, sku: \"Store Credit Product\" }\r\n\t\t}\r\n\t) {\r\n\t\tcart {\r\n\t\t\tid\r\n\t\t\titems {\r\n\t\t\t\tid\r\n\r\n\t\t\t\tproduct {\r\n\t\t\t\t\tname\r\n\t\t\t\t\tsku\r\n\t\t\t\t}\r\n\t\t\t\tquantity\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","variables":""}},"url":"{{magento_base_url}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 08 Oct 2020 09:48:53 GMT"},{"key":"Set-Cookie","value":"PHPSESSID=5vh16euk14jjtjg6ckelmj8qoe; expires=Thu, 08-Oct-2020 10:48:53 GMT; Max-Age=3600; path=/quynh/ce235b; domain=dev.mageplaza.vn; HttpOnly"},{"key":"Set-Cookie","value":"private_content_version=0da2631861130b93130f4d0bf2c97c93; expires=Sun, 06-Oct-2030 09:48:53 GMT; Max-Age=315360000; path=/"},{"key":"X-Magento-Cache-Control","value":"max-age=0, must-revalidate, no-cache, no-store"},{"key":"X-Magento-Cache-Debug","value":"MISS"},{"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":"199"},{"key":"Content-Type","value":"application/json"},{"key":"X-Varnish","value":"275096"},{"key":"Via","value":"1.1 varnish (Varnish/6.1)"},{"key":"Pragma","value":"no-cache"},{"key":"Expires","value":"-1"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate, max-age=0"},{"key":"Accept-Ranges","value":"bytes"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"addStoreCreditProductsToCart\": {\n            \"cart\": {\n                \"id\": \"AopfuBLMCyVVhhPH5CSacH23D7FYjrJS\",\n                \"items\": [\n                    {\n                        \"id\": \"285\",\n                        \"product\": {\n                            \"name\": \"Store Credit Product\",\n                            \"sku\": \"Store Credit Product\"\n                        },\n                        \"quantity\": 1\n                    }\n                ]\n            }\n        }\n    }\n}"}],"_postman_id":"de9218a5-4a40-48c2-b35b-ce961a4f275b"}]}