
Shopify Admin Refund And Reorder
- 7 installs
- 173 repo stars
- Updated June 26, 2026
- 40rty-ai/shopify-admin-skills
shopify-admin-refund-and-reorder is a Claude Code skill that processes a full or partial refund on a Shopify order and optionally creates a replacement draft order using the Shopify Admin GraphQL API.
About
This skill processes a full or partial refund on a Shopify order and optionally creates a replacement draft order for the customer, all without opening the admin UI. Support staff use it to handle a refund and its replacement in a single workflow. It runs against the Shopify Admin GraphQL API, verifies each line item's refundable quantity first, and can preview with a dry run before executing the irreversible refund.
- Processes a full or partial refund on a Shopify order and optionally creates a replacement draft order in one workflow
- Uses Shopify Admin GraphQL order query plus refundCreate and draftOrderCreate mutations
- Guards irreversible financial mutations with a dry_run preview and refundableQuantity checks
Shopify Admin Refund And Reorder by the numbers
- 7 all-time installs (skills.sh)
- Ranked #1,587 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
shopify-admin-refund-and-reorder capabilities & compatibility
Free; requires an authenticated Shopify store session with read_orders and write_orders scopes
- Capabilities
- refund processing · draft order creation · order management
- Works with
- github
- Use cases
- database
- Pricing
- Free
What shopify-admin-refund-and-reorder says it does
Process a full or partial refund on an order and optionally create a replacement draft order for the customer.
`refundCreate` cannot be undone — once a refund is processed, the payment cannot be re-captured.
npx skills add https://github.com/40rty-ai/shopify-admin-skills --skill shopify-admin-refund-and-reorderAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 7 |
|---|---|
| repo stars | ★ 173 |
| Last updated | June 26, 2026 |
| Repository | 40rty-ai/shopify-admin-skills ↗ |
What it does
Refund a Shopify order (full or partial) and optionally create a replacement draft order for the customer in one workflow.
Who is it for?
Support agents processing a refund and its replacement order in one step without the admin UI
When should I use this skill?
You need to refund a Shopify order and optionally send the customer a replacement order
What you get
The order is refunded and, if requested, a replacement draft order is created with an invoice URL.
- Refund record and optional replacement draft order with invoice URL
By the numbers
- 3 workflow steps
- 3 GraphQL operations (order query, refundCreate, draftOrderCreate)
- 5 refund reason options
Files
Purpose
Processes refunds and creates replacement orders without navigating the Shopify admin UI. This skill handles both the refund and the optional replacement draft order in a single workflow.
Prerequisites
- Authenticated Shopify CLI session:
shopify auth login --store <domain> - API scopes:
read_orders,write_orders
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| format | string | no | human | Output format: human or json |
| dry_run | bool | no | false | Preview operations without executing mutations |
| order_id | string | yes | — | GID of the order (e.g., gid://shopify/Order/12345) |
| refund_line_items | array | no | all refundable | Array of {line_item_id, quantity} to refund; if omitted, refunds all refundable quantities |
| reason | string | no | other | Refund reason: customer, fraud, inventory, declined, other |
| create_replacement | bool | no | false | If true, create a draft order with the same line items after refund |
| notify_customer | bool | no | true | Send refund notification email to customer |
Safety
⚠️ Steps 2 and 3 execute irreversible financial mutations.refundCreatecannot be undone — once a refund is processed, the payment cannot be re-captured.draftOrderCreatecreates a new draft order that must be invoiced and paid separately. Run withdry_run: trueto verify the refund line items and amounts before committing. VerifyrefundableQuantityper line item from Step 1 before proceeding.
Workflow Steps
1. OPERATION: order — query Inputs: id: <order_id> Expected output: Full order with displayFinancialStatus, lineItems (with refundableQuantity), transactions, customer, shippingAddress; verify order is refundable before proceeding
2. OPERATION: refundCreate — mutation Inputs: input.orderId, input.refundLineItems (from parameter or all refundable), input.notify, input.note: <reason> Expected output: refund.id, refund.totalRefundedSet, userErrors
3. OPERATION: draftOrderCreate — mutation (only if create_replacement: true) Inputs: input.lineItems (from original order line items), input.customerId, input.shippingAddress, input.note: "Replacement for order <name>" Expected output: draftOrder.id, draftOrder.name, draftOrder.invoiceUrl, userErrors
GraphQL Operations
# order:query — validated against api_version 2025-01
query OrderForRefund($id: ID!) {
order(id: $id) {
id
name
displayFinancialStatus
displayFulfillmentStatus
totalPriceSet {
shopMoney { amount currencyCode }
}
lineItems(first: 50) {
edges {
node {
id
title
quantity
refundableQuantity
variant {
id
sku
price
}
}
}
}
transactions(first: 10) {
id
kind
status
amountSet {
shopMoney { amount currencyCode }
}
gateway
}
refunds {
id
createdAt
totalRefundedSet {
shopMoney { amount currencyCode }
}
}
customer {
id
defaultEmailAddress {
emailAddress
}
firstName
lastName
}
shippingAddress {
address1
city
province
country
zip
}
}
}# refundCreate:mutation — validated against api_version 2025-01
mutation RefundCreate($input: RefundInput!) {
refundCreate(input: $input) {
refund {
id
createdAt
totalRefundedSet {
shopMoney { amount currencyCode }
}
}
userErrors {
field
message
}
}
}# draftOrderCreate:mutation — validated against api_version 2025-01
mutation DraftOrderCreate($input: DraftOrderInput!) {
draftOrderCreate(input: $input) {
draftOrder {
id
name
invoiceUrl
}
userErrors {
field
message
}
}
}Session Tracking
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: refund-and-reorder ║
║ Store: <store domain> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝After each step, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>If dry_run: true, prefix every mutation step with [DRY RUN] and do not execute it.
On completion, emit:
For format: human (default):
══════════════════════════════════════════════
OUTCOME SUMMARY
Order: <name>
Refund ID: <id>
Amount refunded: <amount> <currency>
Replacement draft: <draft order name or "none">
Errors: 0
Output: none
══════════════════════════════════════════════For format: json, emit:
{
"skill": "refund-and-reorder",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": false,
"steps": [
{ "step": 1, "operation": "OrderForRefund", "type": "query", "params_summary": "order <id>", "result_summary": "<status>", "skipped": false },
{ "step": 2, "operation": "RefundCreate", "type": "mutation", "params_summary": "<n> line items, reason: <reason>", "result_summary": "refund <id>", "skipped": false },
{ "step": 3, "operation": "DraftOrderCreate", "type": "mutation", "params_summary": "<n> line items, customer <id>", "result_summary": "draft <name>", "skipped": false }
],
"outcome": {
"order_name": "<name>",
"refund_id": "<id>",
"amount_refunded": "<amount>",
"currency": "<currency>",
"draft_order_name": "<name or null>",
"draft_order_invoice_url": "<url or null>",
"errors": 0,
"output_file": null
}
}Output Format
No CSV output. The session completion summary reports the refund ID and amount. If create_replacement: true, the draft order name and invoice URL are included in the output.
Error Handling
| Error | Cause | Recovery |
|---|---|---|
refundableQuantity is 0 | Line item already fully refunded | Check order refund history |
userErrors from refundCreate | Invalid refund amounts or order not refundable | Check displayFinancialStatus — must not be REFUNDED |
userErrors from draftOrderCreate | Invalid line items or customer | Verify product variants still exist |
| Order not found | Invalid order GID | Use order-lookup-and-summary skill to find the correct order ID |
Best Practices
1. Always run dry_run: true first — Step 2 is irreversible. Verify refundableQuantity per line item in Step 1 output before committing. 2. For partial refunds, specify refund_line_items explicitly — omitting it refunds all refundable items, which may not be intended. 3. The create_replacement draft order is not automatically invoiced or fulfilled — share invoiceUrl with the customer for payment. 4. Use notify_customer: false for internal corrections where the customer should not be alerted. 5. Check displayFinancialStatus from Step 1 — if it is REFUNDED, there is nothing left to refund.
Related skills
FAQ
Is the refund reversible?
No; refundCreate is irreversible and the payment cannot be re-captured, so the skill can run with dry_run to verify line items and amounts first.
How is the replacement created?
If create_replacement is true it runs draftOrderCreate with the same line items, producing a draft order that must be invoiced and paid separately.