Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
2 changes: 1 addition & 1 deletion bol/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (1, 2, 0, 'final', 0)
VERSION = (1, 3, 0, 'final', 0)

__title__ = 'python-bol-api'
__version_info__ = VERSION
Expand Down
21 changes: 13 additions & 8 deletions bol/retailer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@ 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
if page is not 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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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",
}
)

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions bol/retailer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class Meta:
additionalServices = ModelField(additionalServices)
offerPrice = DecimalField()
transactionFee = DecimalField()
latestChangedDateTime = DateTimeField()


class OrderItems(ModelList):
Expand Down