Shopify API
The Shopify API (https://sprout-app.thegoodapi.com/app/api) lets Shopify merchants and integration partners build custom Customer Account Extensions, storefront impact portals, and loyalty integrations (such as Avada Joy, Yotpo, LoyaltyLion, and Klaviyo) to query customer/store impact, plant trees, recover ocean plastic, trigger charity donations, process reversals, and fetch verification evidence.
Authentication & Headers
Section titled “Authentication & Headers”All requests must be made over HTTPS with your credentials passed in HTTP request headers.
| Header Name | Type | Required | Description |
|---|---|---|---|
api_key (or X-API-Key) | string | Yes | Store-scoped Shopify API Key (PROD-... or TEST-...). |
shop_name | string | Yes | Your Shopify store domain (e.g., my-store.myshopify.com). |
Content-Type | string | Yes (POST) | application/json (required for POST request bodies). |
Idempotency-Key | string | Optional | Unique token to safely retry POST operations without duplicate executions. |
Multi-Store Setup
Section titled “Multi-Store Setup”API keys are strictly scoped per Shopify store:
- In Shopify Admin for each store, open Sprout / GoodAPI → Advanced Settings → API Settings and generate that store’s
PROD-andTEST-keys. - In your server-to-server backend, maintain a
shop_domain → api_keymapping and send matchingshop_name+api_keyheaders on each request. - All stores expose identical endpoints, schemas, and rate limits.
Rate Limits & Recommended Caching
Section titled “Rate Limits & Recommended Caching”Rate limits are enforced per store using a 60-second fixed window:
| Bucket | Default Limit | Headers Included on Every Response |
|---|---|---|
GET (Read endpoints) | 300 requests / minute per store | X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset |
POST (Write endpoints) | 60 requests / minute per store | X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset |
When exceeded, the API returns HTTP 429 Too Many Requests (RATE_LIMIT_EXCEEDED) with a Retry-After header indicating how many seconds to wait before retrying.
Recommended backend caching TTLs:
- Customer Impact Profile (
GET /app/api/customers/impact): Cache for 1–5 minutes keyed by(shop_name, customer_id/email, cursor)(responses includeCache-Control: private, max-age=60). - Store Impact Projects (
GET /app/api/projects): Cache for 24 hours keyed by(shop_name, locale)(responses includeCache-Control: private, max-age=3600). Setinclude_projects=falseon/app/api/customers/impactwhen caching projects separately.
Customer & Order Filtering Rules
Section titled “Customer & Order Filtering Rules”Across query endpoints (/app/api/customers/impact, /app/api/plant, /app/api/plastic, /app/api/charity/donations, /app/api/impact/stats):
- Customer ID (
customer_id): Accepts either a numeric Shopify ID (123456789) or Shopify GID (gid://shopify/Customer/123456789) and performs an exact ID match. - Email (
email/customer_email): Performs an exact, case-insensitive match. Providing bothcustomer_idandemailreturns records matching either exact identifier. - Order ID (
order_id): Matches with or without#prefix (1001matches#1001and vice versa).
Verify Connection
Section titled “Verify Connection”GET https://sprout-app.thegoodapi.com/app/api/verify
Verifies your store API key and returns key mode (PROD vs TEST), store domain, status, and enabled impact features.
Response — 200 OK
Section titled “Response — 200 OK”{ "status": "active", "shop_domain": "my-store.myshopify.com", "key_mode": "PROD", "features": { "tree_planting": true, "plastic_removal": true, "donations": true }}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"const response = await fetch("https://sprout-app.thegoodapi.com/app/api/verify", { method: "GET", headers: { "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }});const data = await response.json();Get Customer Impact Profile
Section titled “Get Customer Impact Profile”GET https://sprout-app.thegoodapi.com/app/api/customers/impact
Unified server-to-server endpoint designed for custom Shopify Customer Account Extensions and portals. Returns a customer’s lifetime impact totals, store-wide totals, cursor-paginated per-order impact breakdown (newest first), and active project metadata/media/UN SDGs in a single call.
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string / integer | Conditional* | Shopify customer numeric ID or gid://shopify/Customer/<id>. Exact match. |
email / customer_email | string | Conditional* | Exact case-insensitive customer email. *At least one of customer_id or email is required. |
include_orders | boolean | Optional | Include paginated per-order impact breakdown (orders). Default: true. |
include_projects | boolean | Optional | Include store active projects, web-safe images, and UN SDGs (projects). Default: true. |
include_store_totals | boolean | Optional | Include store-wide totals (store_totals). Default: true. |
limit | integer | Optional | Orders per page (default: 25, max: 100). |
cursor | string | Optional | Opaque cursor from previous response’s orders.next_cursor. |
locale | string | Optional | Project copy language (en, de, es, fr). Default: en. |
CO2 Metrics Included:
co2_kg_annual: Estimated annual sequestration (trees * 12.3kg/yr).co2_tonnes_lifetime: Estimated lifetime sequestration matching GoodAPI Impact Hub (round(0.31 * 0.80 * trees, 2)tonnes).
Response — 200 OK
Section titled “Response — 200 OK”{ "shop_domain": "my-store.myshopify.com", "key_mode": "PROD", "customer": { "customer_id": 123456789 }, "features": { "tree_planting": true, "plastic_removal": false, "donations": false }, "totals": { "trees": 12, "plastic_bottles": 0, "plastic_kg": 0, "donations_usd": 0, "co2_kg_annual": 147.6, "co2_tonnes_lifetime": 2.98 }, "store_totals": { "trees": 25000, "plastic_bottles": 0, "plastic_kg": 0, "co2_kg_annual": 307500, "co2_tonnes_lifetime": 6200 }, "orders": { "items": [ { "order_name": "#1042", "created_at": "2026-11-25T14:22:00Z", "trees": 2, "plastic_bottles": 0, "donations_usd": 0 } ], "count": 1, "has_more": true, "next_cursor": "eyJ0IjoiMjAyNi0xMS0yNVQxNDoyMjowMFoiLCJpZCI6IjY5Y2EwMjE5MDA0OTcyMDRjMWM1NTA1ZCJ9" }, "projects": [ { "id": "veritree-kenya", "type": "tree_planting", "provider": "veritree", "title": "Kilifi, Kenya", "region": "Kenya", "description": "With your support, we are restoring the mangrove forests in Kenya...", "verified_by": "Planting verified by Veritree", "gps_coordinates": "-2.51650, 40.48399", "hero_image_url": "https://sprout-app.thegoodapi.com/treeshop-app-assets/kenya-mangroves-1.jpg?fm=webp&auto=format&w=900", "images": [ "https://storage.googleapis.com/treeshop-app-assets/customer-account-extension-assets/trees/Kenya/Kilifi%20Nursery.jpeg" ], "un_sdgs": [ { "goal": 13, "logo_url": "https://storage.googleapis.com/treeshop-app-assets/customer-account-extension-assets/UN%20SDG/E-WEB-Goal-13.svg", "learn_more_url": "https://storage.googleapis.com/treeshop-app-assets/customer-account-extension-assets/UN%20SDG/SDG_report_2023_infographics_Goal%2013.jpg" } ] } ]}curl -X GET "https://sprout-app.thegoodapi.com/app/api/customers/impact?customer_id=gid://shopify/Customer/123456789&limit=25" \ -H "api_key: PROD-8f92a1b3-4c56-7d89" \ -H "shop_name: my-store.myshopify.com"const params = new URLSearchParams({ customer_id: "gid://shopify/Customer/123456789", limit: "25"});
const response = await fetch( `https://sprout-app.thegoodapi.com/app/api/customers/impact?${params.toString()}`, { method: "GET", headers: { "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" } });const data = await response.json();Get Store Impact Projects
Section titled “Get Store Impact Projects”GET https://sprout-app.thegoodapi.com/app/api/projects
Returns active tree-planting and ocean plastic removal projects for the store, including localized descriptions, GPS coordinates, UN SDGs, and web-ready images.
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
locale | string | Optional | Project copy language (en, de, es, fr). Default: en. |
Response — 200 OK
Section titled “Response — 200 OK”{ "shop_domain": "my-store.myshopify.com", "key_mode": "PROD", "locale": "en", "projects": [ { "id": "veritree-kenya", "type": "tree_planting", "provider": "veritree", "title": "Kilifi, Kenya", "region": "Kenya", "description": "With your support, we are restoring the mangrove forests in Kenya...", "verified_by": "Planting verified by Veritree", "gps_coordinates": "-2.51650, 40.48399", "hero_image_url": "https://sprout-app.thegoodapi.com/treeshop-app-assets/kenya-mangroves-1.jpg?fm=webp&auto=format&w=900", "images": [ "https://storage.googleapis.com/treeshop-app-assets/customer-account-extension-assets/trees/Kenya/Kilifi%20Nursery.jpeg" ], "un_sdgs": [ { "goal": 13, "logo_url": "https://storage.googleapis.com/treeshop-app-assets/customer-account-extension-assets/UN%20SDG/E-WEB-Goal-13.svg", "learn_more_url": "https://storage.googleapis.com/treeshop-app-assets/customer-account-extension-assets/UN%20SDG/SDG_report_2023_infographics_Goal%2013.jpg" } ] } ]}curl -X GET "https://sprout-app.thegoodapi.com/app/api/projects?locale=en" \ -H "api_key: PROD-8f92a1b3-4c56-7d89" \ -H "shop_name: my-store.myshopify.com"const response = await fetch("https://sprout-app.thegoodapi.com/app/api/projects?locale=en", { method: "GET", headers: { "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }});const data = await response.json();Plant Trees
Section titled “Plant Trees”POST https://sprout-app.thegoodapi.com/app/api/plant
Trigger tree planting for a customer order or loyalty reward redemption.
Request Body
Section titled “Request Body”| Parameter | Type | Required | Description |
|---|---|---|---|
trees | integer | Yes | Number of trees to plant. |
customer_id | string / integer | Optional | Shopify Customer ID (numeric or gid://shopify/Customer/<id>). |
customer_email | string | Optional | Customer email address (used for attribution and Klaviyo triggers). |
customer_name | string | Optional | Customer full name. |
order_id | string | Optional | Shopify Order ID or order reference. |
notes | string | Optional | Integration notes or redemption details. |
Response — 200 OK
Section titled “Response — 200 OK”{ "status": "success", "mode": "PROD", "source": "api", "id": "tree_1732700000000000000", "tree_id": "tree_1732700000000000000", "trees_planted": 5, "project_id": "veritree-kenya", "customer_id": 12345678, "customer_email": "jane@example.com", "customer_name": "Jane Doe", "order_id": "1001", "created_at": "2026-11-27T06:11:39Z"}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" \ -H "Idempotency-Key: plant-1001" \ -d '{ "trees": 5, "customer_id": 12345678, "customer_email": "jane@example.com", "customer_name": "Jane Doe", "order_id": "1001", "notes": "Loyalty Points Redemption" }'const response = await fetch("https://sprout-app.thegoodapi.com/app/api/plant", { method: "POST", headers: { "Content-Type": "application/json", "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com", "Idempotency-Key": "plant-1001" }, body: JSON.stringify({ trees: 5, customer_id: 12345678, customer_email: "jane@example.com", customer_name: "Jane Doe", order_id: "1001" })});const data = await response.json();Get Planted Trees History
Section titled “Get Planted Trees History”GET https://sprout-app.thegoodapi.com/app/api/plant
Query planted tree records with date range filtering and cursor pagination (sorted newest first).
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string / integer | Optional | Filter by exact Shopify Customer ID (numeric or gid://shopify/Customer/<id>). |
email / customer_email | string | Optional | Filter by exact case-insensitive customer email. |
order_id | string | Optional | Filter by order name (supports # prefix matching, e.g. 1001 matches #1001). |
start_date | string | Optional | Filter records created on or after date (YYYY-MM-DD or RFC3339). |
end_date | string | Optional | Filter records created on or before date (YYYY-MM-DD or RFC3339). |
limit | integer | Optional | Max items to return (default: 50, max: 100). |
after | string | Optional | Cursor timestamp from next_cursor for fetching the next page. |
Response — 200 OK
Section titled “Response — 200 OK”{ "trees": [ { "id": "69ca021900497204c1c5505d", "shop_name": "my-store.myshopify.com", "order_name": "#1001", "count": 5, "created_at": "2026-11-27T06:11:39.815Z", "customer_id": 12345678, "email": "jane@example.com", "customer_name": "Jane Doe" } ], "count": 1, "has_more": false, "next_cursor": ""}curl -X GET "https://sprout-app.thegoodapi.com/app/api/plant?customer_id=gid://shopify/Customer/12345678&limit=20" \ -H "api_key: PROD-8f92a1b3-4c56-7d89" \ -H "shop_name: my-store.myshopify.com"const response = await fetch("https://sprout-app.thegoodapi.com/app/api/plant?email=jane@example.com&limit=20", { method: "GET", headers: { "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }});const data = await response.json();Recover Ocean Plastic
Section titled “Recover Ocean Plastic”POST https://sprout-app.thegoodapi.com/app/api/plastic
Trigger ocean plastic bottle recovery for a customer order or reward redemption.
Request Body
Section titled “Request Body”| Parameter | Type | Required | Description |
|---|---|---|---|
bottles | integer | Yes | Number of plastic bottles to recover. |
customer_id | string / integer | Optional | Shopify Customer ID (numeric or gid://shopify/Customer/<id>). |
customer_email | string | Optional | Customer email address. |
customer_name | string | Optional | Customer full name for attribution. |
order_id | string | Optional | Shopify Order ID. |
notes | string | Optional | Integration notes. |
Response — 200 OK
Section titled “Response — 200 OK”{ "status": "success", "mode": "PROD", "id": "plastic_1732700000000000000", "plastic_id": "plastic_1732700000000000000", "bottles_rescued": 50, "order_id": "1001", "customer_id": 12345678, "customer_email": "jane@example.com", "customer_name": "Jane Doe", "created_at": "2026-11-27T06:11:39Z"}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_id": 12345678, "customer_email": "jane@example.com", "customer_name": "Jane Doe", "order_id": "1001" }'const response = await fetch("https://sprout-app.thegoodapi.com/app/api/plastic", { method: "POST", headers: { "Content-Type": "application/json", "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }, body: JSON.stringify({ bottles: 50, customer_id: 12345678, customer_email: "jane@example.com", customer_name: "Jane Doe", order_id: "1001" })});const data = await response.json();Get Plastic Recovery History
Section titled “Get Plastic Recovery History”GET https://sprout-app.thegoodapi.com/app/api/plastic
Query ocean plastic recovery records with date range filtering and cursor pagination (sorted newest first).
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string / integer | Optional | Filter by exact Shopify Customer ID (numeric or gid://shopify/Customer/<id>). |
email / customer_email | string | Optional | Filter by exact case-insensitive customer email. |
order_id | string | Optional | Filter by order name (supports # prefix matching). |
start_date | string | Optional | Filter records created on or after date (YYYY-MM-DD or RFC3339). |
end_date | string | Optional | Filter records created on or before date (YYYY-MM-DD or RFC3339). |
limit | integer | Optional | Max items to return (default: 50, max: 100). |
after | string | Optional | Cursor timestamp from next_cursor for fetching the next page. |
Response — 200 OK
Section titled “Response — 200 OK”{ "plastics": [ { "id": "69ca021900497204c1c5505e", "shop_name": "my-store.myshopify.com", "order_name": "#1001", "count": 50, "created_at": "2026-11-27T06:11:39.815Z", "customer_id": 12345678, "email": "jane@example.com", "customer_name": "Jane Doe" } ], "count": 1, "has_more": false, "next_cursor": ""}Charitable Donations
Section titled “Charitable Donations”Search Store Charities
Section titled “Search Store Charities”GET https://sprout-app.thegoodapi.com/app/api/charities
Search available non-profit charity partners configured for your store (supports ?query= or ?q=).
Trigger Charity Donation
Section titled “Trigger Charity Donation”POST https://sprout-app.thegoodapi.com/app/api/charity/donate
Trigger a charitable donation allocation for a customer purchase or loyalty redemption.
Request Body
Section titled “Request Body”| Parameter | Type | Required | Description |
|---|---|---|---|
charity_id | string | Yes | Non-profit charity partner ID (or configured charity name). |
merchant_amount | number | Conditional* | Merchant-funded donation amount in USD (also accepts amount_dollars). |
customer_amount | number | Conditional* | Customer-funded donation amount in USD (requires customer_id or customer_email). *At least one of merchant_amount or customer_amount must be > 0. |
customer_id | string / integer | Optional | Shopify Customer ID (numeric or gid://shopify/Customer/<id>). |
customer_email | string | Optional | Customer email address. |
customer_name | string | Optional | Customer full name. |
order_id | string | Optional | Shopify Order ID. |
Response — 200 OK
Section titled “Response — 200 OK”{ "status": "success", "mode": "PROD", "id": "donation_1732700000000000000", "donation_id": "donation_1732700000000000000", "charity_id": "charity_trees_for_future", "charity_name": "Trees for the Future", "amount": 5.0, "order_id": "1001", "customer_id": 12345678, "customer_email": "jane@example.com", "created_at": "2026-11-27T06:11:39Z"}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", "merchant_amount": 5.00, "customer_id": 12345678, "customer_email": "jane@example.com", "customer_name": "Jane Doe" }'const response = await fetch("https://sprout-app.thegoodapi.com/app/api/charity/donate", { method: "POST", headers: { "Content-Type": "application/json", "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }, body: JSON.stringify({ charity_id: "charity_trees_for_future", merchant_amount: 5.00, customer_id: 12345678, customer_email: "jane@example.com", customer_name: "Jane Doe" })});const data = await response.json();Query Donations
Section titled “Query Donations”GET https://sprout-app.thegoodapi.com/app/api/charity/donations
Query charitable donation records by customer_id, email/customer_email, charity_id, order_id, start_date, end_date, limit (default 50), and after.
Get Impact Statistics
Section titled “Get Impact Statistics”GET https://sprout-app.thegoodapi.com/app/api/impact/stats
Retrieve store-wide lifetime totals (when no customer filter is provided) or customer-scoped impact totals (trees, plastic_bottles, donations, co2_kg, customer_scoped). For combined store totals + customer totals + per-order history + project metadata, use GET /app/api/customers/impact.
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string / integer | Optional | Filter by exact Shopify Customer ID (numeric or gid://shopify/Customer/<id>). |
email / customer_email | string | Optional | Filter by exact case-insensitive customer email. |
Response — 200 OK
Section titled “Response — 200 OK”{ "trees": 15, "plastic_bottles": 100, "donations": 10.0, "co2_kg": 184.5, "customer_scoped": true}curl -X GET "https://sprout-app.thegoodapi.com/app/api/impact/stats?customer_id=gid://shopify/Customer/12345678" \ -H "api_key: PROD-8f92a1b3-4c56-7d89" \ -H "shop_name: my-store.myshopify.com"const response = await fetch("https://sprout-app.thegoodapi.com/app/api/impact/stats?email=jane@example.com", { method: "GET", headers: { "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }});const data = await response.json();Process Impact Refunds & Reversals
Section titled “Process Impact Refunds & Reversals”POST https://sprout-app.thegoodapi.com/app/api/refund (or /app/api/donation/cancel for donations)
Reverses tree, plastic, or donation allocations when an order or loyalty redemption is cancelled. Donation cancellations mark the donation order CANCELLED and automatically reverse open-period Stripe metered billing usage.
Request Body
Section titled “Request Body”| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Unit type to reverse (tree, plastic, or donation). Defaults to donation on /app/api/donation/cancel. |
donation_id / id / uuid / order_id | string | Optional | Record UUID, donation ID, or order ID to reverse. |
count | integer | Optional | Number of units to reverse (default: 1). |
notes | string | Optional | Reason for reversal. |
Response — 200 OK
Section titled “Response — 200 OK”{ "status": "success", "mode": "PROD", "id": "refund_1732700000000000000", "refund_id": "refund_1732700000000000000", "refunded_type": "tree", "count": 5, "uuid": "1001", "stripe_reversed": false, "created_at": "2026-11-27T06:11:39Z"}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", "order_id": "1001", "count": 5, "notes": "Customer cancelled loyalty reward" }'const response = await fetch("https://sprout-app.thegoodapi.com/app/api/refund", { method: "POST", headers: { "Content-Type": "application/json", "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }, body: JSON.stringify({ type: "tree", order_id: "1001", count: 5, notes: "Customer cancelled loyalty reward" })});const data = await response.json();Fetch Verification Evidence
Section titled “Fetch Verification Evidence”GET https://sprout-app.thegoodapi.com/app/api/evidence
Retrieves planting evidence photos/videos, region metadata, and timeline events matching target impact dates or record IDs.
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
tree_id | string | Optional | Tree record ID (tree_id, id, or tree). |
impact_type | string | Optional | Impact type (trees, default: trees). |
created_at | string | Optional | Target impact date timestamp (YYYY-MM-DD or ISO timestamp). |
project_public_id | string | Optional | Filter by project public ID. |
region | string | Optional | Filter by region name. |
Response — 200 OK
Section titled “Response — 200 OK”{ "tree_id": "test_tree_1001", "record_id": "test_tree_1001", "impact_type": "trees", "impact_provider": "veritree", "created_at": "2024-05-15T10:00:00Z", "region": "Kenya", "evidence_count": 5, "timeline": [ { "step": 1, "event": "registered", "status": "completed", "date": "2024-05-15T10:00:00Z", "timestamp": "2024-05-15T10:00:00Z" }, { "step": 2, "event": "planted", "status": "completed", "date": "2024-05-15T14:30:00Z", "timestamp": "2024-05-15T14:30:00Z" } ]}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"const response = await fetch("https://sprout-app.thegoodapi.com/app/api/evidence?impact_type=trees&created_at=2024-05-15T10:00:00Z", { method: "GET", headers: { "api_key": "PROD-8f92a1b3-4c56-7d89", "shop_name": "my-store.myshopify.com" }});const data = await response.json();Error Codes
Section titled “Error Codes”| Error Code | HTTP Status | Description | Action / Resolution |
|---|---|---|---|
UNAUTHORIZED | 401 Unauthorized | Missing authentication headers. | Pass valid api_key (or X-API-Key) and shop_name headers. |
WRONG_KEY_TYPE | 401 Unauthorized | Standalone or platform key used on a Shopify API endpoint. | Use a store PROD- or TEST- API key. |
INVALID_KEY | 401 Unauthorized | Invalid API key or store domain. | Verify shop_name and your API key in Shopify Admin → Advanced Settings → API Settings. |
INSUFFICIENT_BUDGET | 402 Payment Required | Store top-up budget or tree/plastic limit is exhausted. | Top up balance in Shopify Admin → Sprout / GoodAPI → Billing. |
BAD_REQUEST | 400 Bad Request | Malformed JSON payload or invalid request body. | Validate JSON syntax and content type. |
INVALID_PARAM / INVALID_PARAMETER | 400 Bad Request | Missing or invalid query/body parameter (e.g., malformed GID, invalid limit or cursor). | Fix the parameter value indicated in message. |
PAYLOAD_TOO_LARGE | 413 Payload Too Large | JSON request body exceeds the 256 KB maximum limit. | Keep request payloads under 256 KB. |
RATE_LIMIT_EXCEEDED | 429 Too Many Requests | Request rate limit exceeded. | Back off for the seconds specified in Retry-After and enable caching. |
QUERY_ERROR | 500 Internal Server Error | Transient server error while loading data. | Retry with exponential backoff. |