Skip to content
  • There are no suggestions because the search field is empty.

Apply Default Values to Missing Shopify Order Data

Write a script, apply it to your Shopping Cart Connection, and stop orders from failing due to missing address or contact data.

    Is This What I'm Looking For

    Use this article when Shopify orders are getting rejected, or Amazon Ground labels won't generate, because of missing billing, shipping, or customer information. Since these sections include required information for order processing, InfoPlus rejects the Shopify order and creates an automated Alert detailing the issue. For Amazon Ground, the order is fine but label generation will not be successful. For more details on Amazon Ground Shipping, visit Amazon Ground Shipping

    Without a script to catch this, InfoPlus rejects the order automatically and you have to fix it by hand every time it happens. This article does not cover writing custom script logic for your specific business rules. For that, submit a Pro Services request.

     

    Before You Begin

    • Permission level: You need permission to create and edit Scripts, and to edit Shopping Cart Connection records, in InfoPlus.
    • Prior setup: You need an existing Shopping Cart Connection record for your Shopify store. If you haven't set one up, see Overview of External Shopping Cart Connections.
    • Materials on hand: Know which fields are missing or causing the error. Bill To Address, Ship To Address, Customer Details, or shipping address email and phone for Amazon Ground.

     

    Steps

    1. Create a script
      1. Go to the Script Table 
      2. Select Create a New Script
      3. Complete the required fields, specifically choosing the Script Type → Shopping Cart Connection Order 
    2. Write the Code
      1. Use the example below if needed and make the necessary modification to the address variable. You can turn individual validations on or off. For example, if you don't ship Amazon Ground, set shipping_address_phone and shipping_address_email to false.

      2. Click Save
    3. Apply the script to your Shopping Cart Connection
      1. Go to the Shopping Cart Connection Table
      2. Click Edit on your Shopify connection record
      3. In the Script field, select your new script
    4. Verify the script is working
      1. Go the Script Log Table
      2. Confirm the script ran successfully on a recent order

    Example Script

     

    What You Should See

    Orders that previously failed due to missing address or contact data import successfully. The daily alert for missing billing, shipping, or customer data stops appearing. Amazon Ground labels generate without an email or phone error. You can confirm this in the Script Log table, where you'll see successful runs against incoming orders.

     

    Troubleshooting

    If Shopify orders fail to import, or you see the alert JSONObject["billing_address"] is not a JSONObject:

    Why this happens: Shopify doesn't always send a complete billing or shipping address. This happens most often with guest checkouts, POS orders, or when the shipping address is used as the billing address. InfoPlus rejects the order because required address fields are missing.

    How to fix it: Add the default address script from this article to your existing Shopping Cart Connection script. Once applied, missing address data gets filled in automatically and the order imports without the alert repeating.


    If Amazon Ground labels won't generate:

    Why this happens: The Shopify order is missing a shipping address email or phone number, both required for Amazon Ground Shipping label generation.

    How to fix it: Make sure the shipping_address_phone and shipping_address_email validations are turned on in your script. If you don't ship Amazon Ground, you can turn these off.

     

    Next Steps