diff --git a/README.rst b/README.rst index ab2d95c..052f4ef 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ JSON data is returned "as is": Retailer API ============ -Supports the BOL Api v7, documented here: https://api.bol.com/retailer/public/Retailer-API/selling-on-bolcom-processflow.html +Supports the BOL Api v8, documented here: https://api.bol.com/retailer/public/Retailer-API/selling-on-bolcom-processflow.html Instantiate the API:: diff --git a/bol/__init__.py b/bol/__init__.py index 7ded757..cd5bbe9 100644 --- a/bol/__init__.py +++ b/bol/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 2, 0, 'final', 0) +VERSION = (1, 3, 0, 'final', 0) __title__ = 'python-bol-api' __version_info__ = VERSION diff --git a/bol/retailer/api.py b/bol/retailer/api.py index 4ac0dc7..5315be1 100755 --- a/bol/retailer/api.py +++ b/bol/retailer/api.py @@ -48,7 +48,7 @@ class OrderMethods(MethodGroup): def __init__(self, api): super(OrderMethods, self).__init__(api, "orders") - def list(self, fulfilment_method=None, page=None, status=None): + def list(self, fulfilment_method=None, page=None, status=None, change_interval_minute=None, latest_change_date=None): params = {} if fulfilment_method: params["fulfilment-method"] = fulfilment_method @@ -56,6 +56,11 @@ def list(self, fulfilment_method=None, page=None, status=None): params["page"] = page if status: params["status"] = status + if change_interval_minute: + params["change-interval-minute"] = change_interval_minute + if latest_change_date: + params["latest-change-date"] = latest_change_date + resp = self.request("GET", params=params) return Orders.parse(self.api, resp.text) @@ -225,7 +230,7 @@ def createShippingLabel(self, orderitems_list, label_id): def getShippingLabel(self, shipping_label_id): headers = { - "accept": "application/vnd.retailer.v7+pdf" + "accept": "application/vnd.retailer.v8+pdf" } response = self.request('GET', path=str(shipping_label_id), headers=headers) return response @@ -282,7 +287,7 @@ def requestExportFile(self): def getOffersFile(self, export_id): headers = { - "accept": "application/vnd.retailer.v7+csv" + "accept": "application/vnd.retailer.v8+csv" } response = self.request('GET', path='export/{}'.format(export_id), headers=headers) @@ -347,7 +352,7 @@ def getProductLabels(self, labelFormat, products): } headers = { - "accept": "application/vnd.retailer.v7+pdf" + "accept": "application/vnd.retailer.v8+pdf" } response = self.request("POST", path="product-labels", headers=headers, json=params) return response @@ -362,14 +367,14 @@ def update(self, replenishment_id, **param): def getLoadCarrierLabels(self, replenishment_id, label_type="WAREHOUSE"): headers = { - "accept": "application/vnd.retailer.v7+pdf" + "accept": "application/vnd.retailer.v8+pdf" } response = self.request("GET", path='{}/load-carrier-labels'.format(replenishment_id), headers=headers, json=label_type) return response def getPickList(self, replenishment_id): headers = { - "accept": "application/vnd.retailer.v7+pdf" + "accept": "application/vnd.retailer.v8+pdf" } response = self.request("GET", path='{}/pick-list'.format(replenishment_id), headers=headers) return response @@ -489,7 +494,7 @@ def set_access_token(self, access_token): self.session.headers.update( { "Authorization": "Bearer " + access_token, - "Accept": "application/vnd.retailer.v7+json", + "Accept": "application/vnd.retailer.v8+json", } ) @@ -509,7 +514,7 @@ def request(self, method, uri, params={}, **kwargs): # If these headers are not added, the api returns a 400 # Reference: # https://api.bol.com/retailer/public/conventions/index.html - content_header = "application/vnd.retailer.v7+json" + content_header = "application/vnd.retailer.v8+json" request_kwargs["headers"].update({ "content-type": content_header diff --git a/bol/retailer/models.py b/bol/retailer/models.py index d58cc97..0c9fb30 100755 --- a/bol/retailer/models.py +++ b/bol/retailer/models.py @@ -152,6 +152,7 @@ class Meta: additionalServices = ModelField(additionalServices) offerPrice = DecimalField() transactionFee = DecimalField() + latestChangedDateTime = DateTimeField() class OrderItems(ModelList):