Partners

Connect with Yudoo

For platforms and developers who want merchants to connect their Yudoo store with one click, without copying keys. It works like "Sign in with…": you open a Yudoo pop-up, the merchant approves, and you get an API key for the store they picked.

  1. Register your app in Yudoo › Settings › API keys › Your partner apps: a name and your exact redirect URIs (https). You get a client_id (yc_…) and a client_secret (ycs_…, shown once).

  2. Open the connect page in a pop-up (or a full page) with your client_id, one registered redirect_uri, the scopes you need and a random state.

  3. The merchant signs in to Yudoo, picks a store, sees your app's name and what it asks for, and presses Approve.

  4. Yudoo sends the browser back to redirect_uri?code=…&state=…. Check that state is the one you sent. If the merchant cancels you get ?error=access_denied&state=….

  5. Within 10 minutes, from your server, trade the code for the store's API key at POST /connect/token. A code works once.

http
GET https://app.yudoo.io/connect/authorize
  ?response_type=code
  &client_id=yc_your_client_id
  &redirect_uri=https%3A%2F%2Fpartner.example.com%2Fyudoo%2Fcallback
  &scope=store%3Aread%20orders%3Aread
  &state=8f3c1e9a2b
const state = crypto.randomUUID();
sessionStorage.setItem("yudoo_state", state);
const url = new URL("https://app.yudoo.io/connect/authorize");
url.search = new URLSearchParams({
  response_type: "code",
  client_id: "yc_your_client_id",
  redirect_uri: "https://partner.example.com/yudoo/callback",
  scope: "store:read orders:read",
  state,
}).toString();
window.open(url, "yudoo-connect", "width=480,height=720");

// On /yudoo/callback: check state, send the code to your server,
// then window.opener.postMessage({ connected: true }, location.origin) and window.close().

POST/api/v1/connect/token

curl -X POST https://app.yudoo.io/api/v1/connect/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "authorization_code",
    "client_id": "yc_your_client_id",
    "client_secret": "'"$YUDOO_CLIENT_SECRET"'",
    "code": "the_code_from_the_redirect",
    "redirect_uri": "https://partner.example.com/yudoo/callback"
  }'

The answer:

json
{
  "api_key": "wp_live_…",
  "token_type": "Bearer",
  "scopes": ["store:read", "orders:read"],
  "store": { "id": "cm…", "name": "Nile Store", "url": "https://nilestore.example" }
}
ErrorWhen
invalid_client (401)The client_id or client_secret is wrong.
invalid_grant (400)The code is wrong, older than 10 minutes, already used, or redirect_uri differs from the one used to open the page.
unsupported_grant_type (400)grant_type is not authorization_code.
error=invalid_scope (redirect)scope has a word that is not store:read, orders:read or orders:write.
error=access_denied (redirect)The merchant pressed Cancel.

Stuck, or need a field we don't have yet? Our team answers on WhatsApp.

Ask us on WhatsAppOpen the Yudoo app