# Refunds

## Refund Trees

<mark style="color:green;">`POST`</mark> `/refund/trees`

* Trees that have not been billed for yet (e.g trees within 30 days of registration) can be undone. For any tree registrations older then 30 days, please reach out to <saif@thegoodapi.com>

**Headers**

| Name                                            | Value              |
| ----------------------------------------------- | ------------------ |
| Content-Type                                    | `application/json` |
| Authorization<mark style="color:red;">\*</mark> | `<API Key>`        |

**Body**

| Name | Type   | Description                                                                                                                                      |
| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id` | string | This can be fetched by making a call to [#get-total-trees-planted](https://docs.thegoodapi.com/planting-trees#get-total-trees-planted "mention") |

**Response**

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

```json
{
  "refunded_trees": 1001, // Total number of trees refunded. It'll be the full amt from the tree registration
  "total_planted_trees": 15, // Total planted (after refund)
  "refund_details": [ // details of the tree registration that was undone
    {
      "id": "Vf0YF7PuL5LDH0wh82Kt",
      "count": 1001,
      "fractional_count": 0,
      "created_at": "2025-07-07T00:24:06.884162Z",
      "idempotency_key": "",
      "metadata": {
        "key1": "val1",
        "key2": 714
      },
      "attribution": "saif282@gmail.com",
      "refunded": false
    }
  ],
  "refund_id": "refund-Vf0YF7PuL5LDH0wh82Kt"
}
```

{% endtab %}
{% endtabs %}

## Refund Plastic Bottles

<mark style="color:green;">`POST`</mark> `/refund/plastic_bottles`

* Impact that haa not been billed for yet (e.g within 30 days of registration) can be undone. For any registrations older then 30 days, please reach out to <saif@thegoodapi.com>

**Headers**

| Name                                            | Value              |
| ----------------------------------------------- | ------------------ |
| Content-Type                                    | `application/json` |
| Authorization<mark style="color:red;">\*</mark> | `<API Key>`        |

**Body**

| Name | Type   | Description                                                                                                                                                                                               |
| ---- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | string | This can be fetched by making a call to [#get-total-rescued-plastic-bottles-details](https://docs.thegoodapi.com/collect-ocean-bound-plastic-bottles#get-total-rescued-plastic-bottles-details "mention") |

**Response**

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

```json
{
  "refunded_bottles": 1, // Total number of bottles refunded. It'll be the full amt from the bottle registration
  "total_rescued_bottles": 10, // Total bottles (after refund)
  "refund_details": [ // details of the tree registration that was undone
    {
      "id": "Vf0YF7PuL5LDH0wh82Kt",
      "count": 1001,
      "fractional_count": 0,
      "created_at": "2025-07-07T00:24:06.884162Z",
      "idempotency_key": "",
      "metadata": {
        "key1": "val1",
        "key2": 714
      },
      "attribution": "saif282@gmail.com",
      "refunded": false
    }
  ],
  "refund_id": "refund-Vf0YF7PuL5LDH0wh82Kt"
}
```

{% endtab %}
{% endtabs %}
