Update an Account
PUThttps://useast.api.elasticpath.com/v2/accounts/:accountID
Update the information contained on an account.
Request
Path Parameters
accountID uuidrequired
The ID of the account you want to retrieve.
- application/json
Body
data object
Responses
- 200
- 400
- 404
- default
OK
- application/json
- Schema
- Example (auto)
Schema
data object
{
"data": {
"id": "deb6b25f-8451-4211-9a22-95610333df23",
"type": "account",
"name": "acc-name",
"legal_name": "acc-legal-name",
"registration_id": "00000000-0000-1000-8000-000f00000300",
"external_ref": "16bedceb-8b2d-4f82-a973-b0a8d8432708",
"meta": {
"timestamps": {
"created_at": "2021-02-23T09:40:33.882Z",
"updated_at": "2021-02-23T09:40:33.882Z"
}
},
"links": {
"self": "/v2/accounts/deb6b25f-8451-4211-9a22-95610333df23"
}
}
}
Bad Request
- application/json
- Schema
- Example (auto)
Schema
errors object[]
{
"errors": [
{
"detail": "Validation failed: field 'Name' on the 'min' tag.",
"status": "400",
"title": "Bad Request"
}
]
}
Not Found
- application/json
- Schema
- Example (auto)
Schema
errors object[]
{
"errors": [
{
"detail": "account not found",
"status": "404",
"title": "Not Found"
}
]
}
Internal server error.
- application/json
- Schema
- Example (auto)
- internal-server-error
Schema
errors object[]required
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Internal server error
{
"errors": [
{
"title": "Internal Server Error",
"status": "500",
"detail": "there was a problem processing your request"
}
]
}
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");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"account\",\n \"name\": \"acc-name\",\n \"legal_name\": \"acc-legal-name\",\n \"registration_id\": \"reg-id\",\n \"external_ref\": \"ext-ref\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear