Where it is
Go to Settings, then Import, export and API:
Import, export and API Move rules in and out of Prime MOQ, or read and write them from your own systems.
The page has two parts: Import and export rules, and API keys.
JSON or CSV
The page explains the difference in one line:
JSON is the complete, lossless format and stays on every plan. CSV is the one you can edit in a spreadsheet: it carries the fields you bulk-edit, not the design and message JSON.
| JSON | CSV | |
|---|---|---|
| Buttons | Export JSON, Import JSON | Export CSV, Import CSV |
| Plan | Free on every plan | Pro |
| Carries | Everything | The fields you bulk-edit |
| Edit by hand | No. Treat it as a backup file. | Yes, in any spreadsheet |
| Use it for | Backups, and moving rules to another store | Changing many rules at once |
Export JSON downloads the same .dpx backup file the Safe Uninstall page
produces. It is not a separate format, just the same backup available any time.
CSV export and import
What a CSV carries
One row per rule, with columns for the rule's ID, name, type and status; its minimum, maximum, multiple, value and weight limits and weight unit; how to count; its schedule; its product scope (products, collections, tags, vendors, product types and price ranges); customer eligibility and countries; and the Contact us settings.
It does not carry per-language messages, design, purchase history or the detail of each scope entry. That is what keeps JSON as the complete format.
How an import treats each row
| Row | What happens |
|---|---|
Has a ruleId that exists in this store | That rule is updated. If the row sets a status, the status changes too. |
Has no ruleId | A new rule is created, as Paused. |
Has a ruleId that does not exist here | The row is skipped, with an error. |
When the import finishes it reports "{created} created · {updated} updated · {skipped} skipped", with a list of rows that failed and why. An updated rule that is active is reapplied straight away.
It does not erase what it does not carry
The page shows this on its own:
A CSV import will not erase what the CSV does not carry Per-language messages, design and exclusion lists are left untouched. Round-tripping an export through a spreadsheet is safe.
So you can export, change the minimums in a spreadsheet, and import, without losing the messages you wrote in four languages. A blank scope column also leaves that part of the scope as it was.
JSON import
Import JSON accepts a Prime MOQ export (.dpx, .json or .txt) and works on
any store, including one that already has rules. Every rule in the file is
added as a new, paused rule. Nothing existing is replaced, so importing the
same file twice gives you two copies of each rule. Review the imported rules,
then activate the ones you want.
Dos and don'ts
- Do export JSON before a large bulk edit. It is the complete, lossless backup.
- Do use CSV only for the fields you actually want to bulk-edit in a spreadsheet.
- Don't rely on CSV as your only backup. It does not carry per-language messages or design settings.
- Don't assume a CSV re-import clears fields it does not include. Missing columns are left untouched, not wiped.
API keys
API keys Read and write rules from your own systems. /api/v1/rules · 60 requests per minute per key.
An API key lets another system, such as an ERP, a PIM or your own script, list, read, create, update and delete rules. Send the key as a bearer token. Each key can make 60 requests a minute.
Create a key
Click Create key, give it a name that says which integration it is for, and create it. The token appears once:
You will not see this again Copy this token now. Prime MOQ only stores a hash of it, not the plaintext.
Copy it straight into wherever the integration keeps its secrets. Prime MOQ cannot show it to you again, because it never kept it. If you lose it, revoke the key and create a new one.
The keys table
| Column | What it shows |
|---|---|
| Name | The name you gave the key. |
| Key | The first characters of the key followed by dots, enough to tell keys apart without showing the token. |
| Created | When it was made. |
| Last used | When it last made a request, or Never. |
| Revoke | Switches the key off immediately. |
Revoking is immediate and cannot be undone. Anything using that key stops working on its next request.
The Write log
Below the keys sits the Write log:
Every write through the API, with the key that made it. When an integration wipes a merchant's rules at 3am, this is the difference between an answer and a guess.
Each entry records When, Key (the key's name), Action (create, update or delete, with the ID of the rule it touched) and Status (the response code, so a refused write shows as well as a successful one). Read-only requests are not logged, because they cannot change anything.
It is worth knowing about before you need it. When rules change and nobody on the team changed them, the write log tells you which integration did it and when, and which key to revoke.
Keeping keys safe
- Store a key in a password manager or secrets vault, not a shared document.
- Create a separate key for each integration, so you can revoke one without breaking the others.
- Never paste a key into client-side code, such as theme JavaScript, or into a public repository.
- If you suspect a key has leaked, revoke it immediately and create a new one.
Common mistakes
- Using CSV as the only backup. It leaves out messages and design. Export JSON as well.
- Deleting a column to clear a field. A missing or blank column leaves the field as it was. Change the value instead.
- Importing JSON twice. JSON import always adds new rules, so a second run duplicates everything.
- One key shared by every integration. You cannot then revoke one without breaking them all, and the write log cannot tell them apart.
- Expecting imported rules to enforce straight away. New rules from either import arrive Paused.