Knowledgebase: Shipping

How do I use the Shipping API (Custom Shipping Service) module?


Shift4Shop's Shipping API module allows merchants to connect their store to an independent shipping service and get real-time shipping rates from the service. To use the module, you would need to contact your shipping service and ask them to provide you with the following:

  • An endpoint URL
    The URL for your shipping service that the Shift4Shop store will send the order information to*.
  • Access User/Password
    Login credentials needed to connect to the endpoint URL.

*Endpoint URL
As mentioned, the Endpoint URL is the URL for your shipping service that the Shift4Shop store will send order information to, and get shipping rates from. The following is an example of the process you can share with your shipping service so they can provide you with the necessary set up.

At the time of checkout, the Shipping API module will send a request to the endpoint URL in JSON format. The information sent will include the shipping origin address, the destination shipping address, the line items in the cart including SKU, Name, Price, Weight, and Dimensions. The JSON request from the Shift4Shop store will look like this example:

	"orderid": 38,
	"weightunit": "LBS",
	"measurementunit": "IN",
	"totalitems": 1,
	"totalweight": 1,
	"orderamount": 3.99,
	"shippingfrom": {
		"state": "UT",
		"postalcode": "84101",
		"country": "US"
	"shippingto": {
		"address1": "123 Street",
		"address2": "",
		"city": "Coral Springs",
		"state": "FL",
		"postalcode": "33065",
		"country": "US"
	"items": [{
		"sku": "SAMPLE-1007",
		"name": "[DEMO] Extreme Pak Neon Pink Leopard Print Shopping Tote",
		"quantity": 1,
		"unitprice": 3.99,
		"unitweight": 1,
		"unitlength": 0,
		"unitwidth": 0,
		"unitheight": 0

After the JSON request is sent, the store will then expect a JSON response from your shipping carrier to display their rates for the shopper to select. The expected JSON response will need to look like this for the rates to display:

    {"methodname":"DHL Priority", "rate":32.00},
    {"methodname":"USPS First Class", "rate":3.00},
	{"methodname":"UPS Ground", "rate":12.00}

During the checkout process, the rates will be retrieved from your independent shipping service and will be displayed for the shopper to select and complete their order.

For a sample application, please visit the following URL:

Adding the Module to your Store

Once you've gotten the above requirements from your shipping service, you can process with adding the Shipping API module to your store following these steps:

  1. Log into your Shift4Shop Online Store Manager
  2. Using the left hand navigaiton menu, go to Settings >Shipping
  3. In the Shipping section, click on the "Edit Settings" button found under "Shipping Settings" on the page

Once you're in the Shipping Settings section, scroll down past the Real Time Shipping Settings carrier list and locate the "Custom Shipping Service" block.

  1. Click on the Hide / Show" + Icon to expand the section
  2. Paste your shipping service's Endpoint URL in the provided field
  3. Enter your Access User and Password information in the fields provided
  4. Then, mark the "Enable checkbox
  5. Finally, click on the "Save" button at the top right of the page.

The next step will be to create your custom shipping service methods in the store.

Adding the Shipping Method(s)

Now that you've added the Shipping API module, the final step will be to create the shipping methods that will be displayed on the checkout pages for your customers.

  1. Again, using the left hand navigation menu, go to Settings >Shipping
  2. This time, click on the "Select Methods" button located under "Shipping Methods"
  3. Locate the "Custom Shipping Service" section of the page and click on its "Add New" button
  4. Select the region the method will apply to by selecting the Shipping Country and Shipping State from their respective dropdown menus.
  5. Then mark the "Custom Shipping Service" checkbox and click on the "Add Method" button to proceed.

The Custom Shipping Service method will be added and you can further fine tune its settings to meet your needs.

  • Click on the pencil icon next to the caption to change the method's display name
  • Add a markup to the method if you would like for the store to add an additional amount to the returned rate
  • Edit the weight ranges for the method so that it only works for orders in that range
  • Finally, clicking on the Action wheel at the far right of the method will let you edit the advanced settings like the customer group it will be applicable to, and the country/state region.

Once you are done with configuring the method, click Save at the top right of the page and you're all set. You can add as many of the Custom Shipping Service methods by repeating the above steps as needed.

Help Desk Software by Kayako fusion