/
/
Book every Shopify refund in Rillet, once
For finance teams who want Shopify refunds booked as Rillet credit memos and applied to the right invoice, by asking their AI assistant.
On this page
Connector
Connect Shopify, pick your AI tool and paste the prompt.
The problem
Every Shopify refund needs several lookups before it is booked
Each Shopify refund should become a Rillet credit memo applied to the order's invoice. Finding the refunded amount, the invoice and whether a memo already exists takes several lookups per refund, and booking one twice understates receivables.
Without PopdockAI
- Open each Shopify refund and its transactions
- Search Rillet for the order's invoice
- Check whether a credit memo already exists
- Book a refund twice or before the money went back
With PopdockAI
- Shopify refunds are read with their successful transactions and lines
- Each is matched to the order's Rillet invoice
- Refunds that already have a memo are skipped and pending ones listed
- One memo per refund is created and applied after you confirm
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** For each Shopify refund created from `{from-date}` to `{to-date}` (default: the last 7 days), create a Rillet credit memo against the Rillet product `{rillet-product-name}` and apply it to the order's Rillet invoice, after the user confirms.
**Step 1: Read the Shopify refunds**
Call `shopify-get-refund` with created-at.from and created-at.to set to the range. Note refund-id, order-id, order-name, created-at and note.
For the refunded amount, call `shopify-get-transaction` filtered by order-id and keep transactions whose kind is a refund and whose status is success. Match each to its refund by processed-at. For detail, call `shopify-get-refund-line` filtered by order-refund-id and note name, quantity, subtotal and total-tax.
**Step 2: Find the Rillet invoice and any existing memo**
Call `rillet-get-invoices` (no filters) and find the invoice whose invoice-number equals the order name, compared with and without the leading #. Then call `rillet-get-credit-memos` filtered by invoice-id. If a memo already has credit-memo-number equal to R- followed by the refund-id, the refund is already booked. Skip it.
**Step 3: Resolve the product**
Call `rillet-get-products` and find the product whose name equals `{rillet-product-name}`. If none or more than one matches, list the candidates and stop.
**Step 4: Confirm**
Show a table: order name, refund-id, refund date, refunded amount, currency, invoice-number, invoice amount-due, and the lines refunded. List separately the refunds with no Rillet invoice, and those already booked. Ask the user to confirm. Create nothing until they do.
**Step 5: Create and apply**
For each confirmed refund:
1. Call `rillet-add-credit-memo` once with customer-id (from the invoice), credit-memo-date (the refund date), credit-memo-number R- followed by the refund-id, line1-product-id, line1-quantity 1, line1-unit-amount the refunded amount, line1-currency, and line1-description Shopify refund followed by the order name.
2. Call `rillet-apply-credit-memo` once with id (the new memo id), line1-invoice-id, line1-amount (the refunded amount, capped at the invoice total), line1-currency and line1-date.
**Step 6: Report**
Memos created and applied with their ids, any step that failed with the error as returned, and the skipped refunds. Note that each memo carries the gross refunded amount, tax included, on one line.
**Rules & Guidelines:**
* `shopify-get-refund`, `shopify-get-transaction` and `shopify-get-refund-line` are on the shopify server. `rillet-get-invoices`, `rillet-get-credit-memos`, `rillet-get-products`, `rillet-add-credit-memo` and `rillet-apply-credit-memo` are on the rillet server.
* The only write tools this prompt may call are `rillet-add-credit-memo` and `rillet-apply-credit-memo`, once each per confirmed refund. Apply only a memo this prompt just created: `rillet-apply-credit-memo` replaces a memo's existing applications.
* Do not call `rillet-update-credit-memo`, `rillet-unapply-credit-memo`, `rillet-update-invoice` or any shopify write tool.
**Validation:**
* If there are no refunds in the range, say so and stop.
* If a refund has no successful refund transaction, the money has not gone back yet. List it as pending and do not book it.
* If the credit memo is created but applying it fails, report the memo id as created but unapplied. Do not create a second memo.
* If the user does not confirm, create nothing.Who it's for
One answer, three teams that use it
Accounts receivable
Book the week's refunds in one go
Turn a stack of refund lookups into one reviewed list, with memos created and applied for you.
Create Rillet credit memos for Shopify refunds from 1 to 7 November using the Online Sales product.
Controllers
Keep receivables accurate after returns
Refunds with an existing memo are skipped, so a rerun never understates what customers owe.
Which Shopify refunds this month are not booked in Rillet yet? Book them once I have looked.
Ecommerce accountants
Only book money that has gone back
Refunds whose money has not been returned yet are listed as pending, so the books match what actually left the bank.
Book last week's Shopify refunds in Rillet and tell me which ones are still pending.
How it works
What PopdockAI does when you ask
You choose a date range and a product, and your AI assistant matches each Shopify refund to its Rillet invoice. Nothing is booked until you have seen the refunds and said yes.
01
Ask
You choose a date range, the last 7 days by default, and a Rillet product.
02
Match
It reads Shopify refunds and finds each order's Rillet invoice and any existing memo.
03
Confirm
You see the refunds to book and those still pending, and say yes.
04
Book
It creates one memo per refund and applies it to the invoice.
What PopdockAI provides
The tools behind the answer
Ready made tools for Shopify and one secure connection to your AI tool. No code, no exports.
shopify-get-refund
shopify-get-transaction
shopify-get-refund-line
rillet-get-invoices
rillet-get-credit-memos
rillet-get-products
rillet-add-credit-memo
rillet-apply-credit-memo
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
Each refund booked once, against the right invoice
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
