{"_id":"58112e72ded0340f0085d037","user":"55f2fd49b5b25021002b7dfd","__v":0,"project":"551e85be610f400d00837db7","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-25T15:18:14.294Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The following methods operate on the [Address data model](doc:customeraddress).  See the [Customer Methods](doc:methods-customer) to understand how to find the address for a customer.\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/addresses/{address_id}</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    https://api.cratejoy.com/v1/addresses/{address_id}/</span>\\n</div>\"\n}\n[/block]\n# Get an address\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/addresses/{address_id}</span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({     \\n  url: 'https://api.cratejoy.com/v1/addresses/75562247/',\\n  method: 'GET'\\n});\",\n      \"language\": \"javascript\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"city\\\": \\\"Austin\\\", \\n  \\\"company\\\": \\\"\\\", \\n  \\\"country\\\": \\\"US\\\", \\n  \\\"icon\\\": \\\"United-States.png\\\", \\n  \\\"id\\\": 75562247, \\n  \\\"phone_number\\\": \\\"\\\", \\n  \\\"state\\\": \\\"TX\\\", \\n  \\\"status\\\": 0, \\n  \\\"status_message\\\": null, \\n  \\\"street\\\": \\\"101 Main St\\\", \\n  \\\"to\\\": \\\"James Taylor\\\", \\n  \\\"type\\\": \\\"address\\\", \\n  \\\"unit\\\": \\\"\\\", \\n  \\\"zip_code\\\": \\\"78701\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response: 200 OK\"\n    }\n  ]\n}\n[/block]\n# Update an address\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method put\\\">PUT</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/addresses/{address_id}/</span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n    url: 'https://api.cratejoy.com/v1/addresses/75562247/',\\n    method: 'PUT',\\n    data: {\\n      street: \\\"2012 Northridge Dr\\\",\\n      zip_code: \\\"78723\\\"\\n    }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"city\\\": \\\"Austin\\\", \\n  \\\"company\\\": \\\"\\\", \\n  \\\"country\\\": \\\"US\\\", \\n  \\\"icon\\\": \\\"United-States.png\\\", \\n  \\\"id\\\": 75562247, \\n  \\\"phone_number\\\": \\\"\\\", \\n  \\\"state\\\": \\\"TX\\\", \\n  \\\"status\\\": 0, \\n  \\\"status_message\\\": null, \\n  \\\"street\\\": \\\"2012 Northridge Dr\\\", \\n  \\\"to\\\": \\\"James Taylor\\\", \\n  \\\"type\\\": \\\"address\\\", \\n  \\\"unit\\\": \\\"\\\", \\n  \\\"zip_code\\\": \\\"78723\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response: 200 OK\"\n    }\n  ]\n}\n[/block]","excerpt":"Customer Address data object specification for the Cratejoy Merchant API","slug":"customer-address-methods","type":"basic","title":"Address Methods"}

Address Methods

Customer Address data object specification for the Cratejoy Merchant API

The following methods operate on the [Address data model](doc:customeraddress). See the [Customer Methods](doc:methods-customer) to understand how to find the address for a customer. [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/addresses/{address_id}</span>\n</div>" } [/block] [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method put\">PUT</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/addresses/{address_id}/</span>\n</div>" } [/block] # Get an address [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/addresses/{address_id}</span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.ajax({ \n url: 'https://api.cratejoy.com/v1/addresses/75562247/',\n method: 'GET'\n});", "language": "javascript", "name": null } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"city\": \"Austin\", \n \"company\": \"\", \n \"country\": \"US\", \n \"icon\": \"United-States.png\", \n \"id\": 75562247, \n \"phone_number\": \"\", \n \"state\": \"TX\", \n \"status\": 0, \n \"status_message\": null, \n \"street\": \"101 Main St\", \n \"to\": \"James Taylor\", \n \"type\": \"address\", \n \"unit\": \"\", \n \"zip_code\": \"78701\"\n}", "language": "json", "name": "Response: 200 OK" } ] } [/block] # Update an address [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method put\">PUT</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/addresses/{address_id}/</span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.ajax({\n url: 'https://api.cratejoy.com/v1/addresses/75562247/',\n method: 'PUT',\n data: {\n street: \"2012 Northridge Dr\",\n zip_code: \"78723\"\n }\n});", "language": "javascript", "name": null } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"city\": \"Austin\", \n \"company\": \"\", \n \"country\": \"US\", \n \"icon\": \"United-States.png\", \n \"id\": 75562247, \n \"phone_number\": \"\", \n \"state\": \"TX\", \n \"status\": 0, \n \"status_message\": null, \n \"street\": \"2012 Northridge Dr\", \n \"to\": \"James Taylor\", \n \"type\": \"address\", \n \"unit\": \"\", \n \"zip_code\": \"78723\"\n}", "language": "json", "name": "Response: 200 OK" } ] } [/block]