Ocean-Bound Plastic
Rescue ocean-bound plastic bottles and fetch the total number of bottles you’ve rescued.
Rescue plastic bottles
Section titled “Rescue plastic bottles”POST https://app.thegoodapi.com/rescue/plastic_bottles
Rescuing ocean-bound plastic bottles is this easy.
Headers
Section titled “Headers”| Name | Type | Description |
|---|---|---|
Authorization* | string | <API Key> |
Request body
Section titled “Request body”| Name | Type | Required | Description |
|---|---|---|---|
count | integer | Yes | The number of bottles you’d like to rescue |
attribution | string | No | Tag an order with a non-unique lookup key for filtering orders later |
metadata | JSON | No | Tag an order with arbitrary key/value pairs |
idempotency_key | string | No | Use this to safely retry requests without double-counting |
Response — 200 OK
Section titled “Response — 200 OK”{ "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 } ]}Get total rescued bottles
Section titled “Get total rescued bottles”GET https://app.thegoodapi.com/rescue/plastic_bottles
Headers
Section titled “Headers”| Name | Type | Description |
|---|---|---|
Authorization* | string | <API Key> |
Query parameters
Section titled “Query parameters”All query parameters are optional.
| Name | Type | Description |
|---|---|---|
attribution_key | string | Fetch by attribution key |
id | string | Fetch by Bottle ID |
created_at | string | Bottles registered after this date (format: YYYY-MM-DD) |
end_at | string | Bottles registered before this date (format: YYYY-MM-DD) |
metadata | JSON | Filter by metadata — applies as AND operations. Example: {"key1": "val1", "key2": "val2"} returns records that match both |
Example request
Section titled “Example request”curl --request GET \ --url https://app.thegoodapi.com/rescue/plastic_bottles \ --header 'Authorization: {API_KEY}' \ --header 'Content-Type: application/json'Response — 200 OK
Section titled “Response — 200 OK”{ "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" } ]}