Developer documentation

Update customer

post https://app.iteras.dk/api/customers/updatecustomer/

The /api/customers/updatecustomer/ endpoint changes the attributes of a customer.

Parameters

  • id string required
    ID of the customer to update.
  • data object
    The 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 in data are not touched. To delete the value of a field, pass null for that field.
  • create boolean Defaults to false
    If set to true, the customer is created if not found. Otherwise an unknown customer ID results in an error.
  • use_external_lookup boolean Defaults to true
    Set to false or 0 if you don't want e-invoice recipients, VAT organization IDs and similar to be validated via external services.

You can change these built-in customer fields in data:

  • name, company, address and country
  • email
  • billing_name, billing_company, billing_address, billing_country and billing_email
  • password - you can't retrieve it in clear text afterwards as it goes through a hash
  • created

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.

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": "Eksempeltekst",
    ":Custom date field": "2026-09-09",
    ":Obsolete field": null
  }
}

On success the endpoint returns the ID of the updated customer:

{ "id": "12345" }

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"
  }
}

An invalid field value returns an error as described below.

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."]
}