{"_id":"58112e72ded0340f0085d03d","project":"551e85be610f400d00837db7","__v":0,"version":{"_id":"58112e71ded0340f0085d02a","project":"551e85be610f400d00837db7","__v":4,"createdAt":"2016-10-26T22:30:09.862Z","releaseDate":"2016-10-26T22:30:09.862Z","categories":["58112e72ded0340f0085d02b","58112e72ded0340f0085d02c","58112e72ded0340f0085d02d","58112e72ded0340f0085d02e","58112e72ded0340f0085d02f","58112e72ded0340f0085d030","58112e72ded0340f0085d031","58112e72ded0340f0085d032","58112e72ded0340f0085d033","58112e72ded0340f0085d034","581137cc604d3c230048b7e4","58dc367221742d0f00a73f98","590768e54669da0f00db5c0b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"new designer","version_clean":"2.0.0","version":"2.0"},"parentDoc":null,"category":{"_id":"58112e72ded0340f0085d032","project":"551e85be610f400d00837db7","__v":0,"version":"58112e71ded0340f0085d02a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-17T19:28:09.961Z","from_sync":false,"order":7,"slug":"merchant-api-methods","title":"Merchant API Methods"},"user":"55f2fd49b5b25021002b7dfd","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-25T18:43:04.599Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"Methods that operate on the [Product data model](doc:product) \n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/products/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/products/{prod_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method put\\\">PUT</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/products/{prod_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n# List products\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/products/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n    url: 'https://api.cratejoy.com/v1/products/',\\n    method: 'GET'\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"List\"\n    },\n    {\n      \"code\": \"$.get('https://api.cratejoy.com/v1/customers/',{\\n  \\\"address.city\\\": \\\"Austin\\\",\\n  \\\"_md.shoe.size__gt\\\": 10\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"Filter\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"count\\\": 1, \\n  \\\"next\\\": null, \\n  \\\"prev\\\": null, \\n  \\\"results\\\": [{\\n    \\\"base_term_prices\\\": [{...}], // Term prices property \\n    \\\"billing\\\": {...}, // Product billing property \\n    \\\"deleted\\\": false, \\n    \\\"description\\\": \\\"Top selling product\\\", \\n    \\\"flat_ship_price\\\": 0, \\n    \\\"gift_shipping\\\": 0, \\n    \\\"gift_term_prices\\\": [{...}], // Gift term prices property \\n    \\\"gift_terms\\\": [{...}], // Gift terms property\\n    \\\"giftable\\\": true, \\n    \\\"giftinstances\\\": [{...}], // Gift instances property\\n    \\\"has_subscribers\\\": true, \\n    \\\"id\\\": 55065957, \\n    \\\"images\\\": [{...}], // Images relation property \\n    \\\"instances\\\": [{...}], // Instances relation property \\n    \\\"listed\\\": false, \\n    \\\"meta\\\": {}, \\n    \\\"metadata\\\": [], \\n    \\\"name\\\": \\\"My Product with Options\\\", \\n    \\\"product_billing_id\\\": 55065955, \\n    \\\"reviewable\\\": true, \\n    \\\"rulesets\\\": [], \\n    \\\"ruletypes\\\": [{...}], // Shipping rule types relation property\\n    \\\"ship_option\\\": \\\"pricedin\\\", \\n    \\\"ship_weight\\\": 2.0, \\n    \\\"single_purchasable\\\": false, \\n    \\\"sku\\\": \\\"SQ3851001\\\", \\n    \\\"slug\\\": \\\"my-product-with-options\\\", \\n    \\\"store_id\\\": 4848355, \\n    \\\"subscription_types\\\": [{...}], // Subscription types relation property\\n    \\\"taxonomy\\\": [], \\n    \\\"type\\\": \\\"product\\\", \\n    \\\"variants\\\": [{...}], // Variants relation property\\n    \\\"visible\\\": true\\n  }]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response: 200 OK\"\n    }\n  ]\n}\n[/block]\n# Get a product\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/products/{prod_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n    url: 'https://api.cratejoy.com/v1/products/75572211/',\\n    method: 'GET'\\n});\",\n      \"language\": \"javascript\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n# Update a product\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method put\\\">PUT</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/products/{prod_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n    url: 'https://api.cratejoy.com/v1/products/75572211/',\\n    method: 'PUT',\\n    data: {\\n      'name': \\\"Batty Box\\\",\\n      'ship_weight': 1.5,\\n      'visible': true\\n    }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\nFor a complete list of writable properties see the [Product](doc:product) data model.","excerpt":"","slug":"product-methods","type":"basic","title":"Product Methods"}
Methods that operate on the [Product data model](doc:product) [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/products/\n </span>\n</div>" } [/block] [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/products/{prod_id}/\n </span>\n</div>" } [/block] [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method put\">PUT</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/products/{prod_id}/\n </span>\n</div>" } [/block] # List products [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/products/\n </span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.ajax({\n url: 'https://api.cratejoy.com/v1/products/',\n method: 'GET'\n});", "language": "javascript", "name": "List" }, { "code": "$.get('https://api.cratejoy.com/v1/customers/',{\n \"address.city\": \"Austin\",\n \"_md.shoe.size__gt\": 10\n});", "language": "javascript", "name": "Filter" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 1, \n \"next\": null, \n \"prev\": null, \n \"results\": [{\n \"base_term_prices\": [{...}], // Term prices property \n \"billing\": {...}, // Product billing property \n \"deleted\": false, \n \"description\": \"Top selling product\", \n \"flat_ship_price\": 0, \n \"gift_shipping\": 0, \n \"gift_term_prices\": [{...}], // Gift term prices property \n \"gift_terms\": [{...}], // Gift terms property\n \"giftable\": true, \n \"giftinstances\": [{...}], // Gift instances property\n \"has_subscribers\": true, \n \"id\": 55065957, \n \"images\": [{...}], // Images relation property \n \"instances\": [{...}], // Instances relation property \n \"listed\": false, \n \"meta\": {}, \n \"metadata\": [], \n \"name\": \"My Product with Options\", \n \"product_billing_id\": 55065955, \n \"reviewable\": true, \n \"rulesets\": [], \n \"ruletypes\": [{...}], // Shipping rule types relation property\n \"ship_option\": \"pricedin\", \n \"ship_weight\": 2.0, \n \"single_purchasable\": false, \n \"sku\": \"SQ3851001\", \n \"slug\": \"my-product-with-options\", \n \"store_id\": 4848355, \n \"subscription_types\": [{...}], // Subscription types relation property\n \"taxonomy\": [], \n \"type\": \"product\", \n \"variants\": [{...}], // Variants relation property\n \"visible\": true\n }]\n}", "language": "json", "name": "Response: 200 OK" } ] } [/block] # Get a product [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/products/{prod_id}/\n </span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.ajax({\n url: 'https://api.cratejoy.com/v1/products/75572211/',\n method: 'GET'\n});", "language": "javascript", "name": null } ] } [/block] # Update a product [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method put\">PUT</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/products/{prod_id}/\n </span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.ajax({\n url: 'https://api.cratejoy.com/v1/products/75572211/',\n method: 'PUT',\n data: {\n 'name': \"Batty Box\",\n 'ship_weight': 1.5,\n 'visible': true\n }\n});", "language": "javascript", "name": null } ] } [/block] For a complete list of writable properties see the [Product](doc:product) data model.