Skip to main content

Get OAuth authentication URL for connecting a new site

POST 

/v1/authenticate-site

Generate OAuth authorization URL to connect e-commerce platforms. Supports Etsy, TikTok, and Amazon. Returns URL for user to complete platform authentication. State is signed with JWT for security and expires in 15 minutes.

Amazon has TWO separate OAuth tracks under the same platform_id=5, distinguished by presence of site_id in the body:

  • Seller (SP-API): body { platform_id: 5 } — no site_id. Connects a new Seller shop; creates a new Site record.
  • Ads: body { platform_id: 5, site_id: <seller_site_id> }site_id MUST reference an already-connected Amazon Seller site. Attaches Ads credentials to the existing Site.

Partners must connect Seller first, then call this endpoint a second time with the returned site_id to connect Ads.

Redirect behaviour (unified across Seller + Ads):

  • Both tracks support redirect_url. After consent, Dodgeprint completes the token exchange and 302-redirects the user to the partner URL with a standard query contract:
    • Seller success: <redirect_url>?platform=amazon&site_id=<new_site_id>
    • Seller failure: <redirect_url>?platform=amazon&code=<err>&message=<msg>
    • Ads success: <redirect_url>?platform=amazon&site_id=<site_id>&segment=advertising
  • Omit redirect_url to land on the default Dodgeprint FE URL and rely on polling: GET /v1/sites?platform_id=5&sort=-id&limit=1 to detect a new Seller site, or GET /v1/sites/{id}?include=isAuthorizedAds to detect Ads attachment on an existing site.

Request

Responses

Authorization URL generated successfully