Shopify integration (Re:port Flow Shopify app)
The Re:port Flow Shopify app is an embedded app that generates a PDF of any business document from your Re:port Flow templates, triggered by Shopify events, conditions or manual actions. It runs inside the Shopify admin and fills the fields of a template with order data.
The app does not hard-code which documents you can produce. You register PDF output rules that say "when, under which conditions and from which template to output a PDF"; the template defines the content and the rule name defines what the document is called. Standard documents such as invoices and delivery notes work the same way as thank-you letters or production orders for a factory: if you have a template, you can output it.
The Shopify app is being prepared for listing on the Shopify App Store. This page describes the current development version, and screen labels or steps may change at launch.
The app's screens are currently in Japanese only. This page gives the Japanese label in bold followed by an English gloss, for example PDF出力ルール (PDF output rules).
What you can do
| Feature | Description |
|---|---|
| PDF output rules | Create, edit, enable/disable and delete rules. You can start from a preset of common settings |
| Automatic output | Output PDFs for matching orders when an order is created, paid or cancelled, a fulfillment is created or updated, or a refund is created |
| Conditions | Narrow the orders to output by order tags, customer tags, product title, SKU, amount, shipping country and more |
| Manual output | From the order detail screen in the app, pick a rule and download a PDF for one order |
| Bulk output | Select orders on the order list screen in the app and download them together as a ZIP (up to 50 orders at a time) |
| Test run | From the rule edit screen, output a trial PDF for the most recent order |
| Output history | See the latest 200 outputs with date and time, order number, rule, trigger and status |
Prerequisites
- A Shopify store
- A Re:port Flow workspace (create one at re-port-flow.com)
- A Re:port Flow account that is an administrator (ADMIN) of the workspace. Connecting registers, on the Re:port Flow side, the webhook endpoint that receives completion notifications for automatic output (Webhook notifications)
- A template to base the PDF on. If you have none yet, create one in Re:port Flow or duplicate one from the template gallery
Installing and connecting to Re:port Flow
Installation steps will be added to this page once the app is listed on the Shopify App Store.
When you open the app, the first screen (PDF出力ルール, PDF output rules) starts with the ReportFlow 接続設定 (ReportFlow connection settings) section.
- Select ReportFlowに接続 (Connect to ReportFlow)
- In the window that opens, sign in to Re:port Flow, choose the workspace to use, and authorize the app
- When the app shows 接続済み (Connected), you are done. The ID of the connected workspace is shown as well. 接続テスト (Connection test) checks that the app can reach the Re:port Flow API
If your browser blocks the pop-up, continue with the 認可画面を開く (Open authorization screen) button that appears. To disconnect, select 接続を解除 (Disconnect).
The connection uses OAuth 2.0, and the app requests the Re:port Flow scopes openid and pdf:generate (OAuth 2.0). You never paste an application key into the app.
Permissions the app requests from Shopify
| Scope | Used for |
|---|---|
read_orders | Reading orders, line items, addresses and amounts; receiving order and refund events |
read_customers | Reading customer information such as the display name |
read_fulfillments | Reading fulfillment information; receiving fulfillment events |
All of them are read scopes. The app does not request any permission to change your Shopify data.
Customer personal data (protected customer data)
Names, addresses, email addresses and phone numbers are what Shopify calls protected customer data. The app can read them only when Shopify has allowed the app to use those fields. Approving the scopes above is not enough on its own. The app's provider (Re:port Flow) requests this permission from Shopify; there is nothing to do on your store.
If a field has not been allowed, the app may fail to read the order, and the PDF output fails. Before you rely on a rule, use a test run to confirm that names and addresses are filled in.
What is a PDF output rule?
A rule describes when, under which conditions and from which template to output a PDF. Create one with ルールを作成 (Create rule) on the PDF output rules screen.
| Field | Description |
|---|---|
| Rule name | Any name you like (for example "Delivery note on payment", "Thank-you letter", "Factory production order"). It is used in the PDF file name (<rule name>_<order number>.pdf) and in the output history. In file names, / \ : * ? " < > | are removed from the rule name and order number (if the rule name consists only of these characters, document is used) |
| Enabled / disabled | A disabled rule is excluded from automatic output and from the output buttons on the app's order screens |
| Trigger | When to output automatically. Choose one from the table below |
| Conditions (optional) | Narrow the orders to output. Only orders that meet every condition are output |
| Template | Choose from the templates you created or duplicated in Re:port Flow. Edit the template itself in the Re:port Flow editor |
| Field mappings | Which Shopify order data goes into each field of the template |
| Output action | 出力履歴に記録する (Record in output history): keep the success or failure of each output in the output history. On by default. Turning it off does not stop output: PDFs are still generated and count toward your plan's output limit. When it is off, manual and bulk outputs and the "in progress" and "failed" entries of automatic outputs are not recorded. A successful automatic output is still added as a success entry when Re:port Flow sends the completion notification, and can be opened with PDFを開く (Open PDF). Keep it on for rules with an automatic trigger, otherwise you will not notice failures |
Triggers
| Label in the app | Shopify event that fires it |
|---|---|
| 自動出力しない(手動実行のみ) (No automatic output, manual only) | None. Output only from the app's order screens or a test run |
| 注文が作成されたとき (When an order is created) | Order created |
| 支払いが完了したとき (When payment is completed) | Order paid |
| 注文がキャンセルされたとき (When an order is cancelled) | Order cancelled |
| 発送が作成されたとき (When a fulfillment is created) | Fulfillment created |
| 発送が更新されたとき (When a fulfillment is updated) | Fulfillment updated |
| 返金が作成されたとき (When a refund is created) | Refund created |
A rule with an automatic trigger can still be run manually from the app's order screens at any time.
Conditions
Without conditions, a rule outputs a PDF for every order its trigger fires on. A rule can have up to 20 conditions, and all of them must be met (AND).
| Condition field | Available comparisons |
|---|---|
| Order tags / customer tags | equals, does not equal, contains, equals any of, has a value, has no value |
| Product title / SKU / vendor (any line item) | Same as above |
| Total price / subtotal | equals, does not equal, greater than, less than, equals any of, has a value, has no value |
| Currency code / financial status / fulfillment status / shipping country code / order note / customer email | equals, does not equal, contains, equals any of, has a value, has no value |
- Text is compared ignoring leading and trailing spaces and letter case
- "Equals any of" takes a comma-separated list of candidates (for example
gift, b2b, wholesale) - For fields with several values, such as tags and line items, "equals" and "contains" match when any value matches, and "does not equal" matches when no value matches
- If a rule still contains a condition that cannot be evaluated (a field, comparison or value that is no longer supported), it outputs nothing and records a "condition error" in the output history
Presets
The rule creation screen offers the following starting points. After choosing one you can still change the name, trigger and conditions freely. You choose the template yourself.
| Preset | Trigger | Condition |
|---|---|---|
| Output a PDF when payment is completed | When payment is completed | None |
| Output a PDF to pack with the shipment | When a fulfillment is created | None |
| Output a PDF only for tagged orders | When payment is completed | Order tags equal gift |
| Output manually only when needed | No automatic output (manual only) | None |
Templates and field mappings
When you choose a template, field mappings are filled in automatically from the template's field names. Use 差し込み項目を編集 (Edit field mappings) on the rule edit screen to pick the Shopify data for each field. Fields left unmapped are output blank.
You can map the following data:
- Order: order number, order date and processed date (
YYYY-MM-DD), order note, email, phone, financial status, fulfillment status, payment method - Amounts and tax: subtotal, tax, tax rate, shipping, discounts, total. Amounts are passed as numbers, so format currency symbols and thousands separators in the template
- Customer: name, email, phone
- Shipping and billing address: name, company, phone, each address field, and the full address as one string
- Line items: passed as rows to a table field in the template
Customer names, email addresses, phone numbers and addresses (including recipient names) are protected customer data. You can map them only when Shopify has allowed the app to use them.
Mappings are filled in automatically whenever the field names match, whether the template came from the gallery or you built it yourself. See Variables basics for how template parameters work.
Manual output from the app's order screens
Manual output happens on the 注文一覧 (Orders) screen in the app and the per-order output screen opened from it. Only rules that are enabled, have a template selected and have a confirmed template version appear as output buttons (a rule whose "needs attention" reason is "template not found" does appear, but its output fails with "template not found").
Output one order
- Open 注文一覧 (Orders) from the app menu
- Select PDFを出力 (Output PDF) for the order
- Select the (ルール名)を出力 (Output "rule name") button for the rule you want; the PDF is downloaded
Rules with conditions check them on manual output too. If the order does not meet the conditions, nothing is output and the screen says so.
Output several orders as a ZIP
- On 注文一覧 (Orders), tick the orders to output (up to 50 at a time)
- Choose the rule in the PDF出力ルール (PDF output rule) selector
- Select 選択した注文を一括出力 (Output selected orders); a ZIP containing a PDF for each selected order (
<rule name>_bulk.zip) is downloaded
The order list shows 50 orders per page, and selections are not kept across pages. If any selected order cannot be retrieved or does not meet the rule's conditions, no ZIP is created and the affected order numbers are shown, so that you never receive a ZIP with silently missing files. Untick those orders and try again.
Test run
テスト実行 (Test run) on the rule edit screen outputs and downloads a PDF for the most recent order using the saved settings. Use it to check the template and field mappings. If the rule is disabled, has no template, or its template version has not been confirmed, the button is disabled and the reason is shown.
Automatic output
An enabled rule with an automatic trigger checks its conditions every time the app receives the event from Shopify, and outputs a PDF through Re:port Flow for matching orders.
- Output uses asynchronous generation. The output history first records the output as "in progress" and changes it to "success" when Re:port Flow sends the completion notification. If no completion notification arrives within 30 minutes of acceptance, the output is shown as "failed (no completion notification)"
- Duplicate output of the same rule for the same event is prevented
- Orders that do not meet the conditions are not recorded in the output history (with conditional rules most orders are out of scope, and recording them would flood the history)
- If the version of the rule's template has not been confirmed, the app does not output even orders that meet the conditions, and records "skipped" in the output history (when the rule's 出力履歴に記録する is on). Skips for the same rule and reason are combined into one row that shows how many times the output was skipped and the latest order
- A rule with no template selected is not used for automatic output (nothing is output or recorded in the history). A rule whose template is not in the Re:port Flow template list still attempts the output and records "failed (template not found)" in the output history
Output history
出力履歴 (Output history) in the app menu shows the latest 200 outputs. Manual, bulk and automatic outputs are all recorded when the rule's output action 出力履歴に記録する (Record in output history) is on (the default). For a rule with it turned off, nothing is recorded except successful automatic outputs (added when the completion notification arrives), so the history cannot help with the troubleshooting below.
| Column | Contents |
|---|---|
| Output date and time | Shown in the store's time zone |
| Order number | The order the PDF was output for |
| Rule | Name of the rule used |
| Trigger | What started the output (manual output, bulk manual run, or the automatic trigger name) |
| Status | Success / in progress / failed (failures show a reason such as "connection error", "condition error" or "no completion notification") / skipped (automatic output not performed because the rule is not fully set up) |
| Actions | PDFを開く (Open PDF, for successful automatic outputs) / 再実行 (Retry, for failed automatic outputs) / ReportFlow に再接続 (Reconnect to ReportFlow, for outputs that failed because of the connection) / この注文を開く (Open this order) |
PDFs output manually or in bulk are not stored by the app. If you need one again, output it again from the order's output screen.
Retrying a failed automatic output
Rows for failed automatic outputs show 再実行 (Retry), which outputs the same order with the same rule again. Rows for manual or bulk outputs do not show it; output those again from the order's output screen.
To avoid outputting the same PDF twice, the app checks the following before retrying:
- Rows with no completion notification: the app asks Re:port Flow for the status of the original output. If the original output has since completed, it updates the row to "success" instead of retrying. It also does not retry while the original output is still processing or when its status cannot be checked
- Rows that failed because of a network failure or a server error: the original output may have been accepted by Re:port Flow, so the row cannot be retried for about 30 minutes after the failure. If the completion notification arrives in the meantime, the row changes to "success"
- Pressing retry on the same row again: the second and later presses are stopped. Follow the on-screen message and reload the page
For rows that failed because of the connection (for example "connection error"), reconnect with ReportFlow に再接続 (Reconnect to ReportFlow) first, then press 再実行 (Retry).
Typical use cases
These are examples only. Change the rule name and template and the same steps output any other document.
| Example document | Example rule settings |
|---|---|
| Invoice | Trigger "when payment is completed", condition "customer tags equal b2b" |
| Delivery note | Trigger "when a fulfillment is created", no condition |
| Thank-you letter | Trigger "when payment is completed", condition "total price greater than 10000" |
| Gift letter | Trigger "when payment is completed", condition "order tags equal gift" |
| Production order for a factory | Trigger "when an order is created", condition "vendor equals (your factory's vendor name)" |
| Picking / shipping instruction | Trigger "no automatic output (manual only)"; output the day's orders together as a ZIP from the order list |
| Return instructions | Trigger "when a refund is created", no condition |
Security and data handling
- Credentials stay on the server. Re:port Flow access and refresh tokens are stored encrypted (AES-256-GCM) and are never returned to the browser. Rules do not contain credentials either
- Each store is isolated. Rules and output history are stored per store, and one store cannot read or change another store's data
- Webhooks from Shopify are signature-verified. Notifications with an invalid signature are not processed
- The mandatory GDPR webhooks are supported. The app receives
customers/data_request,customers/redactandshop/redact. Onshop/redactit deletes all of that store's rules, output history and connection data - The app does not store customers' personal data. Names, addresses, email addresses and similar data are read from Shopify only when a PDF is output and passed to Re:port Flow. The output history keeps order-level data such as the order ID, order number, rule name, trigger and time. Values the merchant types into a rule condition (for example a customer email address used as a condition value) are stored as part of the rule
- On uninstall, the app deletes the Shopify session and the Re:port Flow connection data
The output PDFs and the data filled into them are handled by Re:port Flow. See Security and data handling for storage location, retention and encryption.
Limitations
- Only orders from the last 60 days are available. Under Shopify's rules, the
read_ordersscope can read only orders from the last 60 days. Older orders do not appear in the order list and cannot be output - The app's screens are in Japanese
- Up to 50 rules per store and 20 conditions per rule
- Bulk output handles up to 50 orders at a time. If the data exceeds the size limit, select fewer orders
- The output history keeps the latest 200 entries
- Conditions can only be combined with AND. Product type, product tags and metafields cannot be used as conditions
- The only output action is recording in the output history. The app does not save URLs to order metafields or send email notifications
- A rule outputs with the template version that was current when the template was chosen. Once the version has been confirmed, saving the rule again with the same template does not change it (updating the template does not switch the rule to the new version)
- For orders with a very large number of line items (more than about 5,000), line-item conditions (product title, SKU, vendor) cannot be evaluated and nothing is output
- PDFs are generated through the Re:port Flow API, so your workspace plan's output limits and the request limits apply (Limitations)
Troubleshooting
No output button on the app's order screen
On the PDF output rules screen, check that the rule is enabled and has a template. Disabled rules, and rules whose template is not selected or whose template version has not been confirmed, are not shown as buttons.