Skip to main content
PATCH
/
api
/
v3
/
store
/
password_resets
/
{token}
Spree SDK
import { createClient } from '@spree/sdk'

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

const auth = await client.passwordResets.update(
  'reset-token-from-email',
  {
    password: 'newsecurepassword',
    password_confirmation: 'newsecurepassword',
  }
)
{
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6Ijg2YjI5NGYxLTU4OTItNGY2YS1hOWEzLTY0ZjUwM2I0ODMxMyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc2MTYxODM2fQ.k2zGOAOvYuPsD5raanWMRO6in3ogqqdMWbPMfSJgQc4",
  "refresh_token": "qjyCdgmLNW4p3XnUDXGgfVyT",
  "user": {
    "id": "cus_UkLWZg9DAJ",
    "email": "customer@example.com",
    "first_name": "Chelsea",
    "last_name": "Bayer",
    "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

Path Parameters

token
string
required

Password reset token from the email

Body

application/json
password
string
required
Minimum string length: 6
Example:

"newsecurepassword"

password_confirmation
string
required
Example:

"newsecurepassword"

Response

password reset successful

token
string
required

JWT access token

refresh_token
string
required

Refresh token for obtaining new access tokens

user
object
required