Update customer
https://app.iteras.dk/api/customers/updatecustomer/
The /api/customers/updatecustomer/ endpoint changes the attributes of a customer.
Parameters
-
id string requiredID of the customer to update.
-
data objectThe attributes to change, e.g.
{"name": "Customer Name", "email": "john@example.com", "country": "NO"}. Valid attributes are the built-in ones and the customer fields setup inside Iteras for the account. Fields not mentioned indataare not touched. To delete the value of a field, passnullfor that field. -
create bool Defaults to
falseIf set totrue, the customer is created if not found. Otherwise an unknown customer ID results in an error. -
use_external_lookup bool Defaults to
trueSet tofalseor 0 if you don't want e-invoice recipients, VAT organization IDs and similar to be validated via external services. -
exclude_from_webhooks bool Defaults to
falseSet totrueto keep every event the request causes from being sent to webhooks, invoice and payment events included, e.g."exclude_from_webhooks": true. The events are still added to the history.
You can change these built-in customer fields in data:
name,company,addressandcountryemailbilling_name,billing_company,billing_address,billing_countryandbilling_emailpassword- you can't retrieve it in clear text afterwards as it goes through a hashcreated
Note that a few of these fields have a different name in the retrieval API for backwards compatibility.
You can set any custom customer field, using its field id (the field name with a colon prepended, or its external identifier).
Log in, or send your API key as a bearer token, to see the custom customer fields set up for your account.
A yes/no field (type bool) is true or false, and has no value when it isn't set. Set it with true or false, and clear it with null.
A date and time field (type datetime) can be set up to follow other fields, so it is set to the time one of them changes. If the same update changes the date and time field itself, that value is kept.
Examples
An example where we fill in name, address country and two custom fields and clear the obsolete field:
POST /api/customers/updatecustomer/ HTTP/1.1
Content-Type: application/json{
"id": "12345",
"data": {
"name": "New Name",
"address": "Some Street 12\n8000 Aarhus",
"country": "DK",
":Custom field": "Example text",
":Custom date field": "2026-09-30",
":Obsolete field": null
}
}With create set, an unknown customer ID creates the customer
instead of returning an error:
POST /api/customers/updatecustomer/ HTTP/1.1
Content-Type: application/json{
"id": "12345",
"create": true,
"data": {
"name": "Customer Name",
"email": "foo@example.com",
"country": "DK"
}
}Return value
On success the endpoint returns the ID of the updated customer:
{ "id": "12345" }
Errors
Invalid requests due to programming error, e.g. invalid JSON, returns 400.
A well-formed operation where a supplied value is invalid is not executed and returns an HTTP 422 error. The response is a JSON object with the errors keyed by the field they concern, e.g. a custom customer field:
{
":Custom date field": ["Enter a valid date."]
}
Errors that are not specific to a field are returned with the empty string as key:
{
"": ["Customer does not exist."]
}