# Update PO Custom Columns

## Overview
The endpoint is used for updating the value of a user-defined PO column. In order to do that you must:

- Be an authenticated user

For information on how you can authenticate, see: [Authentication](https://developer.sellercloud.com/dev-article/authentication/)

## Endpoint
Example for such endpoint for TT server is [https://tt.api.sellercloud.com/api/PurchaseOrders/{id}/CustomColumns](https://tt.api.sellercloud.com/api/Orders/%7Border_ID%7D/CustomColumns)

For your server endpoint will be:

[https://{your_server_id}.api.sellercloud.com/api/PurchaseOrders/{id}/CustomColumns](https://{your_server_id}.api.sellercloud.com/api/Orders/%7Border_id%7D/CustomColumns)

## Request

- Method Type: **HttpPut**  
- Authorization: Use **Bearer Token** + token received from token authentication  
- Header info: **Content-Type: application/json**  
- Body data:

|     |     |     |     |
| --- | --- | --- | --- |
| **Parameter** | **Data Type** | **Description** | **Is Required** |
| ColumnName | string | Name of existing column name. Mandatory. | Yes |
| Value | string | Value of custom columns. Mandatory. | Yes |

## Example Request Payload
```json
{
   "ColumnName": "Some_Custom_Column",
   "Value": "Test value"
}
```

## Response
- If a server error appears, then the response will be with status code 500 => Internal Server Error  
- If updating the value of the custom column is successful, status code will be OK 200

## Demo in C#
```csharp
string token = "test token";
string url = $"http://cwa.api.sellercloud.com/api/PurchaseOrders/1/CustomColumns";

var content = new UpdateCustomColumnRequest()
{
    ColumnName = "TEST",
    Value = "TEST VALUE"
};

using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Put, url))
{
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

var json = JsonConvert.SerializeObject(content);
    using (var stringContent = new StringContent(json, Encoding.UTF8, "application/json"))
    {
        request.Content = stringContent;

HttpResponseMessage responseMessage = await client.SendAsync(request);
    }
}
```
