Plugin setup
What the MedusaPOS plugin needs in your Medusa store, and what it records there.
The quick start walks through installation. This page covers the plugin's options and what it records in your store.
Install and configure
Install the plugin and run its migration as in the quick start's Install the plugin. It needs Medusa 2.21.0.
Register the plugin in medusa-config.ts, keeping your existing plugins:
plugins: [{ resolve: '@medusapos/ medusa-plugin', options: {} }]Updating from 0.1.0? First read Updating to 0.2.0: every till must send all its sales before you update. Then run the same install and migration, and restart the backend. Keep your existing @medusapos/medusa-plugin entry in medusa-config.ts.
All options are optional:
salesChannelId: the sales channel for POS orders. Default: the store's default sales channel.locationId: the stock location for POS orders. Default: the channel's first linked stock location.shippingOptionId: the shipping option for POS orders. Default: the location's earliest shipping option on the sale's products' shipping profile.
An explicit shippingOptionId must use the products' shipping profile. A sale's products may use at most one shipping profile; products without one are ignored. A sale that mixes profiles is refused.
Allow the app's origin in ADMIN_CORS and AUTH_CORS as in Configure your store. The till signs in as a Medusa admin user with email and password, without multi-factor authentication.
If you run more than one Medusa instance
Configure a shared locking provider: Redis (@medusajs/medusa/locking-redis) or Postgres advisory locks (@medusajs/medusa/locking-postgres). The default in-memory provider only locks inside one process. Concurrent sales on two instances can lose stock updates and oversell.
With the in-memory provider, the plugin logs a warning once at startup and still starts. One instance is fine. For Redis, add this entry to the modules array in medusa-config.ts, keeping the modules already there, such as RBAC:
modules: [
// ...the modules you already have, such as RBAC
{
resolve: '@medusajs/ medusa/ locking',
options: {
providers: [{
resolve: '@medusajs/ medusa/ locking-redis',
id: 'locking-redis',
is_default: true,
options: {
redisUrl: process. env.LOCKING_REDIS_URL,
},
}],
},
},
]Set LOCKING_REDIS_URL in every instance's environment to the URL of the same Redis server.
For Postgres advisory locks, which use your store's own database and need no extra settings, add this entry to modules instead:
modules: [
// ...the modules you already have, such as RBAC
{
resolve: '@medusajs/ medusa/ locking',
options: {
providers: [{
resolve: '@medusajs/ medusa/ locking-postgres',
id: 'locking-postgres',
is_default: true,
}],
},
},
]Then run npx medusa db:migrate to create its locking table.
What a sale records
Each sale becomes a paid, fulfilled and completed Medusa order with stock deducted, recorded exactly once. If the till sends it again, it gets the result already recorded, not a second order.
Payments use Medusa's system payment provider, which moves no money. Take card payments on your own terminal; MedusaPOS does not charge cards.
Each discounted line gets one code-less line-item adjustment named "POS discount", so tax is charged on the discounted amount. The till's receipt totals are stored on the order as the fiscal record. Medusa keeps line tax unrounded, so its reports can differ from receipts by fractions of a cent. The payment always equals the POS total.
Stock never refuses an offline sale. It ends at the original stock minus what was sold and may go negative. Each short variant gets an insufficient_stock warning on the order; the till shows the sale under Orders → Needs attention.
When the store refuses a sale
A store that can't take a sale refuses it with a store_configuration reason instead of retrying forever. The message names what to fix: a missing sales channel; a missing stock location or address; a locationId that doesn't exist or isn't assigned to the sale's channel; no shipping option at the location for the products' shipping profile; or mixed shipping profiles. Fix the store, then tap Retry on the sale under Orders → Needs attention.
A line whose product was deleted, is not published, or is not in the sale's sales channel is refused with unknown_variant. It stays refused even if the product is later published or added to the channel.
New in 0.2.0
These changes arrived in release 0.2.0.
- The store records register openings, counts and closures, and works out what the drawer should hold from sales it received. The app doesn't show the store's figure yet; it is available from
GET /tally/v1/registers/{id}. - A sale that can't be finished automatically, for example because its order was changed by hand in Medusa, waits for an admin. The admin completes or rejects it with one command; see Held sales.
- A split-tender sale records both payments on one order. A sale with a customer is linked to that Medusa customer.
- A batch of more than 50 sales, or one over the size limit, is refused whole, with the limit in the answer.