Resets the password using a token received via email. Returns a JWT token on success (auto-login).
JavaScript
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.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6Ijc1NzFmZjJiLWYxMTktNGY0Yi1iNmQ1LWU3ZTg0ZWExNjgxYiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc1NjQ1OTA1fQ.ryKBh-143o4wolj2fISVWwIg5J44wx89tg2EdY53w7U", "refresh_token": "DmgXjxQuaj9UgHaCzYCEa6ac", "user": { "id": "cus_UkLWZg9DAJ", "email": "customer@example.com", "first_name": "Amina", "last_name": "Fritsch", "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 } }
Publishable API key for store access
Password reset token from the email
6
"newsecurepassword"
password reset successful
JWT access token
Refresh token for obtaining new access tokens
Show child attributes
Was this page helpful?