Please note: This is a working document and so is not yet complete. We have yet to fully create a first party integration with the Shopify JS SDK. You will certainly need to be seriously Shopify/JS developer in order to get things up and running. 

Hidden Attributes

Below is an example of how to add Store Pickup + Delivery details to your orders via the JS SDK. View a full list of hidden attributes.


const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';

const input = {
customAttributes: [
{ key: "Checkout-Method", value: "pickup" },
{ key: "Pickup-Location-Id", value: "1" },
{ key: "Pickup-Location-Company", value: "Zapiet" },
{ key: "Pickup-Location-Address-Line-1", value: "1 Hacker Way" },
{ key: "Pickup-Location-City", value: "Menlo Park" },
{ key: "Pickup-Location-Region", value: "California" },
{ key: "Pickup-Location-Postal-Code", value: "90420" },
{ key: "Pickup-Location-Country", value: "United States" },
{ key: "Pickup-Date", value: "2019-01-31" },
  { key: "Pickup-Time", value: "14:30" }
        ]
};

client.checkout.updateAttributes(checkoutId, input).then((checkout) => {
  // Do something with the updated checkout
});

Checkout Url 

When redirecting customers to the Shopify checkout process you should ensure all of the parameters from the following method are appending to the url:

Zapiet.Widget.getCheckoutParams();

So that you end up with something like:

https://zapietdemo.myshopify.com/25490972/checkouts/15f04d6ed692e309e9bf90757219df2b?checkout%5Bshipping_address%5D%5Baddress1%5D=1+Battery+Place&checkout%5Bshipping_address%5D%5Baddress2%5D=&checkout%5Bshipping_address%5D%5Bcity%5D=Manhattan&checkout%5Bshipping_address%5D%5Bcompany%5D=Zapiet+NYC&checkout%5Bshipping_address%5D%5Bcountry%5D=United+States&checkout%5Bshipping_address%5D%5Bprovince%5D=New+York&checkout%5Bshipping_address%5D%5Bzip%5D=10004&locale=en-CA&step=contact_information

This will then ensure the correct locale and details are pre-populated within the checkout process. 

Zapiet Rates (only for stores using custom built widget)

If you wish to use the Zapiet Rates system you must add a _ZapietId line property to one of the items in the customers cart. 

The key for the property should be:

_ZapietId

The value of the property should be unique and prefixed with your Zapiet Partner ID and an underscore: 

mypartnerid_88550437-f96d-46dc-a329-68a05507e96b

Unsure of your Zapiet Partner ID? Contact [email protected]

Todo - Add step to send customer preferences to rates service. 

Did this answer your question?