Skip to main content
POST
/
api
/
v3
/
store
/
auth
/
refresh
Spree SDK
import { createClient } from '@spree/sdk'

const client = createClient({
  baseUrl: 'https://your-store.com',
  publishableKey: '<api-key>',
})

const auth = await client.auth.refresh({
  refresh_token: 'rt_xxx',
})
{
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjRiYjIwZmViLTY1ZTAtNDJjNS1iMjFjLTQ4YzFmZGE1NjA5YiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc0NzAxODQ5fQ._gkuJGgjt3GcsGJNWPp4_uGDgrmxtKvHypsNFmFf2Lk",
  "refresh_token": "w4PMNQtBJA6VtTbuwBNn3FwB",
  "user": {
    "id": "cus_UkLWZg9DAJ",
    "email": "test@example.com",
    "first_name": "Jeanett",
    "last_name": "Collier",
    "phone": null,
    "accepts_email_marketing": false,
    "available_store_credit_total": "0",
    "display_available_store_credit_total": "$0.00",
    "addresses": [],
    "default_billing_address": null,
    "default_shipping_address": null
  }
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Headers

x-spree-api-key
string
required

Body

application/json
refresh_token
string
required

Refresh token from login response

Response

token refreshed

token
string
required

JWT access token

refresh_token
string
required

Refresh token for obtaining new access tokens

user
object
required