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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| shopName | Shop Name | STRING | Shopify shop name e.g. name.myshopify.com. | true |
| clientId | Client Id | STRING | Client ID can be found in Dev Dashboard. | true |
| clientSecret | Client Secret | STRING | Client secret can be found in Dev Dashboard. | true |
Connection Setup
Create Shopify App (Credentials and Shop Name)
- Navigate to https://dev.shopify.com/dashboard/.
- Click on Create app.
- Enter App name and click on Create.
- 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.
- Enter required scopes: read_customers,read_draft_orders,read_orders,write_orders,write_products and click on Release
- Click on Release.
- Click on Settings.
- Here you can see your credentials.
- Click on your account icon.
- Click on shop you want to connect to.
- Click on Settings.
- Here you can see your Shop name.
- Done 🚀.
Install Shopify App
- Navigate to https://dev.shopify.com/dashboard/.
- Click your app.
- Click on Install app.
- Choose Shopify store you want to install your app in.
- Click on Install.
- Click on Settings.
- Click on Apps and sales channels.
- Here you can see your app is installed.
- Done. 🚀
Enable Read All Orders Permission
- Navigate to https://partners.shopify.com/organizations.
- Choose your organization.
- Click on your app.
- Click on API access requests.
- Click on Choose distribution.
- Click on Custom Distribution.
- Click on Select.
- Click on Select custom distribution.
- Enter your Shop name here. In this example it is
bytechef-test-store.myshopify.com. - Click on Generate link.
- Click on Generate link.
- Click on API access requests.
- Click on Request access under Read all orders scope.
- Enter reason here.
- Click on Request access.
- Navigate to https://dev.shopify.com/dashboard/.
- Click on your app.
- Click on Versions.
- Click Create a version.
- Add
read_all_ordersto scopes. - Click on Release.
- Click on Release.
- Done 🚀.
Actions
Cancel Order
Name: cancelOrder
Cancels an order, with options for refunding, restocking inventory, and customer notification.Order cancellation is irreversible.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| orderId | Order ID | STRING | ID of the order to cancel. | true |
| reason | Reason | STRING OptionsCUSTOMER, DECLINED, FRAUD, INVENTORY, OTHER, STAFF | The reason for canceling the order. | true |
| restock | Restock | BOOLEAN Optionstrue, false | Whether to restock the inventory committed to the order. | true |
| staffNote | Staff Note | STRING | A staff-facing note about the order cancellation. This is not visible to the customer. | false |
| originalPaymentMethodsRefund | Original Payment Methods Refund | BOOLEAN Optionstrue, false | Whether to refund to the original payment method. | false |
| notifyCustomer | Notify Customer | BOOLEAN Optionstrue, 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
| Name | Type | Description |
|---|---|---|
| job | OBJECT Properties{BOOLEAN(done), STRING(id), STRING(query)} | The job that asynchronously cancels the order. |
| userErrors | ARRAY 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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| orderId | Order ID | STRING | ID of the order to close. | true |
Example JSON Structure
{
"label" : "Close Order",
"name" : "closeOrder",
"parameters" : {
"orderId" : ""
},
"type" : "shopify/v1/closeOrder"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| order | OBJECT Properties{BOOLEAN(canMarkAsPaid), {}(cancelReason), DATE_TIME(cancelledAt), STRING(clientIp), BOOLEAN(confirmed), [STRING($discountCode)](discountCodes)} | The closed order. |
| userErrors | ARRAY 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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| products | Products | ARRAY 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
| Name | Type | Description |
|---|---|---|
| order | OBJECT Properties{STRING(id), {[{STRING(id), STRING(title), INTEGER(quantity), {STRING(id)}(variant)}](nodes)}(lineItems)} | The created order. |
| userErrors | ARRAY 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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| title | Title | STRING | Title of new product. | true |
| productOptions | Product Options | ARRAY 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
| Name | Type | Description |
|---|---|---|
| product | OBJECT Properties{STRING(id), STRING(title), [{STRING(id), STRING(name), INTEGER(position), [{STRING(id), STRING(name), BOOLEAN(hasVariants)}](optionValues)}](options)} | The created product. |
| userErrors | ARRAY 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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| orderId | Order ID | STRING | ID of the order to delete. | true |
Example JSON Structure
{
"label" : "Delete Order",
"name" : "deleteOrder",
"parameters" : {
"orderId" : ""
},
"type" : "shopify/v1/deleteOrder"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| deletedId | STRING | ID of the deleted order. |
| userErrors | ARRAY 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
| Name | Type | Description |
|---|---|---|
| id | STRING | ID of the abandoned cart. |
| abandonedCheckoutUrl | STRING | URL that leads to the abandoned checkout. |
| createdAt | STRING | DateTime when the cart was created. |
| customer | OBJECT 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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| orderId | Order ID | STRING | ID 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
| Name | Type | Description |
|---|---|---|
| id | STRING | Order ID |
| name | STRING | Order name |
| totalPriceSet | OBJECT Properties{{STRING(amount)}(presentmentMoney)} | The total price of the order, before returns, in shop and presentment currencies. |
| displayFulfillmentStatus | STRING | Fulfillment status of the order. |
| customer | OBJECT Properties{STRING(email), STRING(phone)} | Customer information. |
| lineItems | OBJECT 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
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| orderId | Order ID | STRING | ID of the order to update. | true |
| note | Note | STRING | An optional note that a shop owner can attach to the order. | false |
| STRING | The customer's email address. | false | ||
| tags | Tags | ARRAY 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
| Name | Type | Description |
|---|---|---|
| order | OBJECT Properties{STRING(id), STRING(note), STRING(email), [STRING](tags)} | The updated order. |
| userErrors | ARRAY 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
- You have order by its order number (e.g. #1042).
- In your Shopify Admin go in Orders.
- Find order you want to find ID for and open it.
- In URL you will see number like this
/orders/7157417935093 - 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
- In your Shopify Admin go in Products.
- Find product you want to find ID for and open it.
- In URL you will see number like this
/products/8335757639925 - Because of that your order ID is gid://shopify/Product/8335757639925
How is this guide?
Last updated on