Skip to content

Refunds

Reverse tree, plastic bottle, or charity donation registrations.

POST https://app.thegoodapi.com/refund/trees

NameValue
Content-Typeapplication/json
Authorization<your_api_key>
NameTypeDescription
idstringTree ID — fetch via the Get Total Trees Planted endpoint
{
"refunded_trees": 1001,
"total_planted_trees": 15,
"refund_details": [
{
"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"
}

POST https://app.thegoodapi.com/refund/plastic_bottles

NameValue
Content-Typeapplication/json
Authorization<your_api_key>
NameTypeDescription
idstringBottle ID — fetch via the Get Total Rescued Plastic Bottles endpoint
{
"refunded_bottles": 1,
"total_rescued_bottles": 10,
"refund_details": [
{
"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"
}

POST https://app.thegoodapi.com/refund/donations

NameValue
Content-Typeapplication/json
Authorization<your_api_key>
NameTypeRequiredDescription
idstringYesThe unique donation ID to refund
reasonstringNoHuman-readable reason for the refund
idempotency_keystringNoUnique key to prevent duplicate refund processing
metadataobjectNoArbitrary key-value pairs stored with the refund
{
"refunded_amount_cents": 5000,
"total_donations": 14,
"refund_details": [
{
"id": "don_abc123",
"amount_cents": 5000,
"currency": "USD",
"ein": "53-0196605",
"nonprofit_id": "n_abc123",
"charity_name": "American Red Cross",
"created_at": "2025-06-15T10:30:00Z",
"idempotency_key": "order-12345-donate",
"attribution": "checkout-flow",
"metadata": {
"order_id": "12345",
"customer_email": "user@example.com"
},
"refunded": true
}
],
"refund_id": "refund-don_abc123"
}