{"_id":"591f17b521d2ff0f00cf5a77","user":"547cd6ac78fd57080023ca99","version":{"_id":"591f17ae21d2ff0f00cf5a3f","__v":1,"project":"547cd7662eaee50800ed1089","createdAt":"2017-05-19T16:05:02.775Z","releaseDate":"2017-05-19T16:05:02.775Z","categories":["591f17af21d2ff0f00cf5a40","591f17af21d2ff0f00cf5a41","591f17af21d2ff0f00cf5a42","591f17af21d2ff0f00cf5a43","591f17af21d2ff0f00cf5a44","591f17af21d2ff0f00cf5a45","591f17af21d2ff0f00cf5a46","591f17af21d2ff0f00cf5a47","591f17af21d2ff0f00cf5a48"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.1","version":"1.0.1"},"category":{"_id":"591f17af21d2ff0f00cf5a48","__v":0,"project":"547cd7662eaee50800ed1089","version":"591f17ae21d2ff0f00cf5a3f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-25T10:22:16.805Z","from_sync":false,"order":8,"slug":"public-api","title":"Public API"},"parentDoc":null,"project":"547cd7662eaee50800ed1089","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-28T14:05:46.681Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"json","code":"curl -H \"Authorization:Token b98f08d1c44cd5259dd70dc295e61187af45bffd23036f909919e608bdd8a592\" -X PUT -d '{\"data\": {\"email\":\"janedoe:::at:::acme.corp\",\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"note\":\"Changing name and email\"}}' \"https://public-api.devmate.com/v2/customers/45\"","name":""}]},"method":"put","results":{"codes":[{"code":"{\n  \"data\": {\n    \"id\": 45,\n    \"email\": \"janedoe@acme.corp\",\n    \"first_name\": \"Jane\",\n    \"last_name\": \"Doe\",\n    \"company\": \"MacPaw\",\n    \"phone\": \"5553423322\",\n    \"address\": \"Madison Ave. 11\",\n\n    \"note\": \"Changing the first name and email\",\n    \"date_added\": 1443186660\n\t}\n}","name":"","status":200,"language":"json"},{"language":"json","code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"email\\\".\",\n            \"detail\": \"Mandatory parameter \\\"email\\\" is empty or incorrect.\"\n        }\n    ]\n}","name":"","status":400},{"code":"{\n    \"errors\": [\n        {\n            \"title\": \"Unauthorized\"\n        }\n    ]\n}","status":401,"language":"json"},{"language":"json","code":"{\n   \"errors\": [\n       {\n           \"title\": \"Server error.\",\n           \"detail\": \"Customer with id \\\"12343\\\" not found.\"\n       }\n   ]\n}","status":404},{"status":409,"language":"json","code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"email\\\".\",\n            \"detail\": \"This email already exists.\"\n        }\n    ]\n}"}]},"settings":"","auth":"required","params":[{"_id":"560a8947ee8a910d0072f7d0","ref":"","in":"path","required":false,"desc":"Customer ID","default":"","type":"int","name":"customer_id"},{"_id":"56095e37a7b2590d0089ebbb","ref":"","in":"body","required":false,"desc":"Customer's email (**mandatory**)","default":"","type":"string","name":"data[email]"},{"_id":"56095e37a7b2590d0089ebbc","ref":"","in":"body","required":false,"desc":"Customer's first name","default":"","type":"string","name":"data[first_name]"},{"_id":"56095e37a7b2590d0089ebbd","ref":"","in":"body","required":false,"desc":"Customer's last name","default":"","type":"string","name":"data[last_name]"},{"_id":"57c04b81bcc4f61900cf97f1","ref":"","in":"body","required":false,"desc":"Customer's company name","default":"","type":"string","name":"data[company]"},{"_id":"57c04b81bcc4f61900cf97f0","ref":"","in":"body","required":false,"desc":"Customer's phone number","default":"","type":"string","name":"data[phone]"},{"_id":"57c04b81bcc4f61900cf97ef","ref":"","in":"body","required":false,"desc":"Customer's address","default":"","type":"string","name":"data[address]"},{"_id":"563a22faa19edf0d009722c3","ref":"","in":"body","required":false,"desc":"Additional notes.","default":"","type":"string","name":"data[notes]"}],"url":"/customers/:customer_id"},"isReference":false,"order":51,"body":"This method is used to update info about existing customer. `customer_id` must be passed in URL (mandatory).\n\nExample request demonstrates updating information about customer created in the previous section: changing the first name from 'John' to 'Jane' and changing an email to janedoe@acme.corp.\n\n#Response Codes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`200`\",\n    \"1-0\": \"`400`\",\n    \"2-0\": \"`401`\",\n    \"3-0\": \"`404`\",\n    \"5-0\": \"`409`\",\n    \"0-1\": \"Customer was updated successfully\",\n    \"1-1\": \"Request parameter is absent or incorrect. For example, wrong email address.\",\n    \"2-1\": \"Authorization failed\",\n    \"3-1\": \"Customer with such ID was not found\",\n    \"5-1\": \"Customers with such email already exists\",\n    \"6-0\": \"`500`\",\n    \"6-1\": \"Server error\",\n    \"4-0\": \"`405`\",\n    \"4-1\": \"Method not allowed: customer ID is empty\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]","excerpt":"","slug":"update-customer","type":"endpoint","title":"Update Customer"}

putUpdate Customer


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

customer_id:
integer
Customer ID

Body Params

data[email]:
string
Customer's email (**mandatory**)
data[first_name]:
string
Customer's first name
data[last_name]:
string
Customer's last name
data[company]:
string
Customer's company name
data[phone]:
string
Customer's phone number
data[address]:
string
Customer's address
data[notes]:
string
Additional notes.

Examples


Result Format


Documentation

This method is used to update info about existing customer. `customer_id` must be passed in URL (mandatory). Example request demonstrates updating information about customer created in the previous section: changing the first name from 'John' to 'Jane' and changing an email to janedoe@acme.corp. #Response Codes [block:parameters] { "data": { "0-0": "`200`", "1-0": "`400`", "2-0": "`401`", "3-0": "`404`", "5-0": "`409`", "0-1": "Customer was updated successfully", "1-1": "Request parameter is absent or incorrect. For example, wrong email address.", "2-1": "Authorization failed", "3-1": "Customer with such ID was not found", "5-1": "Customers with such email already exists", "6-0": "`500`", "6-1": "Server error", "4-0": "`405`", "4-1": "Method not allowed: customer ID is empty" }, "cols": 2, "rows": 7 } [/block]

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}