# Update Collection

This API is used to update a collection.

## Authentication

LeanX uses **Auth Token** to authenticate in each request's header.

{% hint style="info" %}
**Auth Token** can be retrieved in your portal dashboard under **API** page.
{% endhint %}

**Request Header**

{% code overflow="wrap" %}

```json
{
    "auth-token": "LP-0D7C06DE-MM|7394e58e-edee-4c42-9ca5-bcbc449f1b9f|2141df4a3cb633d5ce8683bb0c55067e5caebfbe07390dde277dc455bcc95c91723a81b5e565c7c02d68fb84e396722563016bf99e576a4b8cdbe4423fbf226b"
}
```

{% endcode %}

## Update a Collection

HTTP Method: <mark style="color:orange;">PUT</mark>

```
https://api.leanx.dev/api/v1/merchant/update-payment-collection
```

**Request Body**

```json
{
    "id": 99,
    "title": "TEST COLLECTION 2",
    "description": "collecetion description"
}
```

**Attributes**

<table><thead><tr><th width="251">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>Number</td><td>Your <a data-mention href="..">..</a> ID</td></tr><tr><td>title</td><td>String</td><td>Title of collection</td></tr><tr><td>description</td><td>String</td><td>Description of collection</td></tr></tbody></table>

**Response**

{% code overflow="wrap" %}

```json
{
  "response_code": 2000,
  "description": "SUCCESS",
  "app_version": "/api/v1",
  "talk_to_server_before": "2023-02-01T14:22:41.925868",
  "data": {
    "description": ""collecetion description",
    "enable_billing_address": false,
    "min_amount": 129.00,
    "title": "TEST COLLECTION 2",
    "fixed_amount": true,
    "id": 99,
    "uuid": "CL-177FF45196-LNP",
    "record_status": 1,
    "updated_at": "2023-02-01T14:22:41",
    "created_at": "2023-01-18T18:24:00"
  },
  "breakdown_errors": null,
  "token": "dbd44a99-2d0f-470d-91fe-c73e8cdd1848"
}
```

{% endcode %}
