Hi,
I am trying to use the draftOrderCreate GraphQL API to create a zero cost order (i.e., zero subtotal, zero taxes, and zero shipping). But, despite my effort to set the shippingLine input to $0, the draft orders are getting created with default positive shipping costs.
Here is the DraftOrderInput I passed to the API:
{‘billingAddress’: {‘address1’: ‘1 Ted Rogers Way’, ‘address2’: None, ‘city’: ‘Toronto’, ‘company’: None, ‘country’: ‘Canada’, ‘countryCode’: ‘CA’, ‘firstName’: None, ‘id’: None, ‘lastName’: None, ‘phone’: ‘256-316-0966’, ‘province’: ‘Ontario’, ‘provinceCode’: ‘ON’, ‘zip’: ‘M4Y 3B7’}, ‘email’: ‘jake123@gmail.com’, ‘lineItems’: [{‘quantity’: 1, ‘variantId’: ‘gid://shopify/ProductVariant/45357904986401’}], ‘note’: ‘Exchange for Order #1063’, ‘phone’: ‘256-316-0966’, ‘presentmentCurrencyCode’: ‘CAD’, ‘purchasingEntity’: {‘customerId’: ‘gid://shopify/Customer/7139793731873’}, ‘reserveInventoryUntil’: ‘2023-10-11T12:49:27.835601-04:00’, ‘shippingAddress’: {‘address1’: ‘1 Ted Rogers Way’, ‘address2’: None, ‘city’: ‘Toronto’, ‘company’: None, ‘country’: ‘Canada’, ‘countryCode’: ‘CA’, ‘firstName’: None, ‘id’: None, ‘lastName’: None, ‘phone’: ‘256-316-0966’, ‘province’: ‘Ontario’, ‘provinceCode’: ‘ON’, ‘zip’: ‘M4Y 3B7’}, ‘shippingLine’: {‘price’: ‘0.0’, ‘shippingRateHandle’: ‘free-shipping’, ‘title’: ‘Free Shipping’}, ‘tags’: [‘’], ‘useCustomerDefaultAddress’: True, ‘visibleToCustomer’: True, ‘appliedDiscount’: {‘description’: ‘Items in an exchange order are not charged.’, ‘title’: ‘Zero-cost order’, ‘value’: 100.0, ‘valueType’: ‘PERCENTAGE’}}
And here’s the response (notice the shippingLine as ‘International Shipping’ with $42):
{‘data’: {‘draftOrderCreate’: {‘draftOrder’: {‘id’: ‘gid://shopify/DraftOrder/1129791127841’, ‘name’: ‘#D126’, ‘shippingLine’: {‘code’: ‘International Shipping’, ‘custom’: False, ‘deliveryCategory’: ‘shipping’, ‘originalPriceSet’: {‘presentmentMoney’: {‘amount’: ‘42.0’, ‘currencyCode’: ‘CAD’}}, ‘shippingRateHandle’: ‘5a141a6edf7ffccc57390a16d58bf042’, ‘source’: ‘shopify’, ‘title’: ‘International Shipping’}}, ‘userErrors’: }}, ‘extensions’: {‘cost’: {‘requestedQueryCost’: 12, ‘actualQueryCost’: 12, ‘throttleStatus’: {‘maximumAvailable’: 1000.0, ‘currentlyAvailable’: 988, ‘restoreRate’: 50.0}}}}
Thanks,
Frate Team