Skip to content
Kaizena FlowDocs
Search

Search the docs

Orders

The owner MCP's tools for the store's orders.

ToolWhat it doesGatePermission
list_ordersList ordersnoneorders:read
get_orderGet ordernoneorders:read
pick_listPick listnoneorders:read
pickup_ordersPickup ordersnoneorders:read
parcel_trackingParcel trackingnoneorders:read
list_draft_ordersList draft ordersnoneorders:read
list_returnsList returnsnoneorders:read
explain_returnExplain returnnoneorders:read
list_invoicesList invoicesnoneorders:read
list_subscriptionsList subscriptionsnoneorders:read
list_emailsList emailsnoneorders:read
subscription_boxesSubscription boxesnoneorders:read
add_order_noteAdd order notenoneorders:write
mark_order_sentMark order sentsendorders:write
tag_ordersTag ordersnoneorders:write
archive_ordersArchive ordersnoneorders:write
create_draft_orderCreate draft ordernoneorders:write
send_draft_orderSend draft ordersendorders:write
set_draft_pricesSet draft pricesnoneorders:write
decline_quoteDecline quotesendorders:write
refund_orderRefund orderspendorders:write
approve_returnApprove returnsendorders:write
decline_returnDecline returnsendorders:write
cancel_orderCancel orderspendorders:write
tell_customer_about_orderTell customer about ordersendorders:write
carry_out_address_changeCarry out address changesendorders:write
resend_order_emailResend order emailsendorders:write
preview_order_changePreview order changenoneorders:read
change_orderChange orderspendorders:write
preview_exchangePreview exchangenoneorders:read
propose_exchangePropose exchangesendorders:write
send_replacementSend replacementspendorders:write
process_exchangeProcess exchangespendorders: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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
whichone of all, to_send, unpaidno, default "all"
searchstring, at most 100 charactersnoOne 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.
showone of to-send, waiting, unpaid, archived, to-hand-over, localnoA built-in view: to-send, waiting (for stock), unpaid (unfinished checkouts) or archived.
paylist of one of paid, partially_refunded, refunded, balance_due, unpaid, disputed, elevated_risk, authorized, terms_due, terms_overdue, at most 10 itemsnoPayment 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).
shiplist 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 itemsnoFulfilment: to_send, partly_sent, sent, waiting, no_shipping or edit_pending (a change waits for the customer's payment).
statuslist of one of paid, fulfilled, cancelled, closed, at most 4 itemsnoThe order's own status.
taglist of string, 1 to 120 characters, at most 10 itemsnoOnly orders with all of these tags.
fromstring, matching ^\d{4}-\d{2}-\d{2}$noFrom this day, in the store's own days.
tostring, matching ^\d{4}-\d{2}-\d{2}$noUp to and including this day.
rangeone of 7d, 30d, 90d, this_month, last_monthnoRelative days: 7d, 30d, 90d, this_month or last_month (used when from and to are left out).
marketstring, 2 charactersnoA country code of the store's markets.
sourceone of checkout, draft, exchange, replacement, copiednocheckout (a shopper's), draft (staff-made) or copied (history from another store).
giftbooleannoTrue: gift orders only.
archivedone of no, yes, allnono (the default), yes (only archived) or all.
sortone of placed_desc, placed_asc, total_desc, total_ascno
afterstring, at most 512 charactersnoThe next value of the previous answer, for the next page.
limitinteger, 1 to 50no, default 10How 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderslist of string, 1 to 64 characters, 1 to 100 itemsnoOrder numbers (or ids). Leave out for everything still to send.
byone of product, orderno, default "product"Sum by product (variant and SKU), or list order by order.
sortone of sku, title, quantityno, 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
kindone of all, pickup, localno, 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
statusone of open, sent, paid, expired, cancelled, allno, default "all"open (being written), sent (waiting for payment), paid, expired, cancelled or all.
quotesbooleanno, default falseOnly shoppers' requests for a quote (D431).
limitinteger, 1 to 50no, default 15How 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
whichone of open, requested, overdue, approved, in_transit, received, inspected, closed, declined, cancelled, allno, default "open"
kindone of all, withdrawal, returnno, default "all"A withdrawal (the legal right) or a return request (the store's own window).
searchstring, at most 100 charactersno
limitinteger, 1 to 50no, default 15How 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
returnstring, 1 to 64 charactersyesThe 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
whichone of invoices, credit_notes, waitingno, default "invoices"
fromstring, matching ^\d{4}-\d{2}-\d{2}$noThe first day issued, as 2026-10-01 (the store's own day).
tostring, matching ^\d{4}-\d{2}-\d{2}$noThe last day issued, as 2026-10-31.
searchstring, at most 60 charactersnoA document number or an order number.
limitinteger, 1 to 50no, default 20How 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:read

  • Scope: orders:read

  • Feature: subscriptions must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
limitinteger, 1 to 50no, default 20How 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:read

  • Scope: orders:read

  • Feature: shop must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
limitinteger, 1 to 50no, default 15How 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:read

  • Scope: orders:read

  • Feature: boxes must be on in the store

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe 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:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: none

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
notestring, 1 to 1,000 charactersyes

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 name

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
carrierstring, 1 to 40 charactersyesThe carrier, such as posten, bring, postnord, dhl, ups, other.
tracking_numberstring, at most 100 charactersno, default ""
notifybooleanno, default trueEmail 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:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderslist of string, 1 to 64 characters, 1 to 25 itemsyesThe orders, by number or id (at most 25).
addlist of string, 1 to 120 characters, at most 10 itemsno, default []Tags to put on them.
removelist of string, 1 to 120 characters, at most 10 itemsno, 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:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: destructive, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderslist of string, 1 to 64 characters, 1 to 25 itemsyesThe orders, by number or id (at most 25).
archivedbooleanno, default trueTrue 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:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: none

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
emailstring (email), at most 254 charactersyesThe customer's email: the pay link goes there only when the owner sends the draft.
lineslist of objects, 1 to 100 itemsyes
lines[].skustring, 1 to 100 charactersyesThe variant's SKU, as list_products or get_product give it.
lines[].quantityinteger, 1 to 9,999yes
marketstring, matching ^[a-z]{2}(?:-[a-z]{2,3}){0,2}$noThe 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_percentstring, 1 to 12 charactersnoA percent off the goods the owner asked for, as they wrote it (10 or 7,5). Needs discount_label.
discount_labelstring, 1 to 60 charactersnoWhat 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
draftstring, 1 to 64 charactersyesThe draft order's number, such as D-12, or its id.
valid_daysinteger, 1 to 30noHow many days the pay link works (1–30); the store's own default when left out.
approved_versioninteger, at least 1noNever 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:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
draftstring, 1 to 64 charactersyesThe draft order's number, such as D-12, or its id.
lineslist of objects, 1 to 50 itemsyes
lines[].skustring, 1 to 100 charactersyesThe line's SKU, as list_draft_orders' draft shows it (every line with it is priced).
lines[].pricestring, at most 30 charactersyesThe 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: destructive, open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
draftstring, 1 to 64 charactersyesThe draft order's number, such as D-12, or its id.
replystring, 1 to 1,000 charactersyesThe 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 money

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: destructive, open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
amountstring, at most 30 charactersnoHow much to refund, as the owner writes it (such as 199 or 199,50); the whole refundable amount if left out.
reasonstring, 1 to 500 charactersno, default "Asked for by the owner."Why, for the order's history; leave it out when the owner gave no reason.
restockbooleanno, default truePut the order's items back in stock.
notifybooleanno, default trueEmail 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
returnstring, 1 to 64 charactersyesThe return's number, such as 1042-R1, or its id; an order number works when the order has one return.
instructionsstring, 1 to 2,000 charactersnoWhat 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.
notestring, 1 to 1,000 charactersnoA 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: destructive, open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
returnstring, 1 to 64 charactersyesThe return's number, such as 1042-R1, or its id; an order number works when the order has one return.
reasonstring, 1 to 1,000 charactersyesWhy 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 money

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: destructive, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
reasonstring, 1 to 500 charactersno, default "Cancelled by the store."Why, for the order's history; leave it out when the owner gave no reason.
notifybooleanno, default trueEmail 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
aboutone of delayed, parcel_attempted, parcel_problem, parcel_returningyes

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 name

  • Permission: orders:write

  • Scope: orders:write

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
requeststring (uuid)yesThe 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Feature: shop must be on in the store

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
whichone of confirmation, shippedno, 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:read

  • Scope: orders:read

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
changelist of objects, at most 50 itemsno, default []
change[].itemstring, 1 to 200 charactersyesA line of the order by its SKU or title.
change[].quantityinteger, 0 to 9,999yesIts new quantity: lower than now, 0 to take it off.
addlist of objects, at most 50 itemsno, default []
add[].skustring, 1 to 100 charactersyesThe SKU of goods to add, at their list price.
add[].quantityinteger, 1 to 9,999yes
shippingstring, 1 to 30 charactersnoA new shipping price, VAT included, in the order's currency; leave out to keep it.
reasonone of customer_request, out_of_stock, store_error, otheryesWhy: the customer asked, out of stock, the store's error, or other.
notestring, at most 500 charactersnoA note for the order's history; the customer never sees it.
notifybooleanno, default trueEmail the customer about the change (always, when it asks for money or takes units off).
restockbooleanno, default truePut units taken off back in stock.
approved_baseanynoNever 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 money

  • Permission: orders:write

  • Scope: orders:write

  • Hints: destructive, open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe order's number, such as 1042, or its id.
changelist of objects, at most 50 itemsno, default []
change[].itemstring, 1 to 200 charactersyesA line of the order by its SKU or title.
change[].quantityinteger, 0 to 9,999yesIts new quantity: lower than now, 0 to take it off.
addlist of objects, at most 50 itemsno, default []
add[].skustring, 1 to 100 charactersyesThe SKU of goods to add, at their list price.
add[].quantityinteger, 1 to 9,999yes
shippingstring, 1 to 30 charactersnoA new shipping price, VAT included, in the order's currency; leave out to keep it.
reasonone of customer_request, out_of_stock, store_error, otheryesWhy: the customer asked, out of stock, the store's error, or other.
notestring, at most 500 charactersnoA note for the order's history; the customer never sees it.
notifybooleanno, default trueEmail the customer about the change (always, when it asks for money or takes units off).
restockbooleanno, default truePut units taken off back in stock.
approved_baseanynoNever 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:read

  • Scope: orders:read

  • Hints: read-only, idempotent

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
returnstring, 1 to 64 charactersyesThe return's number, such as 1042-R1, or its id; an order number works when the order has one return.
replacementslist of objects, 1 to 20 itemsyes
replacements[].skustring, 1 to 100 charactersyesThe SKU of a replacement.
replacements[].quantityinteger, 1 to 99yes
shippingone of free, standardno, 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 name

  • Permission: orders:write

  • Scope: orders:write

  • Hints: open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
returnstring, 1 to 64 charactersyesThe return's number, such as 1042-R1, or its id; an order number works when the order has one return.
replacementslist of objects, 1 to 20 itemsyes
replacements[].skustring, 1 to 100 charactersyesThe SKU of a replacement.
replacements[].quantityinteger, 1 to 99yes
shippingone of free, standardno, 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 money

  • Permission: orders:write

  • Scope: orders:write

  • Hints: destructive, open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
orderstring, 1 to 64 charactersyesThe 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 money

  • Permission: orders:write

  • Scope: orders:write

  • Hints: destructive, open world

Inputs

FieldTypeRequiredDescription
storestringyesThe store, by its slug from list_stores.
returnstring, 1 to 64 charactersyesThe return's number, such as 1042-R1, or its id; an order number works when the order has one return.

Made from the API contract, version 1.57This page as Markdown

Was this page helpful?