{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/v3/accounts/:accountId","auth":"required","method":"post","examples":{"codes":[{"code":"'''\nThis is a Python 3.7 Module that updates a Wyre Account\nusing secret key authentication.\n\nYou can only use this module for updating individual\nor business accounts if you already have an account set up.\n\nIf you do not have a business or individual account with a secretKey/ApiKey,\ngo through the sign-up process for a test account here: https://www.testwyre.com/\n'''\n\nimport hashlib\nimport hmac\nimport json\nimport os\nimport requests\nimport time\nimport urllib.parse\n\n\nclass WyreApi:\n ACCOUNT_ID = os.getenv(\"ACCOUNT_ID\")\n API_KEY = os.getenv(\"WYRE_APIKEY\")\n SEC_KEY = os.getenv(\"WYRE_TOKEN\")\n API_VER3 = \"/v3\"\n API_ACCOUNT_PATH = \"/accounts\"\n API_URL = \"https://api.testwyre.com\"\n\n\n\n\n '''\n This method calculates the auth signature hash required for secret key \n authentication\n '''\n\n def calc_auth_sig_hash(self, url_body):\n # calculates a signature per Wyre API:\n # https://docs.sendwyre.com/docs/authentication#secret-key-signature-auth\n message, secret = bytes(\n url_body, 'utf-8'), bytes(WyreApi.SEC_KEY, 'utf-8')\n newhash = hmac.new(secret, message, hashlib.sha256)\n return newhash.hexdigest()\n\n\n\n\n\n '''\n This method calculates a timesteamp required for the secret key \n authentication\n '''\n\n def calcTimeStamp(self):\n # creates a timestamp to the millisecond\n return str(round(time.time() * 1000))\n\n\n\n\n\n '''\n This method updates an account\n '''\n\n def updateAccount(self, post_data=None):\n if not post_data:\n print(\"You need to pass in an update object\")\n return\n\n params = {\n \"timestamp\": self.calcTimeStamp()\n # If you are masquerading (acting on behalf) of your subaccount\n # enter your account_id associated with your business account\n # You could add that field in when passing data into the method\n # \"masqueradeAs\": \"ENTER ACCOUNT ID HERE\"\n }\n url = WyreApi.API_URL + WyreApi.API_VER3 + WyreApi.API_ACCOUNT_PATH + \\\n \"?\" + urllib.parse.urlencode(params, encoding='utf-8')\n headers = {\n 'X-API-Key': WyreApi.API_KEY,\n 'X-API-Signature': self.calc_auth_sig_hash(url + json.dumps(post_data))\n }\n response = requests.post(url, headers=headers, json=post_data)\n if response.status_code == 200:\n return json.loads(response.text)\n else:\n print(response)\n\n \n \n\nif __name__ == \"__main__\":\n #=========== Initializes a Wyre Obj ============= #\n account = WyreApi()\n\n #======== Updating account with payment method ==== #\n # You can add/subtract any fields you'd like to update an account\n # https://docs.sendwyre.com/docs/account-resource#section-field-ids\n updateObj = {\n \"profileFields\": [{\n \"fieldId\": \"individualLegalName\",\n \"value\": \"Johnny Quest\"\n }, {\n \"fieldId\": \"individualCellphoneNumber\",\n \"value\": \"+1 715-111-2222\"\n }, {\n \"fieldId\": \"individualEmail\",\n \"value\": \"lol:::at:::bananaphone.com\"\n }, {\n \"fieldId\": \"individualDateOfBirth\",\n \"value\": \"1990-09-24\"\n }, {\n \"fieldId\": \"individualResidenceAddress\",\n \"value\": {\n \"street1\": \"1 Market St\",\n \"street2\": \"Suite 420\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n }\n }\n ]\n }\n\n update = account.updateAccount(updateObj)\n # Prints the server response\n if update:\n \tprint(update)","language":"python"},{"language":"json","code":"{\n\t\"profileFields\": [{\n\t\t\"fieldId\": \"individualLegalName\",\n\t\t\"value\": \"Johnny Quest\"\n\t}, {\n\t\t\"fieldId\": \"individualCellphoneNumber\",\n\t\t\"value\": \"+1 715-111-2222\"\n\t}, {\n\t\t\"fieldId\": \"individualEmail\",\n\t\t\"value\": \"[email protected]\"\n\t}, {\n\t\t\"fieldId\": \"individualDateOfBirth\",\n\t\t\"value\": \"1990-09-24\"\n\t}, {\n\t\t\"fieldId\": \"individualResidenceAddress\",\n\t\t\"value\": {\n\t\t\t\t\"street1\": \"1 Market St\",\n\t\t\t\t\"street2\": \"Suite 420\",\n\t\t\t\t\"city\": \"San Francisco\",\n\t\t\t\t\"state\": \"CA\",\n\t\t\t\t\"postalCode\": \"94105\",\n\t\t\t\t\"country\": \"US\"\n\t\t\t}\n\t}\n\t]\n}"},{"code":"################### Update a Wyre Account ###################\n# In this example below, I'm using the test env. When you are ready, use the production url: https://api.sendwyre.com\n\n# Feel free to input your fields to update an account. \n\ncurl -X POST \\\n-H \"Content-Type: application/json\" \\\n-H \"Authorization: Bearer YOUR-BEARER-TOKEN\" \\\n-d '{\"profileFields\": [\\\n{\"fieldId\": \"individualLegalName\",\"value\": \"Johnny Quest\"}, \\\n{\"fieldId\": \"individualCellphoneNumber\",\"value\": \"+1 715-111-2222\"}, \\\n{\"fieldId\": \"individualEmail\",\"value\": \"[email protected]\"}, \\\n{\"fieldId\": \"individualDateOfBirth\",\"value\": \"1990-09-24\"}, \\\n{\"fieldId\": \"individualResidenceAddress\",\"value\": ] \\\n{\"street1\": \"1 Market St\",\\\n\"street2\": \"Suite 420\", \\\n\"city\": \"San Francisco\", \\\n\"state\": \"CA\", \\\n\"postalCode\": \"94105\", \\\n \"country\": \"US\"}}]}' \\\nhttps://api.testwyre.com/v3/accounts/your_account_id\n#Ex: https://api.testwyre.com/v3/accounts/AC-U4BWHGZDG6W","language":"curl"}]},"results":{"codes":[{"status":200,"language":"json","code":"{\n \"id\" : \"AC-U4BWHGZDG6W\",\n \"status\" : \"PENDING\",\n \"type\" : \"INDIVIDUAL\",\n \"country\" : \"US\",\n \"createdAt\" : 1541789972000,\n \"depositAddresses\" : {\n \"ETH\" : \"0x98B031783d0efb1E65C4072C6576BaCa0736A912\",\n \"BTC\" : \"14CriXWTRoJmQdBzdikw6tEmSuwxMozWWq\"\n },\n \"totalBalances\" : { \n \"BTC\" : 1.0000000,\n \"ETH\" : 0.1000000000000000000\n },\n \"availableBalances\" : { \n \"BTC\" : 1.0000000,\n \"ETH\" : 0.1000000000000000000\n },\n \"profileData\" : [ {\n \"fieldId\" : \"individualCellphoneNumber\",\n \"fieldType\" : \"CELLPHONE\",\n \"value\" : null,\n \"note\" : \"Must be verified by user.\",\n \"status\" : \"OPEN\"\n }, {\n \"fieldId\" : \"individualEmail\",\n \"fieldType\" : \"EMAIL\",\n \"value\" : \"[email protected]\",\n \"note\" : \"Must be verified by user.\",\n \"status\" : \"OPEN\"\n }, {\n \"fieldId\" : \"individualLegalName\",\n \"fieldType\" : \"STRING\",\n \"value\" : \"Johnny Quest\",\n \"note\" : null,\n \"status\" : \"PENDING\"\n }, {\n \"fieldId\" : \"individualDateOfBirth\",\n \"fieldType\" : \"DATE\",\n \"value\" : null,\n \"note\" : null,\n \"status\" : \"OPEN\"\n }, {\n \"fieldId\" : \"individualSsn\",\n \"fieldType\" : \"STRING\",\n \"value\" : null,\n \"note\" : null,\n \"status\" : \"NULL\"\n }, {\n \"fieldId\" : \"individualResidenceAddress\",\n \"fieldType\" : \"ADDRESS\",\n \"value\" : {\n \"street1\": \"1 Market St\",\n \"street2\": \"Suite 402\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"postalCode\": \"94105\",\n \"country\": \"US\"\n },\n \"note\" : null,\n \"status\" : \"PENDING\"\n }, {\n \"fieldId\" : \"individualGovernmentId\",\n \"fieldType\" : \"DOCUMENT\",\n \"value\" : [],\n \"note\" : null,\n \"status\" : \"OPEN\"\n }, {\n \"fieldId\" : \"individualSourceOfFunds\",\n \"fieldType\" : \"PAYMENT_METHOD\",\n \"value\" : null,\n \"note\" : \"Payment method not yet submitted\",\n \"status\" : \"OPEN\"\n } ]\n}","name":""}]},"settings":"","params":[{"name":"accountId","type":"string","default":"","desc":"the ID of the Account you are updating","required":false,"in":"path","ref":"","_id":"5be60230d37d5c0029ef2b04"}],"apiSetting":"5c50b085aae6150014b3e80e"},"next":{"description":"","pages":[]},"title":"Update Account","type":"endpoint","slug":"submit-account-info","excerpt":"","body":"[block:api-header]\n{\n \"title\": \"Field Statuses\"\n}\n[/block]\nYou'll submit the account information to be processed on Wyre. The ```status``` field is then going to be updated to either **OPEN** | **PENDING** | **APPROVED**. We provide a ```note``` field, which will provide guidance on resolving the issue.\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Status\",\n \"h-1\": \"Description\",\n \"0-0\": \"OPEN\",\n \"0-1\": \"Awaiting action from user.\",\n \"1-0\": \"PENDING\",\n \"1-1\": \"Awaiting action from Wyre.\",\n \"2-0\": \"APPROVED\",\n \"2-1\": \"No further action needed.\",\n \"h-2\": \"Example\",\n \"0-2\": \"Expired document, awaiting resubmission.\",\n \"1-2\": \"Processing on Wyre.\",\n \"2-2\": \"Document successfully verified.\"\n },\n \"cols\": 3,\n \"rows\": 3\n}\n[/block]","updates":[],"order":3,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5bc634af877b13001e06330d","project":"550f74bb6fc8130d0038aad3","version":{"version":"3","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded","5e8127d61c906800374eeb1c","5f2768c98622b8005106544a","5f2768d05702ca0011f7655e","5f276e5348d2b600321aef9b","5f276fd300e519001139200a","5f9a2cb79dafe500259281a7","5fd92bf362bb7301b00e48ba"],"_id":"550f75de61d9d30d00af9e01","__v":24,"releaseDate":"2015-03-23T02:09:34.221Z","project":"550f74bb6fc8130d0038aad3","createdAt":"2015-03-23T02:09:34.221Z","forked_from":"550f74bb6fc8130d0038aad6"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Accounts","slug":"accounts","order":9,"from_sync":false,"reference":true,"_id":"5bc633a722d682005c9ad9e4","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","createdAt":"2018-10-16T18:53:27.204Z","__v":0},"user":"56ddd4424acab82000ae9d30","createdAt":"2018-10-16T18:57:51.033Z","__v":23,"parentDoc":null}
postUpdate Account
Definition
{{ api_url }}{{ page_api_url }}
Parameters
Path Params
accountId:
string
the ID of the Account you are updating