You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from sp_api.api import Orders
from dateutil.parser import parse
from helpers import calc_start_date
import datetime
# This works
Orders().get_orders(CreatedAfter=parse("2021-03-23T19:45:13.864378")).payload
# This fails
Orders().get_orders(CreatedAfter=parse('2019-01-22T16:31:08+00:00').isoformat()).payload
The fail message for the latter is:
sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': 'timestamp must follow ISO8601', 'details': ''}]
Can someone who has experienced this before please explain what is going on? The latter date is isoformat from my understanding and should work with the SP-API.
I can get around this by removing the "+00:00" at the end of the time string, but it seems a bit strange that the Python isoformat doesn't work directly with the API endpoint.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey Folks,
I am calling this function in the API:
The fail message for the latter is:
sp_api.base.exceptions.SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': 'timestamp must follow ISO8601', 'details': ''}]
Can someone who has experienced this before please explain what is going on? The latter date is isoformat from my understanding and should work with the SP-API.
I can get around this by removing the "+00:00" at the end of the time string, but it seems a bit strange that the Python isoformat doesn't work directly with the API endpoint.
Beta Was this translation helpful? Give feedback.
All reactions