> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.shopify.orders.CreateRefund

- Component: `appmixer.shopify.orders.CreateRefund`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.shopify 4.1.0](https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0/component/appmixer.shopify.orders.CreateRefund>

Refund line items (and shipping) of an order. Leave the line items empty to refund everything that can still be refunded. Returns the refund.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Order (`orderId`) | text | Pick an order, or enter its ID: the global ID (gid://shopify/Order/450789469) or the numeric ID from the order's admin URL. |
| Line Items (`lineItems`) | expression | The line items to refund. Leave empty to refund every line item in full. |
| Refund Shipping (`refundShipping`) | toggle | Refund the full shipping cost too. |
| Refund Payment (`refundPayment`) | toggle | Return the money to the payments of the order (as Shopify suggests for the refunded items). Turn off to record the refund without moving money. |
| Note (`note`) | textarea | The reason for the refund. |
| Notify Customer (`notify`) | toggle | Send the customer the refund notification e-mail. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| ID (`id`) | string | - |
| Legacy Resource ID (`legacyResourceId`) | string | - |
| Note (`note`) | string | - |
| Created At (`createdAt`) | string | - |
| Updated At (`updatedAt`) | string | - |
| Processed At (`processedAt`) | string | - |
| Total Refunded (`totalRefundedSet`) | object | - |
| Return (`return`) | object | - |
| Refund Line Items (`refundLineItems`) | array | - |
| Transactions (`transactions`) | array | - |
| Order Adjustments (`orderAdjustments`) | array | - |
| Order (`order`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.shopify.orders.CreateRefund",
  "description": "Refund line items (and shipping) of an order. Leave the line items empty to refund everything that can still be refunded. Returns the refund.",
  "author": "Appmixer <info@appmixer.com>",
  "private": false,
  "auth": {
    "service": "appmixer:shopify",
    "scope": [
      "write_orders"
    ]
  },
  "quota": {
    "manager": "appmixer:shopify",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string"
          },
          "lineItems": {
            "type": "object"
          },
          "refundShipping": {
            "type": "boolean"
          },
          "refundPayment": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "notify": {
            "type": "boolean"
          }
        },
        "required": [
          "orderId"
        ]
      },
      "inspector": {
        "inputs": {
          "orderId": {
            "type": "text",
            "label": "Order",
            "index": 1,
            "tooltip": "Pick an order, or enter its ID: the global ID (gid://shopify/Order/450789469) or the numeric ID from the order's admin URL.",
            "source": {
              "url": "/component/appmixer/shopify/orders/FindOrders?outPort=out",
              "data": {
                "messages": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./FindOrders#ordersToSelectArray"
              }
            }
          },
          "lineItems": {
            "type": "expression",
            "label": "Line Items",
            "index": 2,
            "levels": [
              "ADD"
            ],
            "tooltip": "The line items to refund. Leave empty to refund every line item in full.",
            "fields": {
              "lineItemId": {
                "type": "text",
                "label": "Line Item ID",
                "index": 1,
                "tooltip": "The ID of the order's line item (gid://shopify/LineItem/123 or 123), for example from the lineItems of Get Order."
              },
              "quantity": {
                "type": "number",
                "label": "Quantity",
                "index": 2,
                "tooltip": "How many units to refund. Leave empty to refund all refundable units of the line item."
              },
              "restockType": {
                "type": "select",
                "label": "Restock",
                "index": 3,
                "defaultValue": "NO_RESTOCK",
                "options": [
                  {
                    "label": "Do not restock",
                    "value": "NO_RESTOCK"
                  },
                  {
                    "label": "Restock (item not shipped yet)",
                    "value": "CANCEL"
                  },
                  {
                    "label": "Restock (item returned)",
                    "value": "RETURN"
                  }
                ]
              }
            }
          },
          "refundShipping": {
            "type": "toggle",
            "label": "Refund Shipping",
            "index": 3,
            "defaultValue": false,
            "tooltip": "Refund the full shipping cost too."
          },
          "refundPayment": {
            "type": "toggle",
            "label": "Refund Payment",
            "index": 4,
            "defaultValue": true,
            "tooltip": "Return the money to the payments of the order (as Shopify suggests for the refunded items). Turn off to record the refund without moving money."
          },
          "note": {
            "type": "textarea",
            "label": "Note",
            "index": 5,
            "tooltip": "The reason for the refund."
          },
          "notify": {
            "type": "toggle",
            "label": "Notify Customer",
            "index": 6,
            "defaultValue": false,
            "tooltip": "Send the customer the refund notification e-mail."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "required": [
          "id",
          "legacyResourceId",
          "createdAt",
          "updatedAt",
          "processedAt",
          "totalRefundedSet",
          "refundLineItems",
          "transactions",
          "orderAdjustments",
          "order"
        ],
        "properties": {
          "id": {
            "type": "string",
            "title": "ID",
            "example": "gid://shopify/Refund/1221986910289"
          },
          "legacyResourceId": {
            "type": "string",
            "title": "Legacy Resource ID",
            "example": "1221986910289"
          },
          "note": {
            "type": "string",
            "title": "Note",
            "example": "Damaged in transit"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "example": "2026-10-05T08:25:09Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "example": "2026-10-05T08:25:09Z"
          },
          "processedAt": {
            "type": "string",
            "format": "date-time",
            "title": "Processed At",
            "example": "2026-10-05T08:25:09Z"
          },
          "totalRefundedSet": {
            "type": "object",
            "title": "Total Refunded",
            "required": [
              "shopMoney"
            ],
            "properties": {
              "shopMoney": {
                "type": "object",
                "title": "Total Refunded.Shop Money",
                "required": [
                  "amount",
                  "currencyCode"
                ],
                "properties": {
                  "amount": {
                    "type": "string",
                    "title": "Total Refunded.Shop Money.Amount",
                    "example": "25.0"
                  },
                  "currencyCode": {
                    "type": "string",
                    "title": "Total Refunded.Shop Money.Currency Code",
                    "example": "USD"
                  }
                }
              }
            }
          },
          "return": {
            "type": "object",
            "title": "Return",
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "title": "Return.ID",
                "example": "gid://shopify/Return/945684561"
              },
              "name": {
                "type": "string",
                "title": "Return.Name",
                "example": "#1026-R1"
              }
            }
          },
          "refundLineItems": {
            "type": "array",
            "title": "Refund Line Items",
            "items": {
              "type": "object",
              "required": [
                "quantity",
                "restockType",
                "restocked",
                "priceSet",
                "subtotalSet",
                "totalTaxSet",
                "lineItem"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "title": "ID",
                  "example": "gid://shopify/RefundLineItem/1202700058705"
                },
                "quantity": {
                  "type": "integer",
                  "title": "Quantity",
                  "example": 1
                },
                "restockType": {
                  "type": "string",
                  "title": "Restock Type",
                  "example": "NO_RESTOCK"
                },
                "restocked": {
                  "type": "boolean",
                  "title": "Restocked",
                  "example": false
                },
                "location": {
                  "type": "object",
                  "title": "Location",
                  "required": [
                    "id",
                    "name"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "title": "Location.ID",
                      "example": "gid://shopify/Location/124679880785"
                    },
                    "name": {
                      "type": "string",
                      "title": "Location.Name",
                      "example": "Shop location"
                    }
                  }
                },
                "priceSet": {
                  "type": "object",
                  "title": "Price",
                  "required": [
                    "shopMoney"
                  ],
                  "properties": {
                    "shopMoney": {
                      "type": "object",
                      "title": "Price.Shop Money",
                      "required": [
                        "amount",
                        "currencyCode"
                      ],
                      "properties": {
                        "amount": {
                          "type": "string",
                          "title": "Price.Shop Money.Amount",
                          "example": "885.95"
                        },
                        "currencyCode": {
                          "type": "string",
                          "title": "Price.Shop Money.Currency Code",
                          "example": "USD"
                        }
                      }
                    }
                  }
                },
                "subtotalSet": {
                  "type": "object",
                  "title": "Subtotal",
                  "required": [
                    "shopMoney"
                  ],
                  "properties": {
                    "shopMoney": {
                      "type": "object",
                      "title": "Subtotal.Shop Money",
                      "required": [
                        "amount",
                        "currencyCode"
                      ],
                      "properties": {
                        "amount": {
                          "type": "string",
                          "title": "Subtotal.Shop Money.Amount",
                          "example": "881.08"
                        },
                        "currencyCode": {
                          "type": "string",
                          "title": "Subtotal.Shop Money.Currency Code",
                          "example": "USD"
                        }
                      }
                    }
                  }
                },
                "totalTaxSet": {
                  "type": "object",
                  "title": "Total Tax",
                  "required": [
                    "shopMoney"
                  ],
                  "properties": {
                    "shopMoney": {
                      "type": "object",
                      "title": "Total Tax.Shop Money",
                      "required": [
                        "amount",
                        "currencyCode"
                      ],
                      "properties": {
                        "amount": {
                          "type": "string",
                          "title": "Total Tax.Shop Money.Amount",
                          "example": "0.0"
                        },
                        "currencyCode": {
                          "type": "string",
                          "title": "Total Tax.Shop Money.Currency Code",
                          "example": "USD"
                        }
                      }
                    }
                  }
                },
                "lineItem": {
                  "type": "object",
                  "title": "Line Item",
                  "required": [
                    "id",
                    "name"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "title": "Line Item.ID",
                      "example": "gid://shopify/LineItem/46373199282257"
                    },
                    "name": {
                      "type": "string",
                      "title": "Line Item.Name",
                      "example": "The Minimal Snowboard"
                    },
                    "sku": {
                      "type": "string",
                      "title": "Line Item.SKU",
                      "example": "SB-MIN"
                    }
                  }
                }
              }
            },
            "example": [
              {
                "id": "gid://shopify/RefundLineItem/1202700058705",
                "quantity": 1,
                "restockType": "NO_RESTOCK",
                "restocked": false,
                "location": null,
                "priceSet": {
                  "shopMoney": {
                    "amount": "885.95",
                    "currencyCode": "USD"
                  }
                },
                "subtotalSet": {
                  "shopMoney": {
                    "amount": "881.08",
                    "currencyCode": "USD"
                  }
                },
                "totalTaxSet": {
                  "shopMoney": {
                    "amount": "0.0",
                    "currencyCode": "USD"
                  }
                },
                "lineItem": {
                  "id": "gid://shopify/LineItem/46373199282257",
                  "name": "The Minimal Snowboard",
                  "sku": null
                }
              }
            ]
          },
          "transactions": {
            "type": "array",
            "title": "Transactions",
            "items": {
              "type": "object",
              "required": [
                "id",
                "kind",
                "status",
                "test",
                "createdAt",
                "amountSet"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "title": "ID",
                  "example": "gid://shopify/OrderTransaction/9876543210"
                },
                "kind": {
                  "type": "string",
                  "title": "Kind",
                  "example": "SALE"
                },
                "status": {
                  "type": "string",
                  "title": "Status",
                  "example": "SUCCESS"
                },
                "gateway": {
                  "type": "string",
                  "title": "Gateway",
                  "example": "manual"
                },
                "test": {
                  "type": "boolean",
                  "title": "Test",
                  "example": false
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "title": "Created At",
                  "example": "2026-10-05T08:24:35Z"
                },
                "processedAt": {
                  "type": "string",
                  "format": "date-time",
                  "title": "Processed At",
                  "example": "2026-10-05T08:24:35Z"
                },
                "errorCode": {
                  "type": "string",
                  "title": "Error Code",
                  "example": "CARD_DECLINED"
                },
                "paymentId": {
                  "type": "string",
                  "title": "Payment ID",
                  "example": "c123.1"
                },
                "amountSet": {
                  "type": "object",
                  "title": "Amount",
                  "required": [
                    "shopMoney"
                  ],
                  "properties": {
                    "shopMoney": {
                      "type": "object",
                      "title": "Amount.Shop Money",
                      "required": [
                        "amount",
                        "currencyCode"
                      ],
                      "properties": {
                        "amount": {
                          "type": "string",
                          "title": "Amount.Shop Money.Amount",
                          "example": "25.0"
                        },
                        "currencyCode": {
                          "type": "string",
                          "title": "Amount.Shop Money.Currency Code",
                          "example": "USD"
                        }
                      }
                    }
                  }
                },
                "parentTransaction": {
                  "type": "object",
                  "title": "Parent Transaction",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "title": "Parent Transaction.ID",
                      "example": "gid://shopify/OrderTransaction/9876543200"
                    }
                  }
                }
              }
            },
            "example": [
              {
                "id": "gid://shopify/OrderTransaction/9876543210",
                "kind": "REFUND",
                "status": "SUCCESS",
                "gateway": "manual",
                "test": false,
                "createdAt": "2026-10-05T08:24:35Z",
                "processedAt": "2026-10-05T08:24:35Z",
                "errorCode": null,
                "paymentId": "c123.1",
                "amountSet": {
                  "shopMoney": {
                    "amount": "25.0",
                    "currencyCode": "USD"
                  }
                },
                "parentTransaction": null
              }
            ]
          },
          "orderAdjustments": {
            "type": "array",
            "title": "Order Adjustments",
            "items": {
              "type": "object",
              "required": [
                "id",
                "amountSet",
                "taxAmountSet"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "title": "ID",
                  "example": "gid://shopify/OrderAdjustment/671076450385"
                },
                "reason": {
                  "type": "string",
                  "title": "Reason",
                  "example": "REFUND_DISCREPANCY"
                },
                "amountSet": {
                  "type": "object",
                  "title": "Amount",
                  "required": [
                    "shopMoney"
                  ],
                  "properties": {
                    "shopMoney": {
                      "type": "object",
                      "title": "Amount.Shop Money",
                      "required": [
                        "amount",
                        "currencyCode"
                      ],
                      "properties": {
                        "amount": {
                          "type": "string",
                          "title": "Amount.Shop Money.Amount",
                          "example": "881.08"
                        },
                        "currencyCode": {
                          "type": "string",
                          "title": "Amount.Shop Money.Currency Code",
                          "example": "USD"
                        }
                      }
                    }
                  }
                },
                "taxAmountSet": {
                  "type": "object",
                  "title": "Tax Amount",
                  "required": [
                    "shopMoney"
                  ],
                  "properties": {
                    "shopMoney": {
                      "type": "object",
                      "title": "Tax Amount.Shop Money",
                      "required": [
                        "amount",
                        "currencyCode"
                      ],
                      "properties": {
                        "amount": {
                          "type": "string",
                          "title": "Tax Amount.Shop Money.Amount",
                          "example": "0.0"
                        },
                        "currencyCode": {
                          "type": "string",
                          "title": "Tax Amount.Shop Money.Currency Code",
                          "example": "USD"
                        }
                      }
                    }
                  }
                }
              }
            },
            "example": [
              {
                "id": "gid://shopify/OrderAdjustment/671076450385",
                "reason": "REFUND_DISCREPANCY",
                "amountSet": {
                  "shopMoney": {
                    "amount": "881.08",
                    "currencyCode": "USD"
                  }
                },
                "taxAmountSet": {
                  "shopMoney": {
                    "amount": "0.0",
                    "currencyCode": "USD"
                  }
                }
              }
            ]
          },
          "order": {
            "type": "object",
            "title": "Order",
            "required": [
              "id",
              "legacyResourceId",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "title": "Order.ID",
                "example": "gid://shopify/Order/17292422217809"
              },
              "legacyResourceId": {
                "type": "string",
                "title": "Order.Legacy Resource ID",
                "example": "17292422217809"
              },
              "name": {
                "type": "string",
                "title": "Order.Name",
                "example": "#1026"
              }
            }
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
