Order Creation Modes & Google Sheets Export — RUTHH COD Form & Upsells
Goal and Expected Result
Section titled “Goal and Expected Result”Understand how RUTHH COD Form & Upsells creates idempotent Shopify Orders (orderCreate) or Draft Orders (draftOrderCreate), and configure Integrations → Google Sheets (/app/integrations/google-sheets) to export COD orders automatically in real time.
Preconditions
Section titled “Preconditions”- You have configured your preferred Order Creation Mode in Settings → General (
/app/settings/general). - For Google Sheets export, you have a Google account with access to Google Drive / Google Sheets.
Numbered Instructions
Section titled “Numbered Instructions”1. Choose Between Standard COD Orders & Draft Orders
Section titled “1. Choose Between Standard COD Orders & Draft Orders”- Open Settings → General (
/app/settings/general). - Under Order Creation, select:
- Standard COD Order (
STANDARD): Calls ShopifyorderCreateinside an idempotent transaction, applying your configured order tags (COD, RUTHH_COD), shipping line, additional COD fee, and UTMcustomAttributes. - Save as Draft Order (
DRAFT): Calls ShopifydraftOrderCreateso your team can review and confirm orders in Shopify Admin → Orders → Drafts before converting them into final orders.
- Standard COD Order (
- Click Save. Note that when Draft Order mode is enabled, Admin Home and Analytics automatically surface
Orders / Draft Ordersmetrics.
2. Connect Google Sheets via Least-Privilege OAuth (drive.file)
Section titled “2. Connect Google Sheets via Least-Privilege OAuth (drive.file)”- Navigate to Integrations → Google Sheets (
/app/integrations/google-sheets). - Click Connect Google Account.
- Complete the Google OAuth consent screen. The app requests only the narrow
https://www.googleapis.com/auth/drive.filescope (plus basic account email identity)—meaning the app can access only spreadsheets you explicitly create through the app or select via the Google Picker, never your broader Google Drive files.
3. Create or Select a Destination Spreadsheet & Worksheet
Section titled “3. Create or Select a Destination Spreadsheet & Worksheet”- Once connected, choose how to bind a spreadsheet:
- Create New Spreadsheet: Creates a dedicated spreadsheet in your Google Drive in one click and binds it automatically.
- Select Existing Spreadsheet (Google Picker): Opens the official Google Picker modal so you can grant
drive.fileaccess to an existing spreadsheet.
- Select the target Worksheet (Tab). The app binds to the immutable numeric
sheetId(in addition to caching the sheet title) so renaming the tab inside Google Sheets does not break exports.
4. Choose Column Preset & Row Granularity
Section titled “4. Choose Column Preset & Row Granularity”- Under Column Preset, choose the data depth exported for each order:
MINIMAL: Essential order ID, timestamp, customer contact, delivery address, items summary, and total.MARKETING: Adds UTM parameters (utm_source,utm_medium,utm_campaign,utm_term,utm_content), discount details, and funnel metadata.FULL: Complete operational export including line-item SKUs, variant IDs, shipping rate details, additional COD fees, order creation mode (STANDARDvsDRAFT), and fraud/verification status.
- Under Row Mode, select:
ORDER(One row per COD order): Consolidates all purchased items into a single row per order.PRODUCT(One row per line item): Writes a separate row for each line item in the order while repeating order-level identifiers.
- Toggle Enable Export on and click Save (or use Send Test Row to verify your spreadsheet binding immediately).
Warnings and Edge Cases
Section titled “Warnings and Edge Cases”Troubleshooting Steps
Section titled “Troubleshooting Steps”- Spreadsheet tab was renamed in Google Sheets: Because the exporter resolves the target tab by its numeric
sheetId, renaming the tab normally continues working; click Refresh Worksheets in/app/integrations/google-sheetsto update the displayed tab name. - Draft Orders not appearing in external ERPs that only watch finalized orders: Remember that Draft Orders reside under Orders → Drafts in Shopify until marked as paid or completed. Both Standard and Draft COD orders ARE exported to Google Sheets automatically.