{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/customers/:customer_id","auth":"required","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","params":[{"name":"customer_id","type":"int","default":"","desc":"Customer ID","required":false,"in":"path","ref":"","_id":"560a8947ee8a910d0072f7d0"},{"name":"data[email]","type":"string","default":"","desc":"Customer's email (**mandatory**)","required":false,"in":"body","ref":"","_id":"56095e37a7b2590d0089ebbb"},{"name":"data[first_name]","type":"string","default":"","desc":"Customer's first name","required":false,"in":"body","ref":"","_id":"56095e37a7b2590d0089ebbc"},{"name":"data[last_name]","type":"string","default":"","desc":"Customer's last name","required":false,"in":"body","ref":"","_id":"56095e37a7b2590d0089ebbd"},{"name":"data[company]","type":"string","default":"","desc":"Customer's company name","required":false,"in":"body","ref":"","_id":"57c04b81bcc4f61900cf97f1"},{"name":"data[phone]","type":"string","default":"","desc":"Customer's phone number","required":false,"in":"body","ref":"","_id":"57c04b81bcc4f61900cf97f0"},{"name":"data[address]","type":"string","default":"","desc":"Customer's address","required":false,"in":"body","ref":"","_id":"57c04b81bcc4f61900cf97ef"},{"name":"data[notes]","type":"string","default":"","desc":"Additional notes.","required":false,"in":"body","ref":"","_id":"563a22faa19edf0d009722c3"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"data\": {\n    \"id\": 45,\n    \"email\": \"[email protected]\",\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":400,"language":"json","code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"email\\\".\",\n            \"detail\": \"Mandatory parameter \\\"email\\\" is empty or incorrect.\"\n        }\n    ]\n}","name":""},{"code":"{\n    \"errors\": [\n        {\n            \"title\": \"Unauthorized\"\n        }\n    ]\n}","status":401,"language":"json"},{"status":404,"language":"json","code":"{\n   \"errors\": [\n       {\n           \"title\": \"Server error.\",\n           \"detail\": \"Customer with id \\\"12343\\\" not found.\"\n       }\n   ]\n}"},{"language":"json","code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"email\\\".\",\n            \"detail\": \"This email already exists.\"\n        }\n    ]\n}","status":409}]},"settings":""},"next":{"description":"","pages":[]},"title":"Update Customer","type":"endpoint","slug":"update-customer","excerpt":"","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 [email protected]\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]","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5609493a31beb60d001b65d9","category":{"sync":{"isSync":false,"url":""},"pages":["5605215df6b86e0d00284ab5","56052995d5c3900d0003e83d","56056243e266000d0089720e","56056496f6b86e0d00284b09","56094876c5cff70d007d016a","5609493a31beb60d001b65d9","56094af131beb60d001b65db"],"title":"Public API","slug":"public-api","order":8,"from_sync":false,"reference":false,"_id":"56052058e266000d008971c7","project":"547cd7662eaee50800ed1089","__v":7,"createdAt":"2015-09-25T10:22:16.805Z","version":"547cd7662eaee50800ed108c"},"createdAt":"2015-09-28T14:05:46.681Z","editedParams":true,"githubsync":"","parentDoc":null,"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":true,"categories":["547cd7672eaee50800ed108d","54c8f8ae0174630d00efa874","54c8f8bd7a11f60d0022a832","54c8f8c60174630d00efa876","54c8f8f10174630d00efa877","55155826bc466623002afe83","551558324c7c1e39003735a0","56052058e266000d008971c7","57909a453b845d0e006a37d5"],"_id":"547cd7662eaee50800ed108c","createdAt":"2014-12-01T21:02:30.851Z","project":"547cd7662eaee50800ed1089","releaseDate":"2014-12-01T21:02:30.851Z","__v":9},"__v":8,"editedParams2":true,"project":"547cd7662eaee50800ed1089","user":"547cd6ac78fd57080023ca99"}

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 [email protected] #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 }}