Support for

FLAPI: Customer Addresses

Alistair Wilson
by Alistair Wilson 9 years ago
 
Each customer has a main invoicing address. They may have additional delivery addresses, accessed using these .../addresses requests.

Request 'addresses' by customer

GET Syntax
/customers/<customer.code>/addresses

Retrieves all addresses for a customer (limited to 300 items).

Request 'address' by customer and address id

GET Syntax
/customers/<customer.code>/addresses/<address.id>

Retrieves a single address item for a customer. Note that the address.id values are 6-character strings of numeric digits, having leading zeros.

HTTP request
GET http://dev.flyerlink.com/api.php/customers/HOTEST/addresses/000004?format=json
HTTP response (JSON)
{
    "address" : {
        "id" : "000004",
        "customer" : "HOTEST",
        "name" : "Fred Valentine",
        "address1" : "Name of the Building, or number+street",
        "address2" : "3rd Avenue",
        "address3" : "The Village",
        "address4" : "Trafford Park",
        "address5" : "",
        "countrycode" : "GB",
        "postcode" : "M17 1FG",
        "telephone" : "",
        "contact" : "Fred Valentine"
    }
}
Response Item Description
product Container item, with status attribute.
  id Unique identifier for the product.
  customer customer.code
  name Trading name of the business, or customer's name.
  address1 ... address5 Address lines. Some couriers require that some of these details match the postcode.
  postcode
  countrycode ISO 2-character country code.
  telephone The contact number, relevant to receiving deliveries at this address.
  contact The name of the person at this address, likely to be available to receive deliveries.

Create a 'customer address'

POST Syntax
/customers/<customer.code>/addresses

Adds a new address to the customer. The new address.id is returned in the response. Use this address.id only in the context of the same customer.code when working with existing addresses.

HTTP request
POST /customers/HOTEST/addresses
name=Address%20Created%20Through%20API&address1=legal%20name&address2=6%20street%20name&address3=town&address4=county&address5=state&countrycode=GB&postcode=ABC%20DEF&telephone=01234%20578901&contact=Mr%20Test%20Cust

Update a 'customer address'

PUT Syntax
/customers/<customer.code>/addresses/<address.id>

Updates one or more fields of an identified customer + address.

Only add the parameters you want to update.

 

Jump to contents page of

FLAPI: Customers

 
 
 

All content is (c) Nettl Systems Limited, 2024 and may not be used, copied or distributed without permission.