Skip to content

Shopify API

The Shopify API enables Shopify merchants and integration partners (such as Avada Joy Loyalty, Yotpo Reviews, LoyaltyLion, and Klaviyo) to programmatically plant trees, recover ocean plastic, trigger charity donations, fetch impact statistics, process reversals, and retrieve verification evidence.


All requests to the Shopify API require authentication via HTTP headers.

Header NameTypeRequiredDescription
api_key*stringYesYour Shopify API Key (PROD-xxxx... or TEST-xxxx...).
shop_name*stringYesYour Shopify store domain (e.g., my-store.myshopify.com).
user_idstringOptionalStore user identifier. If present, user_id overrides shop_name.
Content-TypestringYesapplication/json (required for POST requests).
Idempotency-KeystringOptionalUnique key to safely retry write operations without duplicate executions.

GET https://sprout-app.thegoodapi.com/app/api/verify

Verifies the provided API key and returns active key mode (PROD vs TEST), store status, and enabled features. Rejects Standalone API keys with HTTP 401 WRONG_KEY_TYPE.

Header NameTypeRequiredDescription
api_key*stringYesYour Shopify API Key
shop_name*stringYesYour Shopify store domain
{
"status": "active",
"shop_domain": "my-store.myshopify.com",
"key_mode": "PROD",
"features": {
"tree_planting": true,
"plastic_removal": true,
"donations": true
}
}
Terminal window
curl -X GET "https://sprout-app.thegoodapi.com/app/api/verify" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com"

POST https://sprout-app.thegoodapi.com/app/api/plant

Trigger tree planting for a customer order or loyalty reward redemption.

ParameterTypeRequiredDescription
treesintegerYesNumber of trees to plant.
customer_namestringOptionalCustomer full name for attribution and customer-scoped queries.
order_idstringOptionalShopify Order ID or order reference.
notesstringOptionalIntegration notes or redemption details.
{
"status": "success",
"trees_planted": 5,
"customer_name": "Jane Doe",
"order_id": "1001"
}
Terminal window
curl -X POST "https://sprout-app.thegoodapi.com/app/api/plant" \
-H "Content-Type: application/json" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com" \
-d '{
"trees": 5,
"customer_name": "Jane Doe",
"order_id": "1001",
"notes": "Loyalty Points Redemption"
}'

GET https://sprout-app.thegoodapi.com/app/api/plant

Query planted tree records with support for date range filtering and cursor pagination.

ParameterTypeRequiredDescription
customer_namestringOptionalFilter by customer name (supports substring & case-insensitive matching).
customer_emailstringOptionalFilter by customer email address (case-insensitive).
emailstringOptionalAlias for customer_email.
customer_idstring / integerOptionalFilter by numeric customer ID or string ID.
customerstringOptionalFlexible customer filter (matches customer name, email, or ID).
order_idstringOptionalFilter by order ID (supports # prefix matching, e.g. 1001 matches #1001).
start_datestringOptionalFilter records created on or after date (YYYY-MM-DD).
end_datestringOptionalFilter records created before date (YYYY-MM-DD).
limitintegerOptionalMax items to return (default: 20, max: 100).
after_created_atstringOptionalCursor timestamp for fetching next page.
{
"trees": [
{
"id": "tree_66a9b1c2d3e4",
"count": 5,
"customer_name": "Jane Doe",
"order_id": "1001",
"created_at": "2026-07-27T12:00:00Z"
}
],
"count": 1,
"has_more": false,
"next_cursor": ""
}
Terminal window
curl -X GET "https://sprout-app.thegoodapi.com/app/api/plant?customer_name=Jane+Doe&limit=20" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com"

POST https://sprout-app.thegoodapi.com/app/api/plastic

Trigger ocean plastic bottle recovery for a customer order or reward redemption.

ParameterTypeRequiredDescription
bottlesintegerYesNumber of plastic bottles to recover.
customer_namestringOptionalCustomer full name for attribution.
order_idstringOptionalShopify Order ID.
notesstringOptionalIntegration notes.
{
"status": "success",
"bottles_rescued": 50,
"customer_name": "Jane Doe",
"order_id": "1001"
}
Terminal window
curl -X POST "https://sprout-app.thegoodapi.com/app/api/plastic" \
-H "Content-Type: application/json" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com" \
-d '{
"bottles": 50,
"customer_name": "Jane Doe",
"order_id": "1001"
}'

GET https://sprout-app.thegoodapi.com/app/api/plastic

Query ocean plastic recovery records with date range filtering and cursor pagination.

ParameterTypeRequiredDescription
customer_namestringOptionalFilter by customer name (supports substring & case-insensitive matching).
customer_emailstringOptionalFilter by customer email address (case-insensitive).
emailstringOptionalAlias for customer_email.
customer_idstring / integerOptionalFilter by numeric customer ID or string ID.
customerstringOptionalFlexible customer filter (matches customer name, email, or ID).
order_idstringOptionalFilter by order ID (supports # prefix matching).
start_datestringOptionalFilter records created on or after date (YYYY-MM-DD).
end_datestringOptionalFilter records created before date (YYYY-MM-DD).
limitintegerOptionalMax items to return (default: 20).
after_created_atstringOptionalCursor timestamp for fetching next page.
{
"plastics": [
{
"id": "plastic_77b8c9d0e1",
"count": 50,
"customer_name": "Jane Doe",
"order_id": "1001",
"created_at": "2026-07-27T12:05:00Z"
}
],
"count": 1,
"has_more": false,
"next_cursor": ""
}

POST https://sprout-app.thegoodapi.com/app/api/charity/donate

Trigger a charitable donation allocation for a customer purchase or loyalty redemption.

ParameterTypeRequiredDescription
charity_idstringYesNon-profit charity partner ID.
amount_dollarsnumberYesDonation amount in USD (supports amount, donation_amount, or amount_dollars).
customer_namestringOptionalCustomer full name for attribution.
order_idstringOptionalShopify Order ID.
{
"status": "success",
"charity_id": "charity_trees_for_future",
"amount": 5.00,
"mode": "PROD"
}
Terminal window
curl -X POST "https://sprout-app.thegoodapi.com/app/api/charity/donate" \
-H "Content-Type: application/json" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com" \
-d '{
"charity_id": "charity_trees_for_future",
"amount_dollars": 5.00,
"customer_name": "Jane Doe"
}'

GET https://sprout-app.thegoodapi.com/app/api/impact/stats

Retrieve store-wide or customer-scoped lifetime impact totals (trees, plastic_bottles, donations, co2_kg).

ParameterTypeRequiredDescription
customer_namestringOptionalFilter impact stats by customer name (supports substring & case-insensitive matching).
customer_emailstringOptionalFilter impact stats by customer email (case-insensitive).
emailstringOptionalAlias for customer_email.
customer_idstring / integerOptionalFilter impact stats by numeric customer ID or string ID.
customerstringOptionalFlexible customer filter (matches customer name, email, or ID).
{
"trees": 15,
"plastic_bottles": 100,
"donations": 10.00,
"co2_kg": 300.0,
"customer_scoped": true
}
Terminal window
curl -X GET "https://sprout-app.thegoodapi.com/app/api/impact/stats?customer_name=Jane+Doe" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com"

POST https://sprout-app.thegoodapi.com/app/api/refund

Reverses tree, plastic, or donation allocations when an order or loyalty redemption is cancelled. Restores tree/plastic units directly back to the merchant’s top-up balance.

ParameterTypeRequiredDescription
typestringYesUnit type to reverse (tree, plastic, or donation).
quantityintegerYesQuantity of units to reverse.
customer_namestringOptionalCustomer name associated with the original allocation.
reasonstringOptionalReason for reversal.
{
"status": "success",
"mode": "PROD",
"refunded_type": "tree",
"count": 5
}
Terminal window
curl -X POST "https://sprout-app.thegoodapi.com/app/api/refund" \
-H "Content-Type: application/json" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com" \
-d '{
"type": "tree",
"quantity": 5,
"customer_name": "Jane Doe",
"reason": "Customer cancelled loyalty reward"
}'

GET https://sprout-app.thegoodapi.com/app/api/evidence

Delegates directly to treeapi (/evidence endpoint) to retrieve planting evidence photos/videos, region metadata, and timeline events matching target impact dates (unrelated to certificates).

ParameterTypeRequiredDescription
tree_idstringOptionalTree record ID (tree_id, id, or tree).
impact_typestringOptionalImpact type (trees, default: trees).
created_atstringOptionalTarget impact date timestamp (YYYY-MM-DD or ISO timestamp).
tree_datestringOptionalAlias for created_at.
project_public_idstringOptionalFilter by project public ID.
regionstringOptionalFilter by region name.
{
"tree_id": "test_tree_1001",
"impact_type": "trees",
"created_at": "2024-05-15T10:00:00Z",
"region": "Kenya",
"evidence_count": 5,
"timeline": [
{
"event": "Planted",
"status": "Completed"
}
]
}
Terminal window
curl -X GET "https://sprout-app.thegoodapi.com/app/api/evidence?tree_id=test_tree_1001" \
-H "api_key: PROD-8f92a1b3-4c56-7d89" \
-H "shop_name: my-store.myshopify.com"

Error CodeHTTP StatusDescriptionAction / Resolution
UNAUTHORIZED401 UnauthorizedMissing required api_key or shop_name/user_id headers.Include valid authentication headers.
WRONG_KEY_TYPE401 UnauthorizedStandalone API key used on Shopify API endpoint.Use a store Prod (PROD-) or Test (TEST-) API key.
INVALID_KEY401 UnauthorizedInvalid API key provided for the store.Check API key in Shopify Admin -> App -> Settings.
INSUFFICIENT_BUDGET402 Payment RequiredMerchant top-up budget is exhausted.Top up balance in Shopify Admin -> App -> Billing.
INVALID_SHOP401 UnauthorizedStore domain not found or uninstalled.Verify shop_name domain spelling.
INVALID_PARAMETER400 Bad RequestInvalid JSON payload or negative quantity.Ensure valid JSON request body.