API ReferenceEndpointsCustomersGet o auth authorize url

Get o auth authorize url

Starts a social login. With an Origin header (a fetch call) it returns the provider consent URL and the CSRF state as JSON; without one it redirects the browser (302) to the provider. Open the URL, then the provider returns the shopper to the channel callback.

GET
/vc/{connectionId}/oauth/{provider}/authorize
X-Sales-Channel-Origin<token>

For /api/vc/{connectionId}/* routes the connectionId (vc_*) is in the URL path — not a header. Live-mode requests must also send a matching Origin header.

In: header

Path Parameters

connectionIdstring

Sales channel ID (vc_*), the canonical salesChannelId. connectionId is the deprecated name of the same value and is still the literal path segment.

providerstring

OAuth provider, case-insensitive. Only GOOGLE is implemented: FACEBOOK and GITHUB answer 400 (code: provider_unsupported).

Query Parameters

redirectUrl?string

Where the shopper lands after login, an absolute URL on an allowed origin of the channel or a relative path. Default /. A URL on another origin is refused.

referralCode?string

Loyalty referral share code (REF-XXXXXXXX) the visitor arrived with. Stored with the OAuth state and applied only if the callback creates the account (or gives a guest its first login), with the same fraud checks, welcome coupon and referrer reward as registration's referralCode. Ignored for existing customers; an invalid code never fails the sign-in.

Header Parameters

origin?string

Origin of the storefront page making the call. Optional on this route (a direct browser navigation sends none), but a LIVE channel still refuses a request with no Origin and checks its host against the channel's registered domain; a TEST channel with no domain accepts any origin.

X-SDK-Version?string

Version of the calling SDK (the Brainerce SDK sends it automatically). Informational: it is recorded on the channel and never changes the response.

curl -X GET "https://api.brainerce.com/api/vc/string/oauth/string/authorize?redirectUrl=https%3A%2F%2Fshop.example.com%2Faccount&referralCode=string" \  -H "origin: string" \  -H "X-SDK-Version: string"
{
  "authorizationUrl": "https://shop.example.com/page",
  "state": "string",
  "provider": "GOOGLE"
}

{
  "statusCode": 400,
  "code": "VALIDATION_FAILED",
  "message": "name should not be empty, price must be a positive number",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/oauth/{provider}/authorize"
}

{
  "statusCode": 403,
  "code": "INSUFFICIENT_SCOPE",
  "message": "API key does not have the required scope: products:write",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/oauth/{provider}/authorize"
}

{
  "statusCode": 404,
  "code": "RESOURCE_NOT_FOUND",
  "message": "Resource not found",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/oauth/{provider}/authorize"
}

{
  "statusCode": 429,
  "code": "RATE_LIMITED",
  "message": "Too many requests",
  "details": {
    "retryAfterSeconds": 12
  },
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/oauth/{provider}/authorize"
}