Skip to content

Get the Google sign-in URL

GET
/public/stores/{storeRef}/auth/google/url
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/public/stores/example/auth/google/url?redirect_to=%2Faccount' \
--header 'x-storefront-api-key: <x-storefront-api-key>'

Returns the Google authorization URL for the shopper to open. redirect_to is a relative path on your storefront (default /) that the shopper is sent back to after signing in. When Google redirects back, a one-time code arrives in the URL; pass it to google/exchange. Returns 400 when Google sign-in is off for the store or redirect_to is not a relative path. Rate limited to 20 requests per minute per store and client IP.

storeRef
required
string

The store’s ref, as returned by GET /stores.

redirect_to
string

Example

/account

A relative path on your storefront to send the shopper back to after signing in. Defaults to /.

Media typeapplication/json
object
url
required

The Google authorization URL to send the shopper to. It carries a signed state that expires after a short time.

string

Example generated

{
"url": "example"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

Too many requests; wait a little before retrying.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}