---
title: "Social login"
method: POST
path: "/customers/social-login"
tags: ["Customer"]
---

# Social login

`POST /customers/social-login`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/customers/social-login`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/customers/social-login/post.ts> (a function with typed inputs; its response is checked against the schema)

Verify a provider token the app/web already obtained (Google Identity Services or a native SDK — no redirect), then sign the customer in, creating and linking the account on first sight. Returns a Bearer `token` for subsequent calls. Providers: `google`, `facebook`, `linkedin`.

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Request body

- object
  - `provider` 'google' | 'facebook' | 'linkedin', required
  - `idToken` string: Google ID token (google only).
  - `accessToken` string: OAuth access token (facebook / linkedin, or google).
  - `deviceToken` string: Optional FCM token to register push in the same call.

## Response `201`

Signed in. Store `token` as the Bearer token. `isNewCustomer` marks a first-time sign-up.

## Other responses

- `400`: Invalid input
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
