Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(quickbooks): hit sandbox host for Dev-tab Intuit tokens

Louis Beaumont47cee13b77c5
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs b/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs
index 816d75734..c2b3241df 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs
@@ -210,13 +210,16 @@ pub async fn oauth_connect(
}
// QuickBooks: fetch the company name to use as the workspace display name.
+ // Uses the sandbox host because our current Intuit OAuth app is registered on
+ // the Development tab — Dev tokens only authenticate against the sandbox.
+ // Swap to `quickbooks.api.intuit.com` when promoting a Production app.
if integration_id == "quickbooks" {
if let (Some(realm_id), Some(access_token)) = (
token_data["realmId"].as_str().map(String::from),
token_data["access_token"].as_str().map(String::from),
) {
let url = format!(
- "https://quickbooks.api.intuit.com/v3/company/{}/companyinfo/{}",
+ "https://sandbox-quickbooks.api.intuit.com/v3/company/{}/companyinfo/{}",
realm_id, realm_id
);
if let Ok(resp) = client
diff --git a/crates/screenpipe-connect/src/connections/quickbooks.rs b/crates/screenpipe-connect/src/connections/quickbooks.rs
index 8f4b16aa5..fd1f6e83b 100644
--- a/crates/screenpipe-connect/src/connections/quickbooks.rs
+++ b/crates/screenpipe-connect/src/connections/quickbooks.rs
@@ -47,8 +47,13 @@ impl Integration for QuickBooks {
fn proxy_config(&self) -> Option<&'static ProxyConfig> {
// {realmId} is resolved from the OAuth token JSON, which is merged into credentials
// by the proxy handler in screenpipe-engine/src/connections_api.rs.
+ //
+ // NOTE: hosted on `sandbox-quickbooks.api.intuit.com` because our current
+ // Intuit OAuth client is registered on the **Development** tab — Dev tokens
+ // only authenticate against the sandbox environment. When we promote a
+ // Production Intuit app, swap to `quickbooks.api.intuit.com`.
static CFG: ProxyConfig = ProxyConfig {
- base_url: "https://quickbooks.api.intuit.com/v3/company/{realmId}",
+ base_url: "https://sandbox-quickbooks.api.intuit.com/v3/company/{realmId}",
auth: ProxyAuth::Bearer {
credential_key: "api_key",
},
@@ -77,8 +82,9 @@ impl Integration for QuickBooks {
.as_str()
.ok_or_else(|| anyhow!("realmId missing — please reconnect QuickBooks Online"))?;
+ // Sandbox host — Dev tokens only work here. See proxy_config() comment.
let url = format!(
- "https://quickbooks.api.intuit.com/v3/company/{}/companyinfo/{}",
+ "https://sandbox-quickbooks.api.intuit.com/v3/company/{}/companyinfo/{}",
realm_id, realm_id
);