# Connect Shopify and WhatsApp to collect orders using chatbot

> **Who can use this Card?**
>
> * Gallabox Users having permission to either build and deploy bots or manage bots.
> * Available on all Paid Plans.

## Overview

Embark on a seamless integration journey with Shopify using our step-by-step guide. Whether you're replacing order tags, creating orders, or generating draft orders, this documentation provides a detailed walkthrough for connecting Shopify to your chat-flow effortlessly.

## Shopify API Key and Secret

1. Log into your **Shopify admin panel**, go to **Apps** Menu from left navigation. Scroll down the page and click on **Develop apps** **for your store**.

<figure><img src="/files/uyTiodw5Mj20qlYQgWFj" alt=""><figcaption></figcaption></figure>

2. Click on **Create an App** and then enter the **App name** as **Gallabox.** Click on **"Create app".**&#x20;

<figure><img src="/files/ccapGA2FQlVAXGklFg6N" alt=""><figcaption></figcaption></figure>

3. Once the App gets created on your Shopify admin, click on **API credentials** then scroll down, in the **Access tokens** area, **click Configure Admin API access**.

<figure><img src="/files/OvxspMfXAcUrRCTwhPiA" alt=""><figcaption></figcaption></figure>

4. To configure Admin API Scopes, tick all **Permissions “Read\_….” and “Write\_…”** (if any). Click **Save App**, at the bottom of the page.

> ![](/files/VSGvWiGbH3VaHQhFci5O)    ![](/files/g2ZJ8e9Tck3Lh8Pqe7PM)

5. Click on **API credentials** and you will see **API Key and Secret Key** (i.e. API Key and Password).

<figure><img src="/files/Zhe3TAdBS1aCG6foVEFW" alt=""><figcaption></figcaption></figure>

## Connect Shopify

1. Choose the connector - Shopify from the list of connectors.&#x20;

<figure><img src="/files/AFysBKun3omznYhK4l4v" alt=""><figcaption></figcaption></figure>

2. After clicking on Shopify, you will see four actions- **Replace Order Tag**, **Create Order**, and **Create Draft Order, and Complete Draft Order**. Proceed with selecting any one of them and you will be asked to either create New Connection or choose from Existing.&#x20;

<figure><img src="/files/SKnAgS4vjv9ln4m5F8DZ" alt=""><figcaption></figcaption></figure>

3. If you haven't made any connection, you will have to enter [API Key](#shopify-api-key-and-secret), [Password](#shopify-api-key-and-secret), and Shopify Subdomain and click on **Create Connection**. Once you paste the API Key, Password, and Shopify Subdomain click on Create Connection.

<figure><img src="/files/Ffgj8HXyxHT7HFIcYagP" alt=""><figcaption></figcaption></figure>

## Using the Shopify Connector

You can perform the following four actions using the Shopify Connector:

<table><thead><tr><th width="209">Action Name</th><th>Action Description</th></tr></thead><tbody><tr><td><a href="#replace-order-tag">Replace Order Tag</a></td><td>Allows you to update an existing order tag with a new one, helping categorize or track orders differently.</td></tr><tr><td><a href="#create-order">Create Order</a></td><td>This action is the basic action of creating a new order in Shopify, capturing customer information, products, and payment details.</td></tr><tr><td><a href="#create-draft-order">Create Draft Order</a></td><td>This action lets you create an order on behalf of a customer without immediate payment. You can then send an invoice or collect payment later.</td></tr><tr><td><a href="#complete-draft-order">Complete Draft Order</a></td><td>This action finalizes a draft order, after a customer pays or confirms the order details. It then becomes a regular order with fulfillment options.</td></tr></tbody></table>

### Replace Order Tag

Using the Replace Order Tag action, you can update tags on existing orders without manual edits. This is especially beneficial for sales campaigns, inventory management, and boosting customer service efficiency by maintaining clear and updated order categorization.

To use this Action:&#x20;

Select the corresponding variables in which you have stored the value for **Order ID** and **Tags** or you can enter the information in the field. Click on Save.<br>

<figure><img src="/files/koC8OaIaDiBXT7y8cSEm" alt=""><figcaption></figcaption></figure>

### **Create Order**

{% hint style="info" %}
This Action will work for an Order-based chat-flow.
{% endhint %}

Available Fields for this Action:

<table><thead><tr><th width="182">Fields</th><th>Description</th></tr></thead><tbody><tr><td>Whatsapp Order</td><td>Indicates an order initiated through a WhatsApp integration. Example: <code>{{intent.order}}</code></td></tr><tr><td>Name</td><td>Add a variable under which the values for customer's name is saved. Example: <code>{{recipient.name}}</code></td></tr><tr><td>Phone</td><td>Add a variable under which the values for customer's phone number are saved. Example: <code>{{recipient.phone}}</code></td></tr><tr><td>Financial Status</td><td>Choose from the dropdown the status of the order. Example: <code>Partially Paid</code></td></tr><tr><td>Tag</td><td>Add a variable under which the values for order tags are saved or enter the Tag you would like to add to the contact. Example: <code>COD Confirmation.</code></td></tr><tr><td>Note</td><td>Add a variable under which the values for order notes are saved or enter the note you want to attach with the order. Example: Need </td></tr><tr><td>Source Name</td><td>Identifies the channel where the order originated in Shopify.</td></tr><tr><td>Address</td><td>Customer's billing address associated with the order in Shopify.</td></tr><tr><td>City</td><td>City portion of the customer's billing address in Shopify</td></tr><tr><td>State</td><td>State or province portion of the customer's billing address in Shopify</td></tr><tr><td>Country</td><td>Country portion of the customer's billing address in Shopify.</td></tr><tr><td>Pin</td><td>Postal code associated with the billing address in Shopify.</td></tr><tr><td>Shipping address</td><td>Customer's address where the order will be shipped in Shopify.</td></tr><tr><td>Shipping City</td><td>Customer's city where the order will be shipped in Shopify.</td></tr><tr><td>Shipping State</td><td>Customer's state where the order will be shipped in Shopify.</td></tr><tr><td>Shipping Country</td><td>Customer's country where the order will be shipped in Shopify.</td></tr><tr><td>Shipping Pin code</td><td>Customer's postal code where the order will be shipped in Shopify.</td></tr></tbody></table>

Choose the variables where you stored the values for all the fields mentioned above. Then, click Save.

<figure><img src="/files/LDNPf3Y7NfZZKweOWJpG" alt=""><figcaption></figcaption></figure>

### **Create Draft Order**

Draft orders in Shopify provide flexibility and control over order management. Creating draft orders is key for manually managing orders that don't go through the standard checkout process.

Available Fields for this Action:

<table><thead><tr><th width="182">Fields</th><th>Description</th></tr></thead><tbody><tr><td>Whatsapp Order*</td><td>Indicates an order initiated through a WhatsApp integration. Example: <code>{{intent.order}}</code></td></tr><tr><td>Name*</td><td>Add a variable under which the values for customer's name is saved. Example: <code>{{recipient.name}}</code></td></tr><tr><td>Phone*</td><td>Add a variable under which the values for customer's phone number are saved. Example: <code>{{recipient.phone}}</code></td></tr><tr><td>Financial Status</td><td>Choose from the dropdown the status of the order. Example: <code>Partially Paid</code></td></tr><tr><td>Discount Type</td><td>hoose from two options - Percentage or Fixed Amount.</td></tr><tr><td>Discount Value</td><td>Add a value for either percentage or any fixed amount. </td></tr><tr><td>Discount Title</td><td>he name or short description associated with a discount applied to an order. Example: <code>Summer Sale</code></td></tr><tr><td>Discount Description</td><td>Additional details explaining the discount applied to an order. Example: <code>10% off all items</code></td></tr><tr><td>Address</td><td>Customer's billing address associated with the order in Shopify.</td></tr><tr><td>City</td><td>City portion of the customer's billing address in Shopify</td></tr><tr><td>State</td><td>State or province portion of the customer's billing address in Shopify</td></tr><tr><td>Country</td><td>Country portion of the customer's billing address in Shopify.</td></tr><tr><td>Pin</td><td>Postal code associated with the billing address in Shopify.</td></tr><tr><td>Shipping address</td><td>Customer's address where the order will be shipped in Shopify.</td></tr><tr><td>Shipping City</td><td>Customer's city where the order will be shipped in Shopify.</td></tr><tr><td>Shipping State</td><td>Customer's state where the order will be shipped in Shopify.</td></tr><tr><td>Shipping Country</td><td>Customer's country where the order will be shipped in Shopify.</td></tr><tr><td>Shipping Pin code</td><td>Customer's postal code where the order will be shipped in Shopify.</td></tr><tr><td>Draft Order ID</td><td>Add a variable under which the Draft Order ID will be saved. Example: <code>order_created_manually</code></td></tr><tr><td>Invoice URL</td><td>Add a variable under which the Invoice URL will be saved. Example: <code>Invoice_URL_generated</code></td></tr></tbody></table>

{% hint style="info" %}
This Action will create the draft order and send the payment link to the user.&#x20;
{% endhint %}

Enter the value or select the corresponding variables in which you have stored the value for all the fields. Click on Save.&#x20;

<figure><img src="/files/cCt3iQnX9Ocy6Et42bJP" alt=""><figcaption></figcaption></figure>

### Complete Draft Order

Available Fields for this Action:

<table><thead><tr><th width="182">Field Name</th><th>Field Description</th></tr></thead><tbody><tr><td>Draft Order Id</td><td>Insert the variable under which temporary order is created in Shopify before customer payment or confirmation.</td></tr><tr><td>Payment Pending</td><td>Choose either True or False for the payment of that order.</td></tr><tr><td>Order Id</td><td>Insert the variable to store the finalized order Id in Shopify post payment confirmation by the customer.</td></tr></tbody></table>

Select the corresponding variables in which you have stored the value for Draft Order Id, from the dropdown select the payment pending status.&#x20;

<figure><img src="/files/o9Iy4Qqu8XEbT349DlZe" alt=""><figcaption></figcaption></figure>

All the details of the customers captured after they interact with the chat-flow having Shopify Connector will be pushed to the connected Shopify account.&#x20;

{% hint style="info" %}
Make sure to add the right variables as values for all the fields.&#x20;
{% endhint %}

With your Shopify connector configured, effortlessly manage orders and draft orders. Follow the steps outlined in this guide to ensure accurate data input, whether it's replacing order tags or creating new orders. Optimize your Shopify integration by adding the right variables and values, making your chat-flow a powerful asset for streamlined e-commerce management.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gallabox.com/bots/bot-connectors/connect-shopify-and-whatsapp-to-collect-orders-using-chatbot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
