Update an Account Address
PUThttps://useast.api.elasticpath.com/v2/accounts/:accountID/addresses/:addressID
Update an address for an Account.
Request
Path Parameters
accountID stringrequired
The ID of the account you want to create an address for.
addressID stringrequired
The ID of the address you want to update.
- application/json
Body
data Addressrequired
Responses
- 200
- 400
- 404
OK
- application/json
- Schema
- Example (auto)
Schema
data object
{
"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",
"id": "5f8da740-6680-463e-b31c-190b2db4bf9d",
"meta": {
"timestamps": {
"created_at": "2021-02-23T09:40:33.882Z",
"updated_at": "2021-02-23T09:40:33.882Z"
}
},
"links": {
"self": "https://useast.api.elasticpath.com/v2/accounts/deb6b25f-8451-4211-9a22-95610333df23/addresses"
},
"relationships": {
"account": {
"id": "11afcf9b-971b-4fdb-8e10-f2ecf970718e",
"type": "account"
}
}
}
}
Bad Request
- application/json
- Schema
- Example (auto)
- bad-request-error
Schema
errors Error[]required
{
"errors": [
{
"status": "string",
"title": "string",
"detail": "string"
}
]
}
{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "Validation failed: field 'Name' on the 'min' tag."
}
]
}
Not Found
- application/json
- Schema
- Example (auto)
- not-found-error
Schema
errors Error[]required
{
"errors": [
{
"status": "string",
"title": "string",
"detail": "string"
}
]
}
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "account not found"
}
]
}
Authorization: http
name: BearerTokentype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://useast.api.elasticpath.com/v2/accounts/:accountID/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());
ResponseClear