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.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjU0OWVlY2ZjLTBkNDItNDM3Mi1iZjIxLWU1YmEzNzg5YTUwMyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc0NzAxODYyfQ.44KXETRVeBoqXrhWqHlILPqKsplefc2L5Pq6KCPbOZs",
  "refresh_token": "a4CSEMEK99SqC2oZE68EJZit",
  "user": {
    "id": "cus_UkLWZg9DAJ",
    "email": "customer@example.com",
    "first_name": "Sonya",
    "last_name": "Mraz",
    "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