Adds suppliers, supplier items, purchase orders and per-site settings to Payload. It drafts one order per supplier from stock needs, then moves each order through approval, placement and receiving with a kept history. It works alone with a needs function or alongside the Kitting plugin, and it never places orders or stores payment details. Requires Payload 3.80 or newer and React 19.
Restock for Payload: supplier lists, purchase orders and receiving, fed by your stock levels, with copy-ready orders for suppliers that have no API.
Installation
npm i @extantape/payload-plugin-restock0
Stars
0
Forks
0
Open Issues
4 days ago
Last Updated
238
Weekly Downloads
v0.2.0
npm Version
184.1 KB
Unpacked Size
1
Dependencies
00 since Nov 8
| Date | Stars |
|---|---|
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
374+374 since Nov 11
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 374 |
| Dec 4, 2026 | 237 |
| Dec 3, 2026 | 241 |
| Dec 2, 2026 | 232 |
| Dec 1, 2026 | 220 |
| Nov 30, 2026 | 216 |
| Nov 29, 2026 | 200 |
| Nov 28, 2026 | 21 |
| Nov 27, 2026 | 22 |
| Nov 26, 2026 | 25 |
| Nov 25, 2026 | 27 |
| Nov 24, 2026 | 29 |
| Nov 23, 2026 | 205 |
| Nov 22, 2026 | 200 |
| Nov 21, 2026 | 199 |
| Nov 20, 2026 | 197 |
| Nov 19, 2026 | 189 |
| Nov 18, 2026 | 184 |
| Nov 17, 2026 | 178 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 183 |
| Nov 14, 2026 | 183 |
| Nov 13, 2026 | 167 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1451502395-root)<a href="https://payloaddirectory.dev/plugins/1451502395-root"><img src="https://payloaddirectory.dev/badge/1451502395-root.svg" alt="Payload Directory"></a>README
Restock for Payload: supplier lists, purchase orders and receiving, fed by your stock levels, with copy-ready orders for suppliers that have no API.
Status: early. 0.2.0 is the latest release. Releases go to npm as @extantape/payload-plugin-restock. 70 tests pass, most against a real MongoDB in memory on Payload 3.92 (on a single-node replica set, with Kitting 0.2.1 from npm and once with Kitting's 0.1 behavior, no restockNeeds, and on a standalone server with no transactions), and the rest with fakes or no database. They cover suppliers, supplier items and purchase orders, the order life cycle and who may move it, site isolation, drafting from stock levels, receiving into Kitting, shipments and marking them delivered, the CSV, JSON and PDF exports, and the write check, which is compared with MongoDB's own answer to the same query and sent raw request bodies over REST. The write check's rules for SQL databases are reasoned from Payload's SQL adapter code and haven't been run against one. On 2026-11-09 a session also checked it in a browser, on a local copy of a real site with made-up suppliers, using the keyboard. It checked the place-this-order panel, receiving with a lot number, the Arrived list and confirming a delivery. No errors were logged. Not checked yet: a screen reader, copying to the clipboard in a normal browser, a real supplier order, and use by anyone outside these tests. Kitting's "Today" line shows arrivals from Kitting 0.2 on; to staff limited to some sites, from Kitting 0.3.0 and Restock 0.1.2 on, since it needs the order's site that arrived now returns.
Restock never buys anything and never stores passwords or card numbers. It drafts; a person checks, approves and places the order.
suppliers collection (Kitting adds one), Restock adds these fields to it instead of making a second list.supplier-items): the supplier's item or model number, a description, what it's sold as ("box of 100") and how many are in one, the minimum order in packs, the price and the date it was seen, and the product page. With Kitting, each can be linked to the supply it restocks.purchase-orders): one supplier, with lines of items and packs. They're numbered PO-0001, PO-0002 and so on per site.
draftOrders(payload, { scope }), or POST /api/restock/draft for people who manage that site): one draft per supplier.
needs function.orderOutputs(payload, id)). Restock never places it: you do, with one of these.
GET /api/restock/order/:id/pdf (or /csv, /json), for people who may read the order.receiveOrder(payload, id, lines) and POST /api/restock/receive): what arrived, in whole packs per line, with a lot number and use-by date where the supply tracks lots.
tracking: { track }, Restock asks your tracking service to follow each new number. When it says delivered, your app calls markDelivered(payload, { trackerId, scope }). Without a service, staff mark a parcel delivered by hand, on an order they may manage, and only that order's shipments are looked at./admin/restock) and at the top of Kitting's Today. With notify, staff get one email per delivered parcel.config.custom.restock.arrived({ payload, user?, scope? }) lists those orders as { id, number, supplier, deliveredAt, scope }. scope is the order's site, the ID in scopeField (null without one), so Kitting can show staff limited to some sites only their own sites' deliveries. With user, only orders that person may receive are listed.GET /api/restock/cart/orders?scope= lists approved orders with their quick-order lines and links, and POST /api/restock/cart { order, status: 'filled' | 'failed', note } records whether the cart was filled. A failure needs a reason. Both are for people with approve access, only for approved orders, and nothing else on the order can change through them. Restock still never places an order: a person checks the cart and checks out.restock-settings, one per site): the organization name, ship-to and bill-to addresses, a contact, the paper size, and terms printed at the foot of every order.manage drafts and receives, approve approves and marks orders as ordered, and read sees them. With scopeField, everything stays inside one site. An order can't use another supplier's items, and nothing links across sites.
true or a query counts. Each of the three must answer exactly true, or a query ({ tenant: { in: [...] } }), which is then applied to the order. Anything else is a no: 1, 'yes', an empty or malformed query ({ tenant: false }), a query on a field orders don't have, or an error thrown. A query with a blank or missing value, such as { tenant: { equals: null } } or { tenant: { not_in: [] } }, is a no too. The endpoints answer 403, never 500, and the /admin/restock page reads nothing for that person. Return false for a person with no sites.manage answers with a query, each create or update on Restock's collections is checked against it in memory, in Restock's last beforeChange hook, or it's refused with a 403 and nothing is written. The document checked is the stored one with the submitted values over it, read only from the submitted data's own plain values. The check converts nothing, and it allows a write only when all of these hold. A query allows writes only for a signed-in person from userSlug.
__proto__, constructor, prototype, toJSON or toBSON at any depth, a getter, a class instance, a Proxy, a function or a symbol key is refused.equals, in, not_equals, not_in and exists, with and and or, on top-level fields that are text, textarea, email, select, radio, number or checkbox, or a relationship or upload to one collection. Not localized or virtual fields, no field named like something every JavaScript object has (constructor, toString and the like), and no exists on a has-many relationship. id works on updates only.true or false. IDs are text or numbers, by the collection's ID type, spelled exactly as stored (MongoDB ObjectIds in lowercase), and belong to documents that exist. Relationships hold IDs, not populated documents. An ID in not_equals or not_in must exist too.collation set on the MongoDB adapter, not_equals and not_in on text are refused.beforeChange hook, and nothing may change a value after it. So, on that collection: no beforeChange hook on any field, tab or block at any depth (Payload's own row IDs on arrays and blocks are fine), including blocks used through blockReferences and, once the collection has any blocks field, every block in the config's blocks; no rich text editor with beforeChange hooks; only Payload's built-in field types; and no validate function that changes the data it's given. Anything else the check can't read refuses query answers. Put your hooks before Restock's in overrides, or answer true. At start-up Restock logs one warning for each of its collections where a query answer will always be refused, with the reason.not_equals and exists: false, and an empty relationship matches not_in. An empty plain field never matches not_in, and an empty string matches neither exists: true nor exists: false, since databases differ there.user needs no change. Code that overrides access but passes a person as user is checked against that person's manage. Where it must write outside their sites, set context: { restockTrusted: true } (exported as RESTOCK_TRUSTED) on that request, and only there.approve answers no. A query lists only the orders it allows.On its own: Restock needs only Payload. It makes its own suppliers list, and drafts orders from a needs function you give it. Receiving then moves the order along and keeps its history, but adds stock nowhere, since there's no stock to add to. Run payload generate:importmap for the order page.
Needs: Payload ^3.80.0, @payloadcms/next ^3.80.0 and React >=19 as peer dependencies. Kitting (@extantape/payload-plugin-kitting >=0.1.0) is an optional peer, found through config.custom.kitting. No other EXTANT APE plugin is required.
Works with:
plugins, Restock adds its fields to Kitting's suppliers, drafts from Kitting's restockNeeds, and receives into Kitting's stock log, lots and alerts. It finds Kitting through config.custom.kitting, and the contract is in docs/contracts/kitting-restock.md. Kitting's suppliers keep Kitting's own access rules, so Restock's site check covers only the collections Restock makes: set Kitting's supplier access so each person reaches only their own sites.config.custom.labels.providers.Carrier tracking comes from your own code through tracking.track and markDelivered (docs/contracts/restock-tracking.md). No other plugin is involved.
Color Theory: no direct link. Its order page uses Payload's --theme-* colors, so it follows Color Theory's admin colors when its applyToAdmin option is on.
Family: Restock sits in the Fulfillment family, with Kitting, Sample Kits, Shipping, Scan, Labels, Wizards, Custody and Sequences, though the families are a working draft and Fulfillment is due to be split into different groups.
Run payload generate:importmap after adding it: the order page has a component.
import { restockPlugin } from '@extantape/payload-plugin-restock'
export default buildConfig({
plugins: [
// kittingPlugin({ … }), // optional; put it before Restock
restockPlugin({
access: { manage: isStaff, approve: isBuyer, read: isStaff },
}),
],
})
npm run dev starts a small local app with Restock and Kitting on a throwaway in-memory database, filled with made-up suppliers and supplies. It signs you in as made-up staff, listens on this computer only, and deletes everything when you press Ctrl+C. Nothing is ever sent: emails are written to the terminal.
npm install
npm run dev # try it: http://127.0.0.1:3200/admin/restock, made-up data, deleted on Ctrl+C
npm test # Vitest with an in-memory MongoDB replica set
npm run typecheck
npm run build
npm run leak-check
MIT. See LICENSE.
payload plugin kitting
Supply tracking, recipe-based kit building and ready-stock management for Payload with low-stock email alerts
74418/wk0v3
payload plugin sample kits
Track sample kits from stock to keeper and back with custody trails, lot recalls and one-time activation secrets
74441/wk0v3
ecommerce
Ecommerce utilities for Payload with idempotent Stripe confirmation, orders, carts and inventory handling
10019.0k/wk46.1kv3 v4
payload stock reservation
Validates variant stock and price at checkout and holds stock until payment settles or the hold expires
76152/wk1v3
payload ecommerce
Products, carts, orders and coupons for Payload 3 with server-side helpers and stock tracking
72537/wk2v3
payload stock alerts
Low stock threshold alerts by email and backorder handling for Payload ecommerce products and variants
7222/wk1v3