User Tools

Site Tools


api:customer:address-update

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 VIEWER, MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN.
Param CUSTOMER_ID Id of customer
ADDRESS_ID Id of the address
Body JSON object
_id Id Id of the address, will be ignored, but for convenience is allowed.
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

{
  _id: '1234567890ABCDEF12345678',
  address: 'Paradis Æblevej 123'
}

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: '52f4fd7734697b2800000001',
  primary: false,
  address: 'Paradis Æblevej 123',
  zip: '123',
  city: 'Andeby',
  country: 'Cartoonistan',
  municipalityCode: 101
}

Errors

Error code Message Description
400 customer Customer id not found in URI
400 address Address not found in body of request
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
404 zip Invalid zip code for Denmark
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
500 internal_error <Unspecified>
api/customer/address-update.txt · Last modified: 2016/05/29 13:41 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki