Addresses

Addresses can be accessed through the API via the addresses base URL:

$ curl https://app.handshake-app.com/api/v2/addresses
  • Supported list methods: GET, POST
  • Supported detail methods: GET PUT DELETE

Addresses are also frequently accessed as sub-resources of either orders or customers. Please see the documentation for those resources for specific rules that may apply depending on whether the address is a bill-to or ship-to.

Points to note

  • An address that is the billTo of a customer cannot be deleted, nor can you change which customer it belongs to. When a customer is created its bill-to address is created at the same time and the two are connected to each other for life.

  • An address cannot be both a bill-to and ship-to at once (i.e. at least one of btCustomer and stCustomer must be null). In Handshake, the customer's bill-to is always available as a choice for the ship-to address on an order, so there is no need to add it to the customer's shipTos collection in order actually use it as a ship-to.

  • Addresses that are not connected to any customer (as either the bill-to or an additional ship-to) and are not connected to any sales order (as either the bill-to or ship-to) will be automatically deleted by the giant vacuum cleaner that stalks our datacenter.

Fields

address.id (string)
address.name (string)
address.street (string)
address.street2 (string)
address.city (string)
address.state (string)
address.postcode (string)
address.country (string)
address.phone (string)
address.fax (string)
address.multiLineStr (readonly string)

Returns a 2-4 line string representing the location part of this address as seen in various places throughout Handshake, e.g.:

198 Fifth Ave 
Apt 3F 
New York NY 10012 US

If you're rendering an address in an HTML template, you should probably render it using the linebreaksbr filter. See the template filter documentation for more information.

<p>{{ address.multiLineStr | linebreaksbr }}</p>
address.btCustomer (readonly reference to Customer)

The customer that this is the bill-to address of, or null if this address is not the bill-to address for any customer.

address.stCustomer (reference to Customer)

The customer that this is an additional ship-to address of, or null if this address is not an additional ship-to address for any customer.

Example

{
  "btCustomer":"/api/v2/customers/43",
  "city":"Brooklyn",
  "country":"US",
  "fax":"555-555-5559",
  "objID":44,
  "phone":"123-456-7894",
  "postcode":"11217",
  "resource_uri":"/api/v2/addresses/44",
  "stCustomer":null,
  "state":"NY",
  "street":"8051 Brown Road",
  "street2":""
}
Next: Credit Cards

Recent Discussions

28 Dec, 2012 03:29 AM
26 Dec, 2012 08:57 PM
17 Dec, 2012 11:37 PM