saleweaver/python-amazon-sp-api

When im trying to fetch get_purchase_orders_status and passing date parameter im still receiving recent date data!

Nilesh-kodag opened this issue · 2 comments

get_purchase_orders_status() is a function through which we are obtaining data from the Amazon API. This function does not require a report ID. During our code quality check, we noticed that when we pass a date range from 2023-08-18T08:31:00.000 to 2023-08-19T08:31:00.000Z, we still receive results for 2023-10-10 to 2023-10-11. Please find the code snippet below for more details.

try: res = VendorOrders(credentials=CLIENT_CONFIG).get_purchase_orders_status( CreatedAfter="2023-10-04T00:00:00.000Z",CreatedBefore="2023-09-04T23:59:59.999Z",MarketplaceIds = ["ATVPDKIKX0DER"]) #print(res) print(res.payload) except SellingApiException as ex: print(ex)

Code suppose to give me get_purchase_orders_status data for specific time which i have provided but it not able to give me that

Id try using the correct parameters for the api

Args:
key limit:integer | The limit to the number of records returned. Default value is 100 records.
key sortOrder:string | Sort in ascending or descending order by purchase order creation date.
key nextToken:string | Used for pagination when there are more purchase orders than the specified result size limit.
key createdAfter:string | Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
key createdBefore:string | Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
key updatedAfter:string | Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
key updatedBefore:string | Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
key purchaseOrderNumber:string | Provides purchase order status for the specified purchase order number.
key purchaseOrderStatus:string | Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
key itemConfirmationStatus:string | Filters purchase orders based on the specified purchase order item status. If not included in filter, purchase orders for all statuses are included.
key orderingVendorCode:string | Filters purchase orders based on the specified ordering vendor code. This value should be same as 'sellingParty.partyId' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
key shipToPartyId:string | Filters purchase orders for a specific buyer's Fulfillment Center/warehouse by providing ship to location id here. This value should be same as 'shipToParty.partyId' in the purchase order. If not included in filter, this will return purchase orders for all the buyer's warehouses used for vendor group purchase orders.

Then just change createdAfter and createdBefore, since your date range isn't one.

it does not work with get_purchase_orders_status and i cant get date for last year