Update User Profile
Uri: https://api.finerworks.com/v3/update_user
Method: PUT
Updates various features of a users account which can be useful.
Body
Name | Description | Type | Additional information |
---|---|---|---|
account_key |
Optional - account unique identifier. Note if it does not match the account unique identifier the app key is assigned to then this will not be utlized. Only app keys with proper permissions can use this. |
text |
None. |
billing_info |
Optional - This is the address you want to keep on file in your billing address. To prevent payment validation issues (i.e. credit card zip code mismatch), this should be the same address as your credit card. If null, no changes or modifcations will occur for the user's billing address. |
address |
None. |
business_info |
Optional - This is the address you want to keep on file in your business address. If null, no changes or modifcations will occur for the user's billing address. |
address |
None. |
logo_data |
Optional - Alternatively, the byte data for the image can be included in the JSON payload. This should be a JPG image file that has been converted to byte data. The image will be resized and saved as 600x180 pixels. If null no changes or modifcations will occur for the user's logo. |
array (byte) |
None. |
portrait_data |
Optional - Alternatively, the byte data for the image can be included in the JSON payload. This should be a JPG image file that has been converted to byte data. If null no changes or modifcations will occur for the user's portrait. |
array (byte) |
None. |
payment_profile_id |
Optional - Represents the user's BrainTree customer id. Required for billing of orders submitted via the api. |
text |
None. |
Example JSON Body
application/json, text/json
{ "account_key": "sample string 1", "billing_info": { "first_name": "sample string 1", "last_name": "sample string 2", "company_name": "sample string 3", "address_1": "sample string 4", "address_2": "sample string 5", "address_3": "sample string 6", "city": "sample string 7", "state_code": "sample string 8", "province": "sample string 9", "zip_postal_code": "sample string 10", "country_code": "sample string 11", "phone": "sample string 12", "email": "sample string 13", "address_order_po": "sample string 14" }, "business_info": { "first_name": "sample string 1", "last_name": "sample string 2", "company_name": "sample string 3", "address_1": "sample string 4", "address_2": "sample string 5", "address_3": "sample string 6", "city": "sample string 7", "state_code": "sample string 8", "province": "sample string 9", "zip_postal_code": "sample string 10", "country_code": "sample string 11", "phone": "sample string 12", "email": "sample string 13", "address_order_po": "sample string 14" }, "logo_url": "sample string 2", "logo_data": "QEA=", "portrait_data": "QEA=", "payment_profile_id": "sample string 3" }
Sample Code Library
curl --location --request sample_method 'https://api.finerworks.comsample_endpoint' \
--header 'Content-Type: application/json' \
--header 'web_api_key: my-web-api-key-goes-here' \
--header 'app_key: my-app-key-goes-here' \
--data-raw '{
"account_key": "sample string 1",
"billing_info": {
"first_name": "sample string 1",
"last_name": "sample string 2",
"company_name": "sample string 3",
"address_1": "sample string 4",
"address_2": "sample string 5",
"address_3": "sample string 6",
"city": "sample string 7",
"state_code": "sample string 8",
"province": "sample string 9",
"zip_postal_code": "sample string 10",
"country_code": "sample string 11",
"phone": "sample string 12",
"email": "sample string 13",
"address_order_po": "sample string 14"
},
"business_info": {
"first_name": "sample string 1",
"last_name": "sample string 2",
"company_name": "sample string 3",
"address_1": "sample string 4",
"address_2": "sample string 5",
"address_3": "sample string 6",
"city": "sample string 7",
"state_code": "sample string 8",
"province": "sample string 9",
"zip_postal_code": "sample string 10",
"country_code": "sample string 11",
"phone": "sample string 12",
"email": "sample string 13",
"address_order_po": "sample string 14"
},
"logo_url": "sample string 2",
"logo_data": "QEA=",
"portrait_data": "QEA=",
"payment_profile_id": "sample string 3"
}'
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.finerworks.comsample_endpoint');
$request->setMethod(HTTP_Request2::METHOD_sample_method);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'web_api_key' => 'my-web-api-key-goes-here',
'app_key' => 'my-app-key-goes-here'
));
$request->setBody('{
'account_key': 'sample string 1',
'billing_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'business_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'logo_url': 'sample string 2',
'logo_data': 'QEA=',
'portrait_data': 'QEA=',
'payment_profile_id': 'sample string 3'
}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
var client = new RestClient("https://api.finerworks.comsample_endpoint");
client.Timeout = -1;
var request = new RestRequest(Method.sample_method);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("web_api_key", "my-web-api-key-goes-here");
request.AddHeader("app_key", "my-app-key-goes-here");
request.AddParameter("application/json", "{
'account_key': 'sample string 1',
'billing_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'business_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'logo_url': 'sample string 2',
'logo_data': 'QEA=',
'portrait_data': 'QEA=',
'payment_profile_id': 'sample string 3'
}, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var settings = {
"url": "https://api.finerworks.comsample_endpoint",
"method": "sample_method",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"web_api_key": "my-web-api-key-goes-here",
"app_key": "my-app-key-goes-here"
},
"data": JSON.stringify({
'account_key': 'sample string 1',
'billing_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'business_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'logo_url': 'sample string 2',
'logo_data': 'QEA=',
'portrait_data': 'QEA=',
'payment_profile_id': 'sample string 3'
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'sample_method',
'hostname': 'api.finerworks.com',
'path': 'sample_endpoint',
'headers': {
'Content-Type': 'application/json',
'web_api_key': 'my-web-api-key-goes-here',
'app_key': 'my-app-key-goes-here'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"account_key": "sample string 1",
"billing_info": {
"first_name": "sample string 1",
"last_name": "sample string 2",
"company_name": "sample string 3",
"address_1": "sample string 4",
"address_2": "sample string 5",
"address_3": "sample string 6",
"city": "sample string 7",
"state_code": "sample string 8",
"province": "sample string 9",
"zip_postal_code": "sample string 10",
"country_code": "sample string 11",
"phone": "sample string 12",
"email": "sample string 13",
"address_order_po": "sample string 14"
},
"business_info": {
"first_name": "sample string 1",
"last_name": "sample string 2",
"company_name": "sample string 3",
"address_1": "sample string 4",
"address_2": "sample string 5",
"address_3": "sample string 6",
"city": "sample string 7",
"state_code": "sample string 8",
"province": "sample string 9",
"zip_postal_code": "sample string 10",
"country_code": "sample string 11",
"phone": "sample string 12",
"email": "sample string 13",
"address_order_po": "sample string 14"
},
"logo_url": "sample string 2",
"logo_data": "QEA=",
"portrait_data": "QEA=",
"payment_profile_id": "sample string 3"
});
req.write(postData);
req.end();
require "uri"
require "net/http"
url = URI("https://api.finerworks.comsample_endpoint")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::sample_method.new(url)
request["Content-Type"] = "application/json"
request["web_api_key"] = "my-web-api-key-goes-here"
request["app_key"] = "my-app-key-goes-here"
request.body = "{
'account_key': 'sample string 1',
'billing_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'business_info': {
'first_name': 'sample string 1',
'last_name': 'sample string 2',
'company_name': 'sample string 3',
'address_1': 'sample string 4',
'address_2': 'sample string 5',
'address_3': 'sample string 6',
'city': 'sample string 7',
'state_code': 'sample string 8',
'province': 'sample string 9',
'zip_postal_code': 'sample string 10',
'country_code': 'sample string 11',
'phone': 'sample string 12',
'email': 'sample string 13',
'address_order_po': 'sample string 14'
},
'logo_url': 'sample string 2',
'logo_data': 'QEA=',
'portrait_data': 'QEA=',
'payment_profile_id': 'sample string 3'
}"
response = https.request(request)
puts response.read_body
Name | Description | Type | Additional information |
---|---|---|---|
status | response_status |
None. |
|
user_account | user_account |
None. |
Example JSON Response
application/json, text/json
{ "status": { "success": true, "status_code": 200, "message": "", "debug": null }, "user_account": { "account_id": 1, "account_username": "bob_ross", "account_email": "bobbyross12@gmail.com", "billing_info": { "first_name": "Bob", "last_name": "Ross", "company_name": "Happy Little Trees, Inc", "address_1": "742 Evergreen Terrace", "address_2": null, "address_3": null, "city": "Mountain Scene", "state_code": "AK", "province": null, "zip_postal_code": "88888", "country_code": "us", "phone": "555-555-5555", "email": null, "address_order_po": "12345" }, "business_info": { "first_name": "Bob", "last_name": "Ross", "company_name": "Happy Little Trees, Inc", "address_1": "742 Evergreen Terrace", "address_2": null, "address_3": null, "city": "Mountain Scene", "state_code": "AK", "province": null, "zip_postal_code": "88888", "country_code": "us", "phone": "555-555-5555", "email": null, "address_order_po": "12345" }, "logo_url": null, "payment_profile_id": null, "user_account_credits": 0.0 } }