Connector guide — Amazon Selling Partner (SP-API) (amazon_sp)
Fixed sections (Phase D1 format; tests/governance/test_onboarding_connector_guides.py pins them). Facts marked [Validated] are measured in code or tests; [Observed] facts carry a date; [Gap] names an open item. No credential, token, account identifier or tenant value appears in this file. No connector is unconditional; consent is the one universal requirement.
What it is
Login with Amazon (LWA) credentials for the tenant's own SP-API application, consumed by Cell 37's per-tenant sales-rank sync (POST /poll/amazon_sp/{tenant} on src/cells/cell37/market_cell/main.py). SP-API is the primary Amazon surface (rule 03). Catalog category commerce, wave 2.
Status (measured)
[Validated] available: true in CONNECTOR_CATALOG (services/service-marketing-connectors/connector_credentials.py, measured 2026-10-12). Required fields lwa_client_id, lwa_client_secret, lwa_refresh_token; optional region. Test connection performs the LWA token grant (/auth/o2/token, refresh_token grant) and touches no SP-API data endpoint. [Validated] the vault payload is read by connectors/amazon_sp/client.py (it reads lwa_refresh_token from the stored payload). Collectable today (checklist P3-9, "where in scope"); not a measurement rail, so readiness never gaps on it.
Who owns the account
The tenant. The Seller Central (or Vendor Central) account and the SP-API application registered in the Solution Provider Portal stay in the tenant's name; the tenant can revoke the authorization and rotate the LWA secret at any time (law 3). No operator account is ever substituted.
Prerequisites
- The tenant is the primary user of the Seller Central account (Amazon requires the primary user for self-authorization of a Seller Central account).
- The tenant has registered a private SP-API application in the Solution Provider Portal (as a primary account user) and holds its LWA client id and client secret.
- The tenant has self-authorized that application for the account (Solution Provider Portal / Seller Central → Authorize application → Authorize app), which produces the LWA refresh token; each authorization generates a new token.
- The tenant knows which SP-API region the account trades in (
na,euorfe).
Visibility invite (click path)
None. There is no seat to request for discovery: the connection is the tenant's own self-authorized application and its LWA credentials, entered on the card. Playbook §5 lists no Amazon row.
Connecting in the onboarding UI
- Open
/onboarding→ Connectors → the Amazon SP-API card (optional; shown for a tenant that sells on Amazon). - Enter
lwa_client_idandlwa_client_secretfrom the application's LWA credentials in the Solution Provider Portal, and thelwa_refresh_tokenfrom the self-authorization step. Paste them on the card — nowhere else (law 2). - Optionally set
region(na,euorfe; the catalog placeholder isna). - Click Test connection. Move on only when it passes.
Fields
| key | where the tenant finds it | format | secret? | required? |
|---|---|---|---|---|
lwa_client_id |
Solution Provider Portal → the app → LWA credentials | catalog placeholder amzn1.application-oa2-client.… |
no | yes |
lwa_client_secret |
same place | opaque; never echoed, masked hint only | yes | yes |
lwa_refresh_token |
Authorize application → Authorize app (self-authorization) | catalog placeholder Atzr|…; never echoed |
yes | yes |
region |
the marketplace region the account trades in | na, eu or fe (catalog placeholder na) |
no | no |
Test connection
| Failure | Plain-English fix |
|---|---|
422 missing_required_fields |
All three LWA values are required; re-save the card with them. |
422 unknown_fields |
Only the four catalog fields are accepted; remove anything else. |
| " |
The client id/secret pair and the refresh token do not belong to the same application, the secret was rotated, or the authorization was revoked. Re-run self-authorization for the account and re-save all three. |
| "LWA rejected the credentials" | Same as above when Amazon gave no description. |
| "LWA answered HTTP |
The token endpoint did not answer 200; retry once. |
Poll: 422 unknown_tenant on /poll/amazon_sp/{tenant} |
The tenant is not known to Cell 37; the operator checks the tenant binding. |
Poll: 503 storage_unavailable |
Cell 37's persistence backend is unavailable; operator action, nothing to re-enter. |
404 not_configured (stored-credential test) |
Nothing is saved for this tenant yet; connect first. |
429 test_rate_limited |
More than 20 tests for this provider in 60 s from this tenant; wait the retry_after_seconds it names. |
| 503 fail-closed (vault error) | The credential vault could not be read; an operator checks vault health. Nothing for the tenant to re-enter. |
What it feeds
Cell 37 (Data Injector & External Intelligence Gateway, built as MarketSignal ingest) per-tenant sales-rank sync via POST /poll/amazon_sp/{tenant}, through the ordinary MarketSignal gate (connectors/amazon_sp/client.py resolves the LWA triple per tenant). Market signals are external assertions: imported/inferred, never observed, never causal (rule 03). Saving the credentials arms nothing (law 8); the poll runs only when dispatched.
Consent posture
Sales-rank and catalogue signals are product-level, not person-level. Should any person-level record ever enter through this path it passes the consent gate before persistence (fail-closed, per-subject basis required). The tenant's consent declaration (P2-5) is required of every tenant and never substitutes for a per-subject basis. Consent is the one universal requirement; no connector is unconditional.
Revoke / offboard
Tenant side: Seller Central → Apps and Services → Manage your apps → remove the authorization (invalidates the refresh token); Solution Provider Portal → rotate the LWA client secret. Platform side: the operator removes the tenant's amazon_sp vault entry through the governed path, or offboards the whole tenant with POST /api/v1/tenant/offboard/credentials.
Known gaps
- OB-GAP-6 — one vault entry per provider per tenant; a second marketplace account is recorded as a named gap.
- OB-GAP-9 — card affordances still open (required/optional marks).
- [Gap] Amazon Ads (
amazon_ads) is a different provider, wave 3 andavailable: false; it is "not yet available" and no values are collected for it. Co-purchase harvesting is permanently out (BUILD_DEBT AMZ-CP-1).
Last verified
Catalog and readiness code measured 2026-10-12 on main 47309238. Vendor documentation: Amazon SP-API — "Register your Application" (developer-docs.amazon.com/sp-api/docs/registering-your-application) and "Authorize Private Applications" (developer-docs.amazon.com/sp-api/docs/self-authorization) — both fetched 2026-10-12 by following the server's redirect from the .com URLs as recorded. Lane records: docs/tenants/TENANT_ONBOARDING_CHECKLIST.md P3-9; src/cells/cell37/market_cell/main.py (/poll/amazon_sp/{tenant}).