Customer Address data object specification for the Cratejoy Merchant API

The following methods operate on the Address data model. See the Customer Methods to understand how to find the address for a customer.

GET https://api.cratejoy.com/v1/addresses/{address_id}
PUT https://api.cratejoy.com/v1/addresses/{address_id}/
POST https://api.cratejoy.com/v1/addresses/{address_id}/

Get an address

GET https://api.cratejoy.com/v1/addresses/{address_id}
$.ajax({     
  url: 'https://api.cratejoy.com/v1/addresses/75562247/',
  method: 'GET'
});
{
  "city": "Austin", 
  "company": "", 
  "country": "US", 
  "icon": "United-States.png", 
  "id": 75562247, 
  "phone_number": "", 
  "state": "TX", 
  "status": 0, 
  "status_message": null, 
  "street": "101 Main St", 
  "to": "James Taylor", 
  "type": "address", 
  "unit": "", 
  "zip_code": "78701"
}

Update an address

PUT https://api.cratejoy.com/v1/addresses/{address_id}/
$.ajax({
    url: 'https://api.cratejoy.com/v1/addresses/75562247/',
    method: 'PUT',
    data: {
      street: "2012 Northridge Dr",
      zip_code: "78723"
    }
});
{
  "city": "Austin", 
  "company": "", 
  "country": "US", 
  "icon": "United-States.png", 
  "id": 75562247, 
  "phone_number": "", 
  "state": "TX", 
  "status": 0, 
  "status_message": null, 
  "street": "2012 Northridge Dr", 
  "to": "James Taylor", 
  "type": "address", 
  "unit": "", 
  "zip_code": "78723"
}

The following methods operate on the Address data model. See the Customer Methods to understand how to find the address for a customer.

GET https://api.cratejoy.com/v1/addresses/{address_id}
PUT https://api.cratejoy.com/v1/addresses/{address_id}/

Create an address

POST https://api.cratejoy.com/v1/addresses/{address_id}/
$.ajax({
    url: 'https://api.cratejoy.com/v1/addresses/',
    method: 'PUT',
    data: {
      customer_id: "12345",
      to: "James Taylor",
      street: "2012 Northridge Dr",
      zip_code: "78723",
      state: "TX",
      country: "US"
    }
});
{
  "city": "Austin", 
  "company": "", 
  "country": "US", 
  "icon": "United-States.png", 
  "id": 75562247, 
  "phone_number": "", 
  "state": "TX", 
  "status": 0, 
  "status_message": null, 
  "street": "2012 Northridge Dr", 
  "to": "James Taylor", 
  "type": "address", 
  "unit": "", 
  "zip_code": "78723"
}