bigcommerce/bigcommerce-api-python

Updating customer password gives random 400 errors

Opened this issue · 5 comments

Overview

I am trying to update the customer password in one of my applications. Sample code:

import bigcommerce

big_commerce_url_info = xxx
big_commerce_store_hash = xxx
big_commerce_client_id = xxx
big_commerce_auth_token = xxx
customer_id = xxx
password = xxx

try:
    api = bigcommerce.api.BigcommerceApi(client_id=big_commerce_client_id, store_hash=big_commerce_store_hash, access_token=big_commerce_auth_token)
    api.Customers.get(customer_id).update(_authentication=dict(password=password))
except Exception as e:
    print("ERROR: ", str(e))

Expected behavior

It should update the password every single time.

Actual behavior

It updates the password most of the times for most customers but some times it randomly gives the following error:

ERROR: 400 Bad Request @ customers/1705: b'[{"status":400,"message":"The field \'password\' is invalid."}]'

Steps to reproduce the behavior

Just run the code multiple times and it will randomly fail at some point.

Can someone please help? This is causing an issue for us that needs to be fixed soon.

Anyone?

I faced and am facing the same issue too. Any response on this?

I see this thread is 4 years old but just wanted to comment for anyone else who ends up here:

If the submitted password does not match the "minimum password requirements" arbitrarily assigned by BigCommerce you will get the 400 error with no explanation as to why. For my current site, the requirements are, at a minimum, a length of 7 characters and there must be a combination of letters AND numbers.

Also, it will reject things like "password1" even though it meets the above criteria.