Skip to main content

Update an Customer Address

PUT 

https://useast.api.elasticpath.com/v2/customers/:customerID/addresses/:addressID

Update an address for a Customer.

Request

Path Parameters

    customerID stringrequired

    The ID of the customer you want to create an address for.

    addressID stringrequired

    The ID of the customer you want to update.

Body

    data Addressrequired
    typestring

    Specifies the the type of object. Set this value to address.

    Default value: address
    first_namestring

    The first name of the recipient on this address.

    Example: Ron
    last_namestring

    The last name of the recipient on this address.

    Example: Swanson
    namestring

    The name for the address saved, such as home, work or wife’s office.

    Example: Home
    phone_numberstring

    A phone number for this address.

    Example: (555) 555-1234
    instructionsstring

    Any delivery instructions for this address.

    Example: Leave behind bin
    company_namestring

    The company name at this address.

    Example: Ron Swanson Enterprises
    line_1string

    The first portion of the address, usually the street address.

    Example: 1 Sunny Street
    line_2string

    The second portion of the address, usually an apartment or unit number.

    Example: Unit 101
    citystring

    The city for this address.

    Example: Sunny Town
    countystring

    The county for this address.

    Example: Sunnyville
    regionstring

    The state, province, territory, etc. for this address.

    Example: acc-legal-name
    postcodestring

    The ZIP Code, Postcode, or other postal reference string for this delivery address.

    Example: SU33 1YY
    countrystring

    A two digit code for the country this address is in, expressed as per the ISO 3166-2 standard.

    Example: GB

Responses

OK

Schema
    data object
    typestring

    Specifies the the type of object. Set this value to address.

    Default value: address
    first_namestring

    The first name of the recipient on this address.

    Example: Ron
    last_namestring

    The last name of the recipient on this address.

    Example: Swanson
    namestring

    The name for the address saved, such as home, work or wife’s office.

    Example: Home
    phone_numberstring

    A phone number for this address.

    Example: (555) 555-1234
    instructionsstring

    Any delivery instructions for this address.

    Example: Leave behind bin
    company_namestring

    The company name at this address.

    Example: Ron Swanson Enterprises
    line_1string

    The first portion of the address, usually the street address.

    Example: 1 Sunny Street
    line_2string

    The second portion of the address, usually an apartment or unit number.

    Example: Unit 101
    citystring

    The city for this address.

    Example: Sunny Town
    countystring

    The county for this address.

    Example: Sunnyville
    regionstring

    The state, province, territory, etc. for this address.

    Example: acc-legal-name
    postcodestring

    The ZIP Code, Postcode, or other postal reference string for this delivery address.

    Example: SU33 1YY
    countrystring

    A two digit code for the country this address is in, expressed as per the ISO 3166-2 standard.

    Example: GB
    idstring

    The unique identifier for an Address.

    Example: 5f8da740-6680-463e-b31c-190b2db4bf9d
    meta object
    timestamps object
    created_atstring

    The date the address is created.

    Example: 2021-02-23T09:40:33.882Z
    updated_atstring

    The date the address is updated.

    Example: 2021-02-23T09:40:33.882Z
    links object
    selfstring

    A URL to the specific resource.

    Example: https://useast.api.elasticpath.com/v2/customers/deb6b25f-8451-4211-9a22-95610333df23/addresses
    relationships object
    customer object
    idstring

    The ID of the customer.

    Example: 11afcf9b-971b-4fdb-8e10-f2ecf970718e
    typestring

    The type of object being returned.

    Example: customer

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://useast.api.elasticpath.com/v2/customers/:customerID/addresses/:addressID");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"address\",\n \"first_name\": \"Ron\",\n \"last_name\": \"Swanson\",\n \"name\": \"Home\",\n \"phone_number\": \"(555) 555-1234\",\n \"instructions\": \"Leave behind bin\",\n \"company_name\": \"Ron Swanson Enterprises\",\n \"line_1\": \"1 Sunny Street\",\n \"line_2\": \"Unit 101\",\n \"city\": \"Sunny Town\",\n \"county\": \"Sunnyville\",\n \"region\": \"acc-legal-name\",\n \"postcode\": \"SU33 1YY\",\n \"country\": \"GB\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Parameters
— pathrequired
— pathrequired
Body
{
  "data": {
    "type": "address",
    "first_name": "Ron",
    "last_name": "Swanson",
    "name": "Home",
    "phone_number": "(555) 555-1234",
    "instructions": "Leave behind bin",
    "company_name": "Ron Swanson Enterprises",
    "line_1": "1 Sunny Street",
    "line_2": "Unit 101",
    "city": "Sunny Town",
    "county": "Sunnyville",
    "region": "acc-legal-name",
    "postcode": "SU33 1YY",
    "country": "GB"
  }
}
ResponseClear

Click the Send API Request button above and see the response here!

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.