ByteChef LogoByteChef

Shopify

Shopify is an e-commerce platform that allows businesses to create online stores and sell products.

Categories: E-commerce

Type: shopify/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
shopNameShop NameSTRINGShopify shop name e.g. name.myshopify.com.true
clientIdClient IdSTRINGClient ID can be found in Dev Dashboard.true
clientSecretClient SecretSTRINGClient secret can be found in Dev Dashboard.true

Connection Setup

Create Shopify App (Credentials and Shop Name)

  1. Navigate to https://dev.shopify.com/dashboard/.
  2. Click on Create app.
  3. Enter App name and click on Create.
  4. Enter app and redirect url. Depending on which version of ByteChef you are using enter link or link for Redirect URL. And link or link for App URL.
  5. Enter required scopes: read_customers,read_draft_orders,read_orders,write_orders,write_products and click on Release
  6. Click on Release.
  7. Click on Settings.
  8. Here you can see your credentials.
  9. Click on your account icon.
  10. Click on shop you want to connect to.
  11. Click on Settings.
  12. Here you can see your Shop name.
  13. Done 🚀.

Install Shopify App

  1. Navigate to https://dev.shopify.com/dashboard/.
  2. Click your app.
  3. Click on Install app.
  4. Choose Shopify store you want to install your app in.
  5. Click on Install.
  6. Click on Settings.
  7. Click on Apps and sales channels.
  8. Here you can see your app is installed.
  9. Done. 🚀

Enable Read All Orders Permission

  1. Navigate to https://partners.shopify.com/organizations.
  2. Choose your organization.
  3. Click on your app.
  4. Click on API access requests.
  5. Click on Choose distribution.
  6. Click on Custom Distribution.
  7. Click on Select.
  8. Click on Select custom distribution.
  9. Enter your Shop name here. In this example it is bytechef-test-store.myshopify.com.
  10. Click on Generate link.
  11. Click on Generate link.
  12. Click on API access requests.
  13. Click on Request access under Read all orders scope.
  14. Enter reason here.
  15. Click on Request access.
  16. Navigate to https://dev.shopify.com/dashboard/.
  17. Click on your app.
  18. Click on Versions.
  19. Click Create a version.
  20. Add read_all_orders to scopes.
  21. Click on Release.
  22. Click on Release.
  23. Done 🚀.

Actions

Cancel Order

Name: cancelOrder

Cancels an order, with options for refunding, restocking inventory, and customer notification.Order cancellation is irreversible.

Properties

NameLabelTypeDescriptionRequired
orderIdOrder IDSTRINGID of the order to cancel.true
reasonReasonSTRING
Options CUSTOMER, DECLINED, FRAUD, INVENTORY, OTHER, STAFF
The reason for canceling the order.true
restockRestockBOOLEAN
Options true, false
Whether to restock the inventory committed to the order.true
staffNoteStaff NoteSTRINGA staff-facing note about the order cancellation. This is not visible to the customer.false
originalPaymentMethodsRefundOriginal Payment Methods RefundBOOLEAN
Options true, false
Whether to refund to the original payment method.false
notifyCustomerNotify CustomerBOOLEAN
Options true, false
Whether to send a notification to the customer about the order cancellation.false

Example JSON Structure

{
  "label" : "Cancel Order",
  "name" : "cancelOrder",
  "parameters" : {
    "orderId" : "",
    "reason" : "",
    "restock" : false,
    "staffNote" : "",
    "originalPaymentMethodsRefund" : false,
    "notifyCustomer" : false
  },
  "type" : "shopify/v1/cancelOrder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
jobOBJECT
Properties {BOOLEAN(done), STRING(id), STRING(query)}
The job that asynchronously cancels the order.
userErrorsARRAY
Items [{STRING(field), STRING(message)}]
The list of errors that occurred from executing the mutation.

Output Example

{
  "job" : {
    "done" : false,
    "id" : "",
    "query" : ""
  },
  "userErrors" : [ {
    "field" : "",
    "message" : ""
  } ]
}

Find order ID

To find the Order ID, click here.

Close Order

Name: closeOrder

Marks an open Order as closed. A closed order is one where merchants fulfill or cancel all LineItem objects and complete all financial transactions.

Properties

NameLabelTypeDescriptionRequired
orderIdOrder IDSTRINGID of the order to close.true

Example JSON Structure

{
  "label" : "Close Order",
  "name" : "closeOrder",
  "parameters" : {
    "orderId" : ""
  },
  "type" : "shopify/v1/closeOrder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
orderOBJECT
Properties {BOOLEAN(canMarkAsPaid), {}(cancelReason), DATE_TIME(cancelledAt), STRING(clientIp), BOOLEAN(confirmed), [STRING($discountCode)](discountCodes)}
The closed order.
userErrorsARRAY
Items [{STRING(field), STRING(message)}]
The list of errors that occurred from executing the mutation.

Output Example

{
  "order" : {
    "canMarkAsPaid" : false,
    "cancelReason" : { },
    "cancelledAt" : "2021-01-01T00:00:00",
    "clientIp" : "",
    "confirmed" : false,
    "discountCodes" : [ "" ]
  },
  "userErrors" : [ {
    "field" : "",
    "message" : ""
  } ]
}

Find order ID

To find the Order ID, click here.

Create Order

Name: createOrder

Creates an order with attributes such as customer information, line items, and shipping and billing addresses.

Properties

NameLabelTypeDescriptionRequired
productsProductsARRAY
Items [{STRING(productId), INTEGER(quantity)}($product)]
List of products you want to order.false

Example JSON Structure

{
  "label" : "Create Order",
  "name" : "createOrder",
  "parameters" : {
    "products" : [ {
      "productId" : "",
      "quantity" : 1
    } ]
  },
  "type" : "shopify/v1/createOrder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
orderOBJECT
Properties {STRING(id), {[{STRING(id), STRING(title), INTEGER(quantity), {STRING(id)}(variant)}](nodes)}(lineItems)}
The created order.
userErrorsARRAY
Items [{STRING(field), STRING(message)}]
The list of errors that occurred from executing the mutation.

Output Example

{
  "order" : {
    "id" : "",
    "lineItems" : {
      "nodes" : [ {
        "id" : "",
        "title" : "",
        "quantity" : 1,
        "variant" : {
          "id" : ""
        }
      } ]
    }
  },
  "userErrors" : [ {
    "field" : "",
    "message" : ""
  } ]
}

Find product ID

To find the Product ID, click here.

Create Product

Name: createProduct

Create new product for your store.

Properties

NameLabelTypeDescriptionRequired
titleTitleSTRINGTitle of new product.true
productOptionsProduct OptionsARRAY
Items [{STRING(name), [STRING(value)]\(values)}\(productOption)]
Options that will describe the product, for example: size, color.false

Example JSON Structure

{
  "label" : "Create Product",
  "name" : "createProduct",
  "parameters" : {
    "title" : "",
    "productOptions" : [ {
      "name" : "",
      "values" : [ "" ]
    } ]
  },
  "type" : "shopify/v1/createProduct"
}

Output

Type: OBJECT

Properties

NameTypeDescription
productOBJECT
Properties {STRING(id), STRING(title), [{STRING(id), STRING(name), INTEGER(position), [{STRING(id), STRING(name), BOOLEAN(hasVariants)}](optionValues)}](options)}
The created product.
userErrorsARRAY
Items [{STRING(field), STRING(message)}]
The list of errors that occurred from executing the mutation.

Output Example

{
  "product" : {
    "id" : "",
    "title" : "",
    "options" : [ {
      "id" : "",
      "name" : "",
      "position" : 1,
      "optionValues" : [ {
        "id" : "",
        "name" : "",
        "hasVariants" : false
      } ]
    } ]
  },
  "userErrors" : [ {
    "field" : "",
    "message" : ""
  } ]
}

Delete Order

Name: deleteOrder

Deletes an order. Orders that interact with an online gateway can't be deleted.

Properties

NameLabelTypeDescriptionRequired
orderIdOrder IDSTRINGID of the order to delete.true

Example JSON Structure

{
  "label" : "Delete Order",
  "name" : "deleteOrder",
  "parameters" : {
    "orderId" : ""
  },
  "type" : "shopify/v1/deleteOrder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
deletedIdSTRINGID of the deleted order.
userErrorsARRAY
Items [{STRING(field), STRING(message)}]
The list of errors that occurred from executing the mutation.

Output Example

{
  "deletedId" : "",
  "userErrors" : [ {
    "field" : "",
    "message" : ""
  } ]
}

Find order ID

To find the Order ID, click here.

Get Abandoned Carts

Name: getAbandonedCarts

Retrieves abandoned carts.

Example JSON Structure

{
  "label" : "Get Abandoned Carts",
  "name" : "getAbandonedCarts",
  "type" : "shopify/v1/getAbandonedCarts"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
idSTRINGID of the abandoned cart.
abandonedCheckoutUrlSTRINGURL that leads to the abandoned checkout.
createdAtSTRINGDateTime when the cart was created.
customerOBJECT
Properties {STRING(id), STRING(firstName), STRING(lastName), STRING(email)}
Customer info.

Output Example

[ {
  "id" : "",
  "abandonedCheckoutUrl" : "",
  "createdAt" : "",
  "customer" : {
    "id" : "",
    "firstName" : "",
    "lastName" : "",
    "email" : ""
  }
} ]

Get Order

Name: getOrder

Get order by id.

Properties

NameLabelTypeDescriptionRequired
orderIdOrder IDSTRINGID of the order you want to fetch.true

Example JSON Structure

{
  "label" : "Get Order",
  "name" : "getOrder",
  "parameters" : {
    "orderId" : ""
  },
  "type" : "shopify/v1/getOrder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGOrder ID
nameSTRINGOrder name
totalPriceSetOBJECT
Properties {{STRING(amount)}(presentmentMoney)}
The total price of the order, before returns, in shop and presentment currencies.
displayFulfillmentStatusSTRINGFulfillment status of the order.
customerOBJECT
Properties {STRING(email), STRING(phone)}
Customer information.
lineItemsOBJECT
Properties {[{STRING(id), STRING(name)}](nodes)}
A list of the order's line items.

Output Example

{
  "id" : "",
  "name" : "",
  "totalPriceSet" : {
    "presentmentMoney" : {
      "amount" : ""
    }
  },
  "displayFulfillmentStatus" : "",
  "customer" : {
    "email" : "",
    "phone" : ""
  },
  "lineItems" : {
    "nodes" : [ {
      "id" : "",
      "name" : ""
    } ]
  }
}

Find order ID

To find the Order ID, click here.

Update Order

Name: updateOrder

Update an existing order.

Properties

NameLabelTypeDescriptionRequired
orderIdOrder IDSTRINGID of the order to update.true
noteNoteSTRINGAn optional note that a shop owner can attach to the order.false
emailEmailSTRINGThe customer's email address.false
tagsTagsARRAY
Items [STRING($tag)]
Tags attached to the order.false

Example JSON Structure

{
  "label" : "Update Order",
  "name" : "updateOrder",
  "parameters" : {
    "orderId" : "",
    "note" : "",
    "email" : "",
    "tags" : [ "" ]
  },
  "type" : "shopify/v1/updateOrder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
orderOBJECT
Properties {STRING(id), STRING(note), STRING(email), [STRING](tags)}
The updated order.
userErrorsARRAY
Items [{STRING(field), STRING(message)}]
The list of errors that occurred from executing the mutation.

Output Example

{
  "order" : {
    "id" : "",
    "note" : "",
    "email" : "",
    "tags" : [ "" ]
  },
  "userErrors" : [ {
    "field" : "",
    "message" : ""
  } ]
}

Find order ID

To find the Order ID, click here.

Triggers

New Cancelled Order

Name: newCancelledOrder

Triggers when order is cancelled.

Type: DYNAMIC_WEBHOOK

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "New Cancelled Order",
  "name" : "newCancelledOrder",
  "type" : "shopify/v1/newCancelledOrder"
}

New Order

Name: newOrder

Triggers when new order is created.

Type: DYNAMIC_WEBHOOK

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "New Order",
  "name" : "newOrder",
  "type" : "shopify/v1/newOrder"
}

New Paid Order

Name: newPaidOrder

Triggers when paid order is created.

Type: DYNAMIC_WEBHOOK

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "New Paid Order",
  "name" : "newPaidOrder",
  "type" : "shopify/v1/newPaidOrder"
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.


Additional Instructions

How to find your order ID

You can find it only if you are the store owner

  1. You have order by its order number (e.g. #1042).
  2. In your Shopify Admin go in Orders.
  3. Find order you want to find ID for and open it.
  4. In URL you will see number like this /orders/7157417935093
  5. Because of that your order ID is gid://shopify/Order/7157417935093

How to find your product ID

You can find it only if you are the store owner

  1. In your Shopify Admin go in Products.
  2. Find product you want to find ID for and open it.
  3. In URL you will see number like this /products/8335757639925
  4. Because of that your order ID is gid://shopify/Product/8335757639925

How is this guide?

Last updated on

On this page