Table of Contents

API : Customer Address Update

Introduction

This request will update an address on the customer.

Only the properties that needs to be updated, should be sent - see the example.

Request

URL https://api.telecomx.dk/customer/CUSTOMER_ID/address/ADDRESS_ID
Method POST
Access level MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller or a sub reseller.
RESELLER_ADMIN.
ADMIN.
Param CUSTOMER_ID Id of customer
ADDRESS_ID Id of the address
Body JSON object
primary Boolean True if this is the primary address.
alternativeName String [optional] Alternative name for this address.
address String Street, number etc., min 5 chars.
zip String Zip code, if country is Denmark or blank, zip is validated, otherwise min. 3 chars.
city String City, if country is Denmark or blank, city is automatically set based on zip, otherwise min. 2 chars.
state String [optional] State, only applies to US addresses.
country String ISO3166-1 2-char country code.
fixedNumber String [optional] Fixed phone number on this address, if it differs from the primary.
faxNumber String [optional] Fax number on this address, if it differs from the primary.

Request body example

{
  "address": "Eksempelvej 42"
}

Response

The response will be the updated address, if no errors occurred.

Json object
_id Id Id of address
primary Boolean True if this is the primary address
alternativeName String Alternative name for this address
address String Street, number etc., min. 5 chars.
zip String Zip code
city String City
state String State
country String Country
fixedNumber String Fixed phone number on this address, if it differs from the primary
faxNumber String Fax number on this address, if it differs from the primary
municipalityCode Integer Municipality code, automatically set by the system

Note that properties holding no value may be omitted from the object.

Example

{
  "_id": "650000000000000000000301",
  "primary": true,
  "alternativeName": "",
  "address": "Eksempelvej 42",
  "zip": "4000",
  "city": "Roskilde",
  "country": "DK",
  "municipalityCode": 265
}

Errors

Error code Message Description
422 customer Customer id is invalid
422 id Address id is invalid
404 not_found Customer not found
404 address Address not found
422 multiple Multiple errors (the inner property holds an array of errors this request generated, which can be any of the errors below)
422 address Invalid address
422 zip Invalid danish zip code
422 zip Invalid zip code
422 country Invalid country
422 city Invalid city
422 fixedNumber Number is not a valid phone number
422 faxNumber Number is not a valid phone number
409 address Addresses in use for Internet accounts cannot be changed
403 access_denied Insufficient access level
500 internal_error <Unspecified>