# Collect Ocean Bound Plastic Bottles

## Rescue Plastic Bottles

<mark style="color:green;">`POST`</mark> `https://app.thegoodapi.com/rescue/plastic_bottles`

Yes, collecting ocean bound plastic bottles is that easy!

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | string | \<API Key>  |

#### Request Body (JSON)

<table><thead><tr><th>Name</th><th width="362">Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>count</td><td>integer</td><td>The number of bottles you'd like to rescue</td><td>yes</td></tr><tr><td>attribution</td><td>string</td><td>Use this to tag an order with a non-unique look up key. This can be used later to filter orders down all trees with the attribution key</td><td>no</td></tr><tr><td>metadata</td><td>JSON</td><td>Use this to tag an order with various k/v pairs.</td><td>no</td></tr><tr><td>idempotency_key</td><td>string</td><td>Use this for idempotency </td><td>no</td></tr></tbody></table>

**Response**&#x20;

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

```json
{
  "total_rescued_bottles": 1001,
  "total_rescued_bottles_month": 1001,
  "bottle_details": [
    {
      "id": "6IbY4xsil27DH5G0U3Mg",
      "count": 1,
      "fractional_count": 0,
      "created_at": "2025-07-06T20:28:26.003429-04:00",
      "idempotency_key": "",
      "metadata": {
        "key1": "val1",
        "key2": 714
      },
      "attribution": "saif282@gmail.com",
      "refunded": false
    }
  ]
}

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Please make sure to get an [API Key from signing up first.](https://docs.thegoodapi.com/master#sign-up) To receive your beta\_token, email <saif@thegoodapi.com> and we'll get you sorted
{% endhint %}

## Get Total Rescued Plastic Bottles Details&#x20;

<mark style="color:blue;">`GET`</mark> `https://app.thegoodapi.com/rescue/plastic_bottles`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | \<API Key>  |

| Name             | Type   | Description                                                                                                                                                                                             |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| attribution\_key | String | Fetch by attribution key                                                                                                                                                                                |
| id               | String | Fetch by Bottle ID                                                                                                                                                                                      |
| created\_at      | String | All bottles registered after created date (fmt: xxxx-xx-xx)                                                                                                                                             |
| end\_at          | string | All bottles registered before an end date (fmt: xxxx-xx-xx)                                                                                                                                             |
| metadata         | json   | JSON to filter by metadata. Applies in "AND" operations. For example: {"key1": "val1", "key2":"val2"} will return all records that have the key1:val1 AND key2:val2 k/v pairs as part of their metadata |

**Example Curl:**

```
curl --request GET \
  --url http://app.thegoodapi.com/rescue/plastic_bottles \
  --header 'Authorization: {API_KEY}' \
  --header 'Content-Type: application/json'
```

**Response**

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

```javascript
{
  "total_rescued_bottles": 6,
  "total_rescued_bottles_month": 6,
  "bottle_details": [
    {
      "id": "i2SeocFjwNayo7PI7DpI",
      "count": 1,
      "created_at": "2025-07-02T02:07:31.374582Z",
      "idempotency_key": "",
      "metadata": {
        "key1": "val1",
        "key2": 786
      },
      "attribution": "user1@test.com"
    },
    {
      "id": "1NdT0fiH6Yi4ffsmmnmE",
      "count": 1,
      "created_at": "2025-07-02T02:06:57.723507Z",
      "idempotency_key": "",
      "metadata": null,
      "attribution": "user2@test.com"
    },
    ...
    ...
    ....
    ....
  ]
}
```

{% endtab %}
{% endtabs %}
