Skip to main content

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.

Availability

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.

Screen labels

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​

FeatureDescription
PDF output rulesCreate, edit, enable/disable and delete rules. You can start from a preset of common settings
Automatic outputOutput PDFs for matching orders when an order is created, paid or cancelled, a fulfillment is created or updated, or a refund is created
ConditionsNarrow the orders to output by order tags, customer tags, product title, SKU, amount, shipping country and more
Manual outputFrom the order detail screen in the app, pick a rule and download a PDF for one order
Bulk outputSelect orders on the order list screen in the app and download them together as a ZIP (up to 50 orders at a time)
Test runFrom the rule edit screen, output a trial PDF for the most recent order
Output historySee the latest 200 outputs with date and time, order number, rule, trigger and status

Prerequisites​

  1. A Shopify store
  2. A Re:port Flow workspace (create one at re-port-flow.com)
  3. 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)
  4. 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.

  1. Select ReportFlowに接続 (Connect to ReportFlow)
  2. In the window that opens, sign in to Re:port Flow, choose the workspace to use, and authorize the app
  3. 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​

ScopeUsed for
read_ordersReading orders, line items, addresses and amounts; receiving order and refund events
read_customersReading customer information such as the display name
read_fulfillmentsReading 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.

FieldDescription
Rule nameAny 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 / disabledA disabled rule is excluded from automatic output and from the output buttons on the app's order screens
TriggerWhen to output automatically. Choose one from the table below
Conditions (optional)Narrow the orders to output. Only orders that meet every condition are output
TemplateChoose from the templates you created or duplicated in Re:port Flow. Edit the template itself in the Re:port Flow editor
Field mappingsWhich 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 appShopify 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 fieldAvailable comparisons
Order tags / customer tagsequals, 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 / subtotalequals, 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 emailequals, 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.

PresetTriggerCondition
Output a PDF when payment is completedWhen payment is completedNone
Output a PDF to pack with the shipmentWhen a fulfillment is createdNone
Output a PDF only for tagged ordersWhen payment is completedOrder tags equal gift
Output manually only when neededNo 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​

  1. Open 注文一覧 (Orders) from the app menu
  2. Select PDFを出力 (Output PDF) for the order
  3. 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​

  1. On 注文一覧 (Orders), tick the orders to output (up to 50 at a time)
  2. Choose the rule in the PDF出力ルール (PDF output rule) selector
  3. 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.

ColumnContents
Output date and timeShown in the store's time zone
Order numberThe order the PDF was output for
RuleName of the rule used
TriggerWhat started the output (manual output, bulk manual run, or the automatic trigger name)
StatusSuccess / 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)
ActionsPDFを開く (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 documentExample rule settings
InvoiceTrigger "when payment is completed", condition "customer tags equal b2b"
Delivery noteTrigger "when a fulfillment is created", no condition
Thank-you letterTrigger "when payment is completed", condition "total price greater than 10000"
Gift letterTrigger "when payment is completed", condition "order tags equal gift"
Production order for a factoryTrigger "when an order is created", condition "vendor equals (your factory's vendor name)"
Picking / shipping instructionTrigger "no automatic output (manual only)"; output the day's orders together as a ZIP from the order list
Return instructionsTrigger "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/redact and shop/redact. On shop/redact it 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_orders scope 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.

"要対応" (Action required) appears in the rule list​

The rule cannot output PDFs, even if it is shown as enabled. How each reason is handled:

ReasonOutput button / test runAutomatic outputWhat to do
No template selectedNot shown as a button; test run is disabledNot used (nothing is output or recorded)Choose a template on the edit screen and save
The template is not in the Re:port Flow template listShown and can be pressed, but the output fails with "template not found"Attempted; records "failed (template not found)" in the historyChoose another template that is in the list on the edit screen and save
The template version could not be confirmedNot shown as a button; test run is disabledNot output; records "skipped" in the historyOpen the edit screen and save again (the same template is fine; see below)

Open the edit screen with テンプレートを選び直す (Choose the template again). When the app is not connected to Re:port Flow or cannot fetch the template list, it does not judge templates as "not found".

"Skipped" appears in the output history​

An automatic output was triggered by a Shopify event, but the app did not output because the version of the rule's template has not been confirmed. Open the edit screen with テンプレートを選び直す (Choose the template again) in the rule list and save again. For a rule whose version has not been confirmed, saving fetches the version again even with the same template (the field mappings are then rebuilt from the template's defaults). If the template is not in the Re:port Flow template list, the rule cannot be saved; choose a template that is in the list. The skip count is the number of events received from Shopify (one order can send several, for example when a fulfillment is updated).

Connecting to ReportFlow fails​

Check that the Re:port Flow account you connect with is an administrator of the workspace. If it is not, reconnecting with the same account does not help: connect with an administrator account, or ask a workspace administrator to connect. Connecting also fails if you choose not to allow access on the authorization screen, or if you authorize in a different browser from the one that started the connection. Start the connection again from the app.

"Connection error" is shown​

The connection to Re:port Flow is no longer valid. Reconnect from ReportFlow 接続設定 (ReportFlow connection settings) on the PDF output rules screen (you can also open it with ReportFlow に再接続 (Reconnect to ReportFlow) on a failed row of the output history), then press 再実行 (Retry) for failed automatic outputs.

Automatic output does not happen​

Check that:

  • the rule's trigger is not "no automatic output (manual only)"
  • the rule does not show "要対応" (Action required) in the rule list
  • the order meets the conditions (orders that do not are not recorded in the output history)
  • the output history does not show a failure (nothing is recorded if the rule's 出力履歴に記録する is off)

The output history stays "in progress" or shows "no completion notification"​

The app is waiting for the completion notification from Re:port Flow. If it has not arrived 30 minutes after acceptance, the row changes to "failed (no completion notification)" and can be retried (Retrying a failed automatic output). The notification does not arrive for one of two reasons:

  • The generation itself failed: the app does not receive generation failure notifications (file.failed), so if the generation fails after it was accepted (for example, the merged data does not match a template field's type), no completion notification arrives. Retrying gives the same result. Output the same order manually with the same rule from the app's order screen; the reason for the failure is shown on screen. Review the rule's field mappings or the template
  • The completion notification cannot be received: the webhook endpoint registered when connecting may have been deleted or disabled. Reconnect from ReportFlow 接続設定 (ReportFlow connection settings)

"This order does not match the rule's conditions"​

Manual output also checks conditions. Review the rule's conditions or the order. Tags and SKUs are compared ignoring leading and trailing spaces and letter case.

"Condition error" or "condition cannot be evaluated" in the output history​

  • Condition error: the rule still contains a condition field, comparison or value that is not supported. Edit the rule's conditions and save again
  • Condition cannot be evaluated: the order has so many line items that they could not all be retrieved. Running it again gives the same result, so use conditions that do not depend on line items

Bulk output stops​

The selection includes orders that cannot be retrieved or do not meet the conditions. Untick the orders shown on screen and run it again.