WooCommerceConnector icon indicating copy to clipboard operation
WooCommerceConnector copied to clipboard

Error: WooCommerce get error 400 because of Invalid date

Open mtogiz opened this issue 4 years ago • 6 comments

I tested this plugin on Erpnext v12 and v13-beta. First time sync after install is ok. But from the second time I always get the error below.

http://192.168.64.8/wp-json/wc/v3/products?per_page=100&after=2020-11-07T16%3A42%3A50.696586%3F&oauth_consumer_key=ck_d4ec52c45f7f55a7ab10e2a127d8e28ecbe4d90a&oauth_timestamp=1604742243&oauth_nonce=f70149daae9e9e150d35b7e3302610d44e0a6569&oauth_signature_method=HMAC-SHA256&oauth_signature=s25fH%2B1yNzaDO5b99ja5PYuFBYNI6Ld3vMPwc8h%2FDPc%3D: {'code': 'rest_invalid_param', 'message': 'Invalid parameter(s): after', 'data': {'status': 400, 'params': {'after': 'Invalid date.'}}}

I guess the problem come from when we have "Last Sync Datetime" (maybe wrong format for woocommerce REST API).

1s Sync: Screen Shot 2020-11-07 at 16 56 04

2nd Sync: Screen Shot 2020-11-07 at 16 57 39

Woocommerce 4.6.2 Wordpress 5.5.3

mtogiz avatar Nov 07 '20 10:11 mtogiz

Hi, anyone got this problem ?

I tested this plugin on Erpnext v12 and v13-beta. First time sync after install is ok. But from the second time I always get the error below.

http://192.168.64.8/wp-json/wc/v3/products?per_page=100&after=2020-11-07T16%3A42%3A50.696586%3F&oauth_consumer_key=ck_d4ec52c45f7f55a7ab10e2a127d8e28ecbe4d90a&oauth_timestamp=1604742243&oauth_nonce=f70149daae9e9e150d35b7e3302610d44e0a6569&oauth_signature_method=HMAC-SHA256&oauth_signature=s25fH%2B1yNzaDO5b99ja5PYuFBYNI6Ld3vMPwc8h%2FDPc%3D: {'code': 'rest_invalid_param', 'message': 'Invalid parameter(s): after', 'data': {'status': 400, 'params': {'after': 'Invalid date.'}}}

I guess the problem come from when we have "Last Sync Datetime" (maybe wrong format for woocommerce REST API).

1s Sync: Screen Shot 2020-11-07 at 16 56 04

2nd Sync: Screen Shot 2020-11-07 at 16 57 39

Woocommerce 4.6.2 Wordpress 5.5.3

mtogiz avatar Nov 16 '20 03:11 mtogiz

Same issue occurred.

xoojulian avatar Dec 13 '20 14:12 xoojulian

Same issue occurred while syncing woocommerce... Any suggestions and comments are welcomed..

ahsharma07 avatar Dec 20 '20 15:12 ahsharma07

@mtogiz I met the same issue with ERPNext V12, Did you find the solution already?

sambath1605 avatar May 16 '21 06:05 sambath1605

@mtogiz I met the same issue with ERPNext V12, Did you find the solution already?

Not yet bro

mtogiz avatar May 18 '21 15:05 mtogiz

I tried this and it worked for me perfectly!

You have to pass the date in this format: orders?after=2021-02-01T00:00:00&before=2021-02-02T23:59:59

Mouadox avatar Jan 15 '22 23:01 Mouadox