User Tools

Site Tools


api:customer:address-create

API : Customer Address Create

Introduction

This request will create a new address on the customer.

Request

URL https://api.telecomx.dk/customer/CUSTOMER_ID/address
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 (24 hex-char string).
Body JSON object
primary Boolean [optional] True if this is the primary address. Defaults to false.
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 [optional] ISO3166-1 2-char country code. Defaults to DK when omitted.
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.

All properties marked as [optional] can be left out of the request.

Request body example

{
  "address": "Eksempelvej 23",
  "zip": "4000",
  "city": "Roskilde",
  "country": "DK"
}

Response

The response will be the newly created 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": false,
  "alternativeName": "",
  "address": "Eksempelvej 23",
  "zip": "4000",
  "city": "Roskilde",
  "country": "DK",
  "municipalityCode": 265
}

Errors

Error code Message Description
422 customer Customer id is invalid
404 not_found Customer 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)
404 address Address is missing
404 zip Zip code is missing
404 city City is missing
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
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/customer/address-create.txt · Last modified: by Mikkel Meerwaldt Jørgensen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki