> For the complete documentation index, see [llms.txt](https://docs.papayaglobal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.papayaglobal.com/api-reference/groups-management/delete-payment-group.md).

# Delete Payment Group

The API is utilized to remove a payment group that is already saved on the platform.

{% hint style="info" %}
A group cannot be removed if it contains already executed payments.
{% endhint %}

<mark style="color:red;">**`DELETE`**</mark> /payments/groups/{id}?clear=true

**Body Parameters Request**

| Name  | Location       | Type    | Description                                                                                                                                 | Required |
| ----- | -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| id    | Url path       | string  | Group ID to be deleted.                                                                                                                     | Yes      |
| clear | url parameters | boolean | A group can only be deleted if empty, if it has non executed payments setting this to true will remove all pending payments and then delete |          |

**Body Parameters Response**

| Name             | Type    | Format / Values | Description                |
| ---------------- | ------- | --------------- | -------------------------- |
| group            | object  |                 | The group that was deleted |
| group.id         | string  |                 |                            |
| group.result     | boolean |                 |                            |
| payments         | array   | object          | List of payments removed   |
| payments\[]      | object  |                 |                            |
| payments\[].type | string  |                 |                            |
| payments\[].id   | string  |                 |                            |

**Request Example**

```json
DELETE /payments/groups/490f23cf-c6f3-4f83-9aed-8dff619735ba?clear=true
```

**Response Examples**

{% tabs %}
{% tab title="200 - OK" %}

```json
{
   "group": {
      "id": "490f23cf-c6f3-4f83-9aed-8dff619735ba",
      "result": true
   },
   "payments": [
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::-0vYeZkmSgSKX9dXClw-jQ"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::aBueWQPmT8eW1YPU2o8kIA"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::j_VJN0FJSaulsbhsVu3h2Q"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::srjoRbmcTc6ugHBzj-htBg"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::XUgmQZcZROm71poyAIs6QQ"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::zSGY89j3Rsebf9WC8PdNLQ"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::7S1DQ9bRQ0aRl67QU7iFgQ"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::fC_aAQ1zSUaYMbKnpl77zw"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::UVa7xjklRnurlJym9eNjIg"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::_k2jfAKrR4KVxqQ9S99ONQ"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::-8jfveMJQ92hfY3FpVj6dQ"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::cv3FLOYVS5yau6OY2gODlg"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::DQNbilghS-m2UNiaNmkvNw"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::jkIiWe9zTDCqIkaSB3r1gA"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::jst0R9i7SgKIZS_WSlEaAA"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::KCmRAYlJRU-8BQIq9TEBDA"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::OwqH_kgzQyGuvdWmyh0ZQg"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::RSmsds1rRYiJQR6cPFosbA"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::YK6Y7hbESqaOtoh2ookXFA"
      },
      {
         "type": "payment",
         "id": "demo:standalone:1709465100::yP3P2DelSjKFUcaTowH6pQ"
      }
   ]
}
```

{% endtab %}

{% tab title="404 - Not foun" %}

```json
{
  "error": "Not Found",
  "description": "No message available",
  "error_code": 404,
  "error_info": {
    "timestamp": "2024-03-04T14:18:15.749Z",
    "status": 404,
    "error": "Not Found",
    "message": "No message available",
    "path": "/groups/"
  }
}
```

{% endtab %}
{% endtabs %}
