Complete PayPal Authorization (OAuth Callback)
GET/api/paypal/oauth/callback
Called by the merchant's browser, not by an integrator. This is the return URL PayPal redirects the merchant to after they finish the Connect with PayPal sign-up started by Start PayPal Authorization. It needs no bearer token; it is authenticated by the single-use state SKU.io issued, and the merchant id is confirmed with PayPal before anything is saved.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Query parameters sent by PayPal
state(required) — the value SKU.io put on the return URL. Its prefix names the tenant (so the request can land on the shared domain), its suffix is the referral's tracking id. Expired, unknown or already-used states fail.merchantIdInPayPal— the merchant's PayPal account id. SKU.io looks up which merchant finished this referral (by tracking id) and refuses the connection if PayPal reports a different merchant or can't confirm it.permissionsGranted—truewhen the merchant granted SKU.io the requested permissions.merchantId,accountStatus,consentStatus,isEmailConfirmed,productIntentId— also sent by PayPal; accepted but informational (status is re-read from PayPal).
Response: always a 302 redirect to the tenant's own workspace at /v2/integrations/paypal/callback, which notifies the window that opened the popup and closes itself:
- success:
?success=1&instance_id=12 - failure:
?success=0&error_message=...(missing merchant id, invalid or expired state, merchant could not be confirmed, or the PayPal account is already connected to another integration).
A missing state returns 422.
Authentication: none (public redirect target, secured by the single-use state).
Request
Responses
- 302
- 401
- 403
- 429
Found
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.