fix: update shopify api version (#25600)
This commit is contained in:
parent
f132ed4335
commit
996f7e53a1
@ -335,13 +335,13 @@ def get_url(shopify_settings):
|
|||||||
|
|
||||||
if not last_order_id:
|
if not last_order_id:
|
||||||
if shopify_settings.sync_based_on == 'Date':
|
if shopify_settings.sync_based_on == 'Date':
|
||||||
url = get_shopify_url("admin/api/2020-10/orders.json?limit=250&created_at_min={0}&since_id=0".format(
|
url = get_shopify_url("admin/api/2021-04/orders.json?limit=250&created_at_min={0}&since_id=0".format(
|
||||||
get_datetime(shopify_settings.from_date)), shopify_settings)
|
get_datetime(shopify_settings.from_date)), shopify_settings)
|
||||||
else:
|
else:
|
||||||
url = get_shopify_url("admin/api/2020-10/orders.json?limit=250&since_id={0}".format(
|
url = get_shopify_url("admin/api/2021-04/orders.json?limit=250&since_id={0}".format(
|
||||||
shopify_settings.from_order_id), shopify_settings)
|
shopify_settings.from_order_id), shopify_settings)
|
||||||
else:
|
else:
|
||||||
url = get_shopify_url("admin/api/2020-10/orders.json?limit=250&since_id={0}".format(last_order_id), shopify_settings)
|
url = get_shopify_url("admin/api/2021-04/orders.json?limit=250&since_id={0}".format(last_order_id), shopify_settings)
|
||||||
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class ShopifySettings(Document):
|
|||||||
webhooks = ["orders/create", "orders/paid", "orders/fulfilled"]
|
webhooks = ["orders/create", "orders/paid", "orders/fulfilled"]
|
||||||
# url = get_shopify_url('admin/webhooks.json', self)
|
# url = get_shopify_url('admin/webhooks.json', self)
|
||||||
created_webhooks = [d.method for d in self.webhooks]
|
created_webhooks = [d.method for d in self.webhooks]
|
||||||
url = get_shopify_url('admin/api/2020-04/webhooks.json', self)
|
url = get_shopify_url('admin/api/2021-04/webhooks.json', self)
|
||||||
for method in webhooks:
|
for method in webhooks:
|
||||||
session = get_request_session()
|
session = get_request_session()
|
||||||
try:
|
try:
|
||||||
@ -56,7 +56,7 @@ class ShopifySettings(Document):
|
|||||||
deleted_webhooks = []
|
deleted_webhooks = []
|
||||||
|
|
||||||
for d in self.webhooks:
|
for d in self.webhooks:
|
||||||
url = get_shopify_url('admin/api/2020-04/webhooks/{0}.json'.format(d.webhook_id), self)
|
url = get_shopify_url('admin/api/2021-04/webhooks/{0}.json'.format(d.webhook_id), self)
|
||||||
try:
|
try:
|
||||||
res = session.delete(url, headers=get_header(self))
|
res = session.delete(url, headers=get_header(self))
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
|
@ -8,7 +8,7 @@ from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings impo
|
|||||||
shopify_variants_attr_list = ["option1", "option2", "option3"]
|
shopify_variants_attr_list = ["option1", "option2", "option3"]
|
||||||
|
|
||||||
def sync_item_from_shopify(shopify_settings, item):
|
def sync_item_from_shopify(shopify_settings, item):
|
||||||
url = get_shopify_url("admin/api/2020-04/products/{0}.json".format(item.get("product_id")), shopify_settings)
|
url = get_shopify_url("admin/api/2021-04/products/{0}.json".format(item.get("product_id")), shopify_settings)
|
||||||
session = get_request_session()
|
session = get_request_session()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user