Orders
The owner MCP's tools for the store's orders.
| Tool | What it does | Gate | Permission |
|---|---|---|---|
list_orders | List orders | none | orders:read |
get_order | Get order | none | orders:read |
pick_list | Pick list | none | orders:read |
pickup_orders | Pickup orders | none | orders:read |
parcel_tracking | Parcel tracking | none | orders:read |
list_draft_orders | List draft orders | none | orders:read |
list_returns | List returns | none | orders:read |
explain_return | Explain return | none | orders:read |
list_invoices | List invoices | none | orders:read |
list_subscriptions | List subscriptions | none | orders:read |
list_emails | List emails | none | orders:read |
subscription_boxes | Subscription boxes | none | orders:read |
add_order_note | Add order note | none | orders:write |
mark_order_sent | Mark order sent | send | orders:write |
tag_orders | Tag orders | none | orders:write |
archive_orders | Archive orders | none | orders:write |
create_draft_order | Create draft order | none | orders:write |
send_draft_order | Send draft order | send | orders:write |
set_draft_prices | Set draft prices | none | orders:write |
decline_quote | Decline quote | send | orders:write |
refund_order | Refund order | spend | orders:write |
approve_return | Approve return | send | orders:write |
decline_return | Decline return | send | orders:write |
cancel_order | Cancel order | spend | orders:write |
tell_customer_about_order | Tell customer about order | send | orders:write |
carry_out_address_change | Carry out address change | send | orders:write |
resend_order_email | Resend order email | send | orders:write |
preview_order_change | Preview order change | none | orders:read |
change_order | Change order | spend | orders:write |
preview_exchange | Preview exchange | none | orders:read |
propose_exchange | Propose exchange | send | orders:write |
send_replacement | Send replacement | spend | orders:write |
process_exchange | Process exchange | spend | orders:write |
List orders
list_orders
The store's orders, newest first by default, as the Orders page lists them (D173): number, status, customer, total, items, tags and whether it is archived, a gift or staff-made. search takes up to five words that must all match the order number, the email or name, a product title or SKU, a tag or a tracking number. The filters are the page's own: show (to-send, waiting, unpaid, archived), pay, ship, status, tag, from/to or range, market, source, gift, archived (archived orders are left out unless asked for or searched for) and sort. count is how many orders match (capped; more_than_counted says so) and next opens the next page. Read-only: every figure is the page's own. To tag or archive, use tag_orders and archive_orders. A person whose data was erased is never named or found by name.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
which | one of all, to_send, unpaid | no, default "all" | |
search | string, at most 100 characters | no | One to five words: they must all match the order number, the email or name, a product title or SKU, a tag or a tracking number. |
show | one of to-send, waiting, unpaid, archived, to-hand-over, local | no | A built-in view: to-send, waiting (for stock), unpaid (unfinished checkouts) or archived. |
pay | list of one of paid, partially_refunded, refunded, balance_due, unpaid, disputed, elevated_risk, authorized, terms_due, terms_overdue, at most 10 items | no | Payment state: paid, partially_refunded, refunded, balance_due, unpaid, disputed (a dispute open or lost), elevated_risk (Stripe judged the payment elevated or highest risk), authorized (the card is held and waits to be captured), terms_due (an invoice on payment terms not yet due) or terms_overdue (past its due day). |
ship | list of one of to_send, sent, waiting, no_shipping, partly_sent, edit_pending, edit_refund_owed, preorder, pickup, local, delivery_mismatch, held, at most 12 items | no | Fulfilment: to_send, partly_sent, sent, waiting, no_shipping or edit_pending (a change waits for the customer's payment). |
status | list of one of paid, fulfilled, cancelled, closed, at most 4 items | no | The order's own status. |
tag | list of string, 1 to 120 characters, at most 10 items | no | Only orders with all of these tags. |
from | string, matching ^\d{4}-\d{2}-\d{2}$ | no | From this day, in the store's own days. |
to | string, matching ^\d{4}-\d{2}-\d{2}$ | no | Up to and including this day. |
range | one of 7d, 30d, 90d, this_month, last_month | no | Relative days: 7d, 30d, 90d, this_month or last_month (used when from and to are left out). |
market | string, 2 characters | no | A country code of the store's markets. |
source | one of checkout, draft, exchange, replacement, copied | no | checkout (a shopper's), draft (staff-made) or copied (history from another store). |
gift | boolean | no | True: gift orders only. |
archived | one of no, yes, all | no | no (the default), yes (only archived) or all. |
sort | one of placed_desc, placed_asc, total_desc, total_asc | no | |
after | string, at most 512 characters | no | The next value of the previous answer, for the next page. |
limit | integer, 1 to 50 | no, default 10 | How many at most (1–50). |
Get order
get_order
One order in full: its lines, totals, payment, what is left to refund, shipments, bookings and history, its tags, whether it is archived or staff-made (made from a draft order), whether it is an exchange (D239: the replacement goods of a return, with the return's and the original order's numbers) and whether it was paid outside Kaizena Flow and how. A gift order is said to be a gift; its message is the customer's own words to a third party and is not given here. Since wave 3 (D174) it also says where the sending stands (not sent, partly sent, sent, withdrawn before sending), what each parcel held, the units still to send per line, and the order's changes after purchase (E1, E2, …: when, the difference in the total, and whether applied, waiting for the customer's payment, cancelled or expired). Read-only: changing an order, sending part of it and recording a change's payment are done on the order's page.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
Pick list
pick_list
The pick list (D174): what to take off the shelves for some orders, worked out by the store from what each still has to send (downloads, services, units already in parcels and units withdrawn before sending are left out). Name the orders by number (up to 100), or leave them out for every paid order with something still to send, oldest first (at most 100). by product sums the units per variant and SKU with how many orders need it; by order lists each order's lines. Orders that cannot be picked are listed with the reason, and an order whose change waits for the customer's payment is picked as it stands, with a warning. No prices, names or addresses. Read-only: it changes nothing and marks nothing sent; give the printable list's address it returns. Repeat its sums; never add units yourself.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
orders | list of string, 1 to 64 characters, 1 to 100 items | no | Order numbers (or ids). Leave out for everything still to send. |
by | one of product, order | no, default "product" | Sum by product (variant and SKU), or list order by order. |
sort | one of sku, title, quantity | no, default "sku" | The order of the rows. |
Pickup orders
pickup_orders
Paid orders the store hands over itself (D237), as the Orders page's views To hand over and Local deliveries list them: orders to be collected at a pickup place (and how many were marked ready) and orders for the store's own local delivery not delivered yet (and how many are out for delivery), grouped by place or area, with their numbers and the oldest one's date. Counts and order numbers only, never a name or an address: get_order gives one order. Read-only: Ready for pickup, Collected and Out for delivery are pressed on the order's page (or Ready for pickup in bulk on the Orders page), never here; these orders are not sent with mark_order_sent.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
kind | one of all, pickup, local | no, default "all" | Pickup orders, local deliveries, or both. |
Parcel tracking
parcel_tracking
Where an order's parcels are (D238), from the carrier events Kaizena Flow stored when it last checked (every few minutes; nothing is asked of the carrier here): each parcel's carrier and tracking number, its phase (on its way, out for delivery, ready to collect, delivered, …), its newest events with times and places, when it was last checked and whether that failed, and why it is no longer followed. PostNord's, Helthjem's and Porterbuddy's codes are not verified yet: their events are listed, but Kaizena Flow records no delivery and sends no email from them, and the answer says so. It also says whether the order's delivery is recorded and by whom (staff, the handover, or the carrier). Read-only: Check now is on the order's page.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
List draft orders
list_draft_orders
The store's draft orders (D173): orders staff write for a customer and send as a pay link, and shoppers' requests for a quote (D431), which arrive as drafts marked quote. Each has its number, status (open, sent and waiting for payment, paid, expired, cancelled), the customer's email, the total as the store prices it, its order number once sent and when the link ends; the answer counts the requests for a quote waiting for the store. status narrows them, quotes keeps only requests. Read-only. A draft is made with create_draft_order, its prices typed with set_draft_prices, and sent with send_draft_order (the owner's yes first; a request goes out as a quote); a request is declined with decline_quote. The shopper's note is read on the draft's page, never here; taking money outside Kaizena Flow and deleting a draft are done on the draft's page.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
status | one of open, sent, paid, expired, cancelled, all | no, default "all" | open (being written), sent (waiting for payment), paid, expired, cancelled or all. |
quotes | boolean | no, default false | Only shoppers' requests for a quote (D431). |
limit | integer, 1 to 50 | no, default 15 | How many at most (1–50). |
List returns
list_returns
The store's returns (D153), oldest first: customers' withdrawals from a purchase (their legal right to change their mind, which the store cannot refuse) and return requests inside the store's own longer window. Each has its number, kind, status, order, customer, units, when its refund is due and whether it is past the legal deadline; the answer also counts what waits: open, to answer, past the deadline, and acknowledgements not sent. which is open (the default), requested (waiting for an answer), overdue (past the refund deadline), or every status; search matches the return or order number, the name or the email. Each return also carries its exchange mark (the customer would like an exchange, proposed, confirmed, waiting for the difference) and whether an automatic return label could not be booked (D239). Read-only: the figures are the queue's own, never worked out by you.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
which | one of open, requested, overdue, approved, in_transit, received, inspected, closed, declined, cancelled, all | no, default "open" | |
kind | one of all, withdrawal, return | no, default "all" | A withdrawal (the legal right) or a return request (the store's own window). |
search | string, at most 100 characters | no | |
limit | integer, 1 to 50 | no, default 15 | How many at most (1–50). |
Explain return
explain_return
One return in full, in words from the store's own data: what the customer asked for and why, each line with its decision and condition, where the return stands and what comes next, when the refund is due and whether it is overdue, what the refund would be now (worked out by the store, with its working) or what was refunded, and its history; since D239 also the customer's exchange wish, the newest exchange (its state, the credit, the replacements' total and the difference, all worked out by the store) and the return label (booked with which carrier, tracking, its cost and who pays for return shipping). It also says what can be done and where: approving or declining a return request can be done here (kept for the owner's approval); refunding and the other steps are done on the return's page (exchanges and booking a label too), never here. Repeat what it says and add nothing it did not give.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
return | string, 1 to 64 characters | yes | The return's number, such as 1042-R1, or its id; an order number works when the order has one return. |
List invoices
list_invoices
The store's own invoices and credit notes (D159), read only: each one's number, the day it was issued, its order, the VAT treatment, net, VAT and total in the order's currency, and whether a PDF is stored; the totals per currency are worked out in code. which is invoices, credit_notes, or waiting: paid orders still waiting for an invoice and refunds without a credit note (what is missing, and the page that fixes it). Buyers' names, addresses and emails are never given (open the order in the admin for those). Invoices are made by the store on payment, and credit notes from a refund that succeeded: you cannot make, change or send one. This is not tax or accounting advice.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
which | one of invoices, credit_notes, waiting | no, default "invoices" | |
from | string, matching ^\d{4}-\d{2}-\d{2}$ | no | The first day issued, as 2026-10-01 (the store's own day). |
to | string, matching ^\d{4}-\d{2}-\d{2}$ | no | The last day issued, as 2026-10-31. |
search | string, at most 60 characters | no | A document number or an order number. |
limit | integer, 1 to 50 | no, default 20 | How many at most (1–50). |
List subscriptions
list_subscriptions
Shoppers' subscriptions: number, status, customer, what each renewal costs and when it renews.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
subscriptionsmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
limit | integer, 1 to 50 | no, default 20 | How many at most (1–50). |
List emails
list_emails
The latest emails the store sent shoppers: what, to whom, and whether they went out.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
shopmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
limit | integer, 1 to 50 | no, default 15 | How many at most (1–50). |
Subscription boxes
subscription_boxes
Subscription boxes: each delivery day, the round being packed with its orders, and the next cutoff.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readFeature:
boxesmust be on in the storeHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
Add order note
add_order_note
Adds a note to an order's history, for the store's staff only; the customer never sees it.
Gate: none: it runs when called
Permission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: none
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
note | string, 1 to 1,000 characters | yes |
Mark order sent
mark_order_sent
Marks a paid order as sent with the parcel's carrier and tracking number, and emails the customer. Everything the order still has to send goes in this one parcel (a partly sent order: the rest); sending only some items is done on the order's page. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
carrier | string, 1 to 40 characters | yes | The carrier, such as posten, bring, postnord, dhl, ups, other. |
tracking_number | string, at most 100 characters | no, default "" | |
notify | boolean | no, default true | Email the customer that it is on its way. |
Tag orders
tag_orders
Puts tags on orders, takes tags off, or both (D173): staff's own labels, such as vip or gift-wrap, that the Orders page filters by. Tags are internal (never shown to a customer), at most 40 characters, with no comma, 250 on an order, case-insensitive. Works on up to 25 orders by number or id, copied history included, and says which orders it did not apply to and why. Nothing is sent to anyone.
Gate: none: it runs when called
Permission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
orders | list of string, 1 to 64 characters, 1 to 25 items | yes | The orders, by number or id (at most 25). |
add | list of string, 1 to 120 characters, at most 10 items | no, default [] | Tags to put on them. |
remove | list of string, 1 to 120 characters, at most 10 items | no, default [] | Tags to take off them. |
Archive orders
archive_orders
Archives orders, or brings archived ones back (D173): an archived order leaves the default list and the queues but keeps its number, documents and every figure; nothing is deleted. Only an order that needs no more work can be archived (not one waiting to be sent, never paid, or with an open return); the answer says which were not and why. Up to 25 orders by number or id.
Gate: none: it runs when called
Permission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: destructive, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
orders | list of string, 1 to 64 characters, 1 to 25 items | yes | The orders, by number or id (at most 25). |
archived | boolean | no, default true | True archives them (they leave the default list and the queues); false brings archived orders back. |
Create draft order
create_draft_order
Writes a draft order for a customer (D173): the variants by SKU with quantities, the customer's email, the market (country, language and currency) and optionally a percent off with the name the customer sees. It makes a DRAFT only: nothing is sent, no number is used and no stock is held. The answer is the draft as the store prices it (prices, VAT, shipping and total in the market's currency, worked out by the store, never by you) and any problem that would stop it being sent. Custom prices, custom items, addresses and notes are added on the draft's page. To send it use send_draft_order.
Gate: none: it runs when called
Permission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: none
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
email | string (email), at most 254 characters | yes | The customer's email: the pay link goes there only when the owner sends the draft. |
lines | list of objects, 1 to 100 items | yes | |
lines[].sku | string, 1 to 100 characters | yes | The variant's SKU, as list_products or get_product give it. |
lines[].quantity | integer, 1 to 9,999 | yes | |
market | string, matching ^[a-z]{2}(?:-[a-z]{2,3}){0,2}$ | no | The market's address, such as no or no-en-eur; the store's first market when left out. Prices, VAT and shipping are the market's. |
discount_percent | string, 1 to 12 characters | no | A percent off the goods the owner asked for, as they wrote it (10 or 7,5). Needs discount_label. |
discount_label | string, 1 to 60 characters | no | What the customer sees the discount called on the pay page and the invoice, such as Loyal customer. |
Send draft order
send_draft_order
Sends a draft order to its customer (D173): the order is made now with the next order number, its goods are held until the pay link ends (1 to 30 days), and the customer is emailed a link to pay on the store's own page. The store checks it can be sent (an email, goods that are for sale and in stock, payments on, an open store) and refuses with the reason. Needs the owner's approval. You cannot record a payment, take money outside Kaizena Flow or delete a draft. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
draft | string, 1 to 64 characters | yes | The draft order's number, such as D-12, or its id. |
valid_days | integer, 1 to 30 | no | How many days the pay link works (1–30); the store's own default when left out. |
approved_version | integer, at least 1 | no | Never set this: the store writes it when the owner is asked, so what is sent is the draft as the owner was shown it. |
Set draft prices
set_draft_prices
Types the price for one of an open draft's lines (by SKU), most often a shopper's request for a quote waiting for its prices: a product priced on request arrives without one, and the draft cannot be sent until it has one. The price is for one, VAT included, in the draft's currency, as the owner gave it; "" takes the typed price away again. Only the lines given change, saved as the draft's page saves them, and nothing is sent. The answer is the draft as the store prices it now (totals worked out by the store, never by you) and what still stops it being sent. Never make up a price: ask the owner.
Gate: none: it runs when called
Permission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
draft | string, 1 to 64 characters | yes | The draft order's number, such as D-12, or its id. |
lines | list of objects, 1 to 50 items | yes | |
lines[].sku | string, 1 to 100 characters | yes | The line's SKU, as list_draft_orders' draft shows it (every line with it is priced). |
lines[].price | string, at most 30 characters | yes | The price for one, VAT included, in the draft's currency, as the owner gave it (450 or 449,50); "" takes the typed price away (the list price again, or waiting for a price if the product is priced on request). |
Decline quote
decline_quote
Declines a shopper's request for a quote (a draft marked quote in list_draft_orders) with a short reply the customer is emailed in the store's name, in the owner's words and the customer's language: why there is no quote, and what they could do instead. The request is then never sent and goes 30 days later. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: destructive, open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
draft | string, 1 to 64 characters | yes | The draft order's number, such as D-12, or its id. |
reply | string, 1 to 1,000 characters | yes | The short reply the customer is emailed, in the owner's words and the customer's language (why no quote, what they could do instead). |
Refund order
refund_order
Refunds all or part of a paid order through Stripe, optionally putting its items back in stock, and emails the customer. Needs the owner's approval. An order paid outside Kaizena Flow (cash or bank transfer, on a draft order) is refused: nothing can be sent from here, so its refund is recorded on its own page by someone who has paid the customer back. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
spend: Costs moneyPermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: destructive, open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
amount | string, at most 30 characters | no | How much to refund, as the owner writes it (such as 199 or 199,50); the whole refundable amount if left out. |
reason | string, 1 to 500 characters | no, default "Asked for by the owner." | Why, for the order's history; leave it out when the owner gave no reason. |
restock | boolean | no, default true | Put the order's items back in stock. |
notify | boolean | no, default true | Email the customer about the refund. |
Approve return
approve_return
Approves a return request (a return inside the store's own window that waits for an answer) and emails the customer how to send the goods back. It cannot be used on a withdrawal: that is the customer's legal right and starts approved. Receiving, inspecting and refunding are done on the return's page, never here. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
return | string, 1 to 64 characters | yes | The return's number, such as 1042-R1, or its id; an order number works when the order has one return. |
instructions | string, 1 to 2,000 characters | no | What the customer should do to send it back, if it differs from the store's standing instructions; the store's own are used when left out. |
note | string, 1 to 1,000 characters | no | A note kept with the approval. |
Decline return
decline_return
Declines a return request (a return inside the store's own window that waits for an answer) and emails the customer the reason. It can never be used on a withdrawal: the right of withdrawal is not the store's to refuse. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: destructive, open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
return | string, 1 to 64 characters | yes | The return's number, such as 1042-R1, or its id; an order number works when the order has one return. |
reason | string, 1 to 1,000 characters | yes | Why the return is declined, in plain words the customer is sent. |
Cancel order
cancel_order
Cancels a paid order that is not sent yet (docs/100-day-challenge.md C6), as the order's page does: what was paid is refunded through Stripe in the same step, every item goes back in stock and download links stop. An order already sent, partly sent, unpaid or with a change waiting for the customer's payment is refused: refund_order is for what was sent. Needs the owner's approval, always: it gives money back. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
spend: Costs moneyPermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: destructive, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
reason | string, 1 to 500 characters | no, default "Cancelled by the store." | Why, for the order's history; leave it out when the owner gave no reason. |
notify | boolean | no, default true | Email the customer that the order is cancelled and refunded. |
Tell customer about order
tell_customer_about_order
Tells an order's customer how it stands, in the store's own fixed words and their language (you write nothing): delayed (taking longer than planned; they will hear when it is on its way), parcel_attempted (the carrier could not deliver; how to choose a new time or a pickup point), parcel_problem (the carrier reports a problem; the store is looking into it) or parcel_returning (on its way back; the store will be in touch). Sent only when the store's records say so (a paid order with goods still to send and not held; a parcel whose tracking is in that state), and each once per order. It promises no date, refund or amount. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
about | one of delayed, parcel_attempted, parcel_problem, parcel_returning | yes |
Carry out address change
carry_out_address_change
Carries out a customer's support request to change an order's delivery address: the new address is the one the customer gave in the request, unchanged (you write none). Done only when the person asking is the order's own customer, signed in on the store's chat (never a visitor who typed an order number, never an email), and nothing of the order is sent or held; otherwise it is refused and a person answers the request. The request is then marked done and the customer told. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
request | string (uuid) | yes | The support request's id, from the staff_request event. |
Resend order email
resend_order_email
Sends a customer their order confirmation, or the latest shipping notice with its tracking, again. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeFeature:
shopmust be on in the storeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
which | one of confirmation, shipped | no, default "confirmation" |
Preview order change
preview_order_change
Shows what a change to a paid order would do, without making it: lines lowered or taken off, goods added at their list price, a new shipping price; the money that would move (a refund, or a payment the customer is asked for), the documents, stock, and anything that stops it. Read-only.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
change | list of objects, at most 50 items | no, default [] | |
change[].item | string, 1 to 200 characters | yes | A line of the order by its SKU or title. |
change[].quantity | integer, 0 to 9,999 | yes | Its new quantity: lower than now, 0 to take it off. |
add | list of objects, at most 50 items | no, default [] | |
add[].sku | string, 1 to 100 characters | yes | The SKU of goods to add, at their list price. |
add[].quantity | integer, 1 to 9,999 | yes | |
shipping | string, 1 to 30 characters | no | A new shipping price, VAT included, in the order's currency; leave out to keep it. |
reason | one of customer_request, out_of_stock, store_error, other | yes | Why: the customer asked, out of stock, the store's error, or other. |
note | string, at most 500 characters | no | A note for the order's history; the customer never sees it. |
notify | boolean | no, default true | Email the customer about the change (always, when it asks for money or takes units off). |
restock | boolean | no, default true | Put units taken off back in stock. |
approved_base | any | no | Never set this: the store writes it when the owner is asked, so the change is made to the order as the owner was shown it. |
Change order
change_order
Changes a paid order as the order editor does: a lower or equal total is made at once and the difference refunded; a higher total is emailed to the customer as a link to pay, and the order changes when they pay. Sold units keep their price. Needs the owner's approval of the change as previewed; refused if the order moved since. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
spend: Costs moneyPermission:
orders:writeScope:
orders:writeHints: destructive, open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
change | list of objects, at most 50 items | no, default [] | |
change[].item | string, 1 to 200 characters | yes | A line of the order by its SKU or title. |
change[].quantity | integer, 0 to 9,999 | yes | Its new quantity: lower than now, 0 to take it off. |
add | list of objects, at most 50 items | no, default [] | |
add[].sku | string, 1 to 100 characters | yes | The SKU of goods to add, at their list price. |
add[].quantity | integer, 1 to 9,999 | yes | |
shipping | string, 1 to 30 characters | no | A new shipping price, VAT included, in the order's currency; leave out to keep it. |
reason | one of customer_request, out_of_stock, store_error, other | yes | Why: the customer asked, out of stock, the store's error, or other. |
note | string, at most 500 characters | no | A note for the order's history; the customer never sees it. |
notify | boolean | no, default true | Email the customer about the change (always, when it asks for money or takes units off). |
restock | boolean | no, default true | Put units taken off back in stock. |
approved_base | any | no | Never set this: the store writes it when the owner is asked, so the change is made to the order as the owner was shown it. |
Preview exchange
preview_exchange
Shows an exchange for a return without sending it: the return's credit, the replacements at their list price, the total, and whether the customer gets money back or pays more. Read-only.
Gate: none: it runs when called
Permission:
orders:readScope:
orders:readHints: read-only, idempotent
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
return | string, 1 to 64 characters | yes | The return's number, such as 1042-R1, or its id; an order number works when the order has one return. |
replacements | list of objects, 1 to 20 items | yes | |
replacements[].sku | string, 1 to 100 characters | yes | The SKU of a replacement. |
replacements[].quantity | integer, 1 to 99 | yes | |
shipping | one of free, standard | no, default "free" | Free shipping of the replacements, or the market's standard rate. |
Propose exchange
propose_exchange
Emails the customer of a return an exchange for its credit: replacements at their list price, sent to the order's delivery address. The customer confirms it on their own page; nothing is made until process_exchange. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
send: Sends something in the store's namePermission:
orders:writeScope:
orders:writeHints: open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
return | string, 1 to 64 characters | yes | The return's number, such as 1042-R1, or its id; an order number works when the order has one return. |
replacements | list of objects, 1 to 20 items | yes | |
replacements[].sku | string, 1 to 100 characters | yes | The SKU of a replacement. |
replacements[].quantity | integer, 1 to 99 | yes | |
shipping | one of free, standard | no, default "free" | Free shipping of the replacements, or the market's standard rate. |
Send replacement
send_replacement
Sends the goods of an order's parcel again for nothing when its tracking says the parcel is lost or on its way back (B3): a new order at 0 of the same goods to the same address, with no invoice and no VAT, at most once per order. The stock is drawn; the goods' cost counts as a cost. Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
spend: Costs moneyPermission:
orders:writeScope:
orders:writeHints: destructive, open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
order | string, 1 to 64 characters | yes | The order's number, such as 1042, or its id. |
Process exchange
process_exchange
Processes an exchange the customer confirmed: makes the new order and moves the money (the credit pays, any rest is refunded, or the customer is emailed a link to pay the difference). Needs the owner's approval. It is not done from here: it is kept for the owner to approve in Kaizena Flow's admin.
Gate:
spend: Costs moneyPermission:
orders:writeScope:
orders:writeHints: destructive, open world
Inputs
| Field | Type | Required | Description |
|---|---|---|---|
store | string | yes | The store, by its slug from list_stores. |
return | string, 1 to 64 characters | yes | The return's number, such as 1042-R1, or its id; an order number works when the order has one return. |