# Triple Whale

> Read your Triple Whale metrics, attribution and SQL results, and send it orders, products, customers, subscriptions, ad and email figures, survey answers and offline events.

App · 16 actions. Web page: https://docs.lodol.com/docs/integrations/triple-whale

## Actions

### Add costs to an order

Add shipping costs, other expenses, your own figures or an ignore flag to an order from Shopify, BigCommerce, WooCommerce or another platform Triple Whale connects to.

**Inputs**

- Order ID (`order_id`, text, required): The order's ID in Shopify, BigCommerce, WooCommerce or another platform Triple Whale connects to.
- Platform (`platform`, text): The platform the order is from. Needed for a second sales platform such as Amazon; leave empty for your main one.
- Shipping costs (`shipping_costs`, number): What shipping cost you. Used when Default Shipping Costs is chosen in Triple Whale's cost settings.
- Other expenses (`custom_expenses`, number): Other costs of the order.
- Gross sales (`custom_gross_sales`, number): Your own gross sales figure.
- Gross profit (`custom_gross_profit`, number): Your own gross profit figure.
- Net revenue (`custom_net_revenue`, number): Your own net revenue figure.
- Items (`total_items_quantity`, number): How many items are in the order.
- Count as an order (`orders_quantity`, text): Whether this order counts toward order totals. One of: `1` (Count it (1)), `0` (Don't count it (0)).
- Ignore order (`ignore_order`, true/false): Leave the order out of reports, such as a test order.
- Custom status (`custom_status`, text): A status of your own to filter by.
- Custom number (`custom_number`, number): A number of your own.
- Custom text (`custom_string`, text): Text of your own, such as a note.

**Outputs**

- `fields` (list): The values sent
- `message` (text): Triple Whale's own reply
- `order_id` (text): The order
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "fields": [
    "shipping_costs"
  ],
  "message": "Order enrichment successfully received.",
  "order_id": "5123456789",
  "success": true
}
```

### Check API key

Check the connection's API key works, with what Triple Whale says about it.

**Inputs**: None.

**Outputs**

- `details` (object): What Triple Whale says about the key
- `shop` (text): The connection's shop
- `valid` (true/false): True when the key works

**Example output**

```json
{
  "details": {},
  "shop": "example.myshopify.com",
  "valid": true
}
```

### Get orders with attribution

List orders placed in a period with the ad that first brought each customer and the pages they viewed before buying. Gets one page; run it again with the next page to see more.

**Inputs**

- From (`start_time`, date and time, required): The start of the period.
- To (`end_time`, date and time, required): The end of the period.
- Page (`page`, number): Which page, from 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many orders per page, 1 to 100. Defaults to 50. From 1 to 100.
- Leave out journeys (`exclude_journey`, true/false): Skip the pages each customer viewed, for a smaller, faster answer.

**Outputs**

- `count` (number): How many on this page
- `end_time` (text): The period's end (UTC)
- `has_more` (true/false): Whether there is a next page
- `next_page` (number): The next page's number, 0 if none
- `orders` (list): The orders
- `page` (number): This page's number
- `start_time` (text): The period's start (UTC)
- `total_for_range` (number): How many in the whole period

**Example output**

```json
{
  "count": 1,
  "end_time": "2026-11-17T23:59:59Z",
  "has_more": false,
  "next_page": 0,
  "orders": [
    {
      "attribution": {
        "firstClick": [
          {
            "adId": "120200000000003",
            "adsetId": "120200000000002",
            "campaignId": "120200000000001",
            "clickDate": "2026-11-16T09:12:00.000Z",
            "source": "facebook-ads"
          }
        ]
      },
      "created_at": "2026-11-17T14:03:00.000Z",
      "currency": "USD",
      "customer_id": 6123456789,
      "journey": [
        {
          "event": "add2c",
          "path": "/products/blue-mug",
          "productId": "7123456789",
          "time": "2026-11-17T13:58:00.000Z"
        }
      ],
      "order_id": 5123456789,
      "order_name": "#1001",
      "total_price": "84.00"
    }
  ],
  "page": 1,
  "start_time": "2026-11-17T00:00:00Z",
  "total_for_range": 1
}
```

### Get summary metrics

Get the shop's Summary Page metrics, such as revenue and orders, for a period of days.

**Inputs**

- From (`start_date`, date, required): The first day of the period.
- To (`end_date`, date, required): The last day of the period (the same day for one day).
- Only these metrics (`metric_names`, list): Metric names to keep, such as revenue and orders. Leave empty for all.
- Hour of today (`today_hour`, number): For a period that includes today, the hour (1 to 25) to count up to. Defaults to 25. From 1 to 25.

**Outputs**

- `count` (number): How many metrics
- `end_date` (text): The period's last day
- `metrics` (list): Each metric's name and value
- `start_date` (text): The period's first day
- `values` (object): Each metric's value, by its name

**Example output**

```json
{
  "count": 2,
  "end_date": "2026-11-16",
  "metrics": [
    {
      "metricName": "revenue",
      "value": 12345.67
    },
    {
      "metricName": "orders",
      "value": 345
    }
  ],
  "start_date": "2026-11-10",
  "values": {
    "orders": 345,
    "revenue": 12345.67
  }
}
```

### Request customer data deletion

Ask Triple Whale to delete or mask what it holds on customers, found by their email addresses or phone numbers. It can't be undone.

**Inputs**

- Emails (`emails`, list): The customers' email addresses.
- Phones (`phones`, list): The customers' phone numbers.

**Outputs**

- `emails` (list): The email addresses sent
- `message` (text): Triple Whale's own reply
- `phones` (list): The phone numbers sent
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "emails": [
    "jo@example.com"
  ],
  "message": "Request created successfully",
  "phones": [],
  "success": true
}
```

### Run SQL query

Run a SQL query on the shop's Triple Whale tables (orders_table, ads_table, pixel_joined_tvf and the rest) for a period, and get the rows.

**Inputs**

- Query (`query`, text, required): The SQL, with @startDate and @endDate where the period goes. Name the columns you want rather than SELECT *.
- From (`start_date`, date, required): The first day of the period.
- To (`end_date`, date, required): The last day of the period (the same day for one day).
- Currency (`currency`, text): The currency to report amounts in, such as EUR. Defaults to the shop's.

**Outputs**

- `count` (number): How many rows
- `message` (text): Triple Whale's own reply
- `rows` (list): The rows, one object per row

**Example output**

```json
{
  "count": 1,
  "message": "The query was executed successfully.",
  "rows": [
    {
      "channel": "facebook-ads",
      "spend": 345
    }
  ]
}
```

### Send ad figures

Send a day's spend, clicks and conversions for a campaign, ad set or ad on an ad platform Triple Whale doesn't connect to. Sending the same day and IDs again replaces them.

**Inputs**

- Channel (`channel`, text, required): The ad platform. Pick one of Triple Whale's channels, or type your own name for one it doesn't list.
- Day (`event_date`, date, required): The day the figures are for.
- Currency (`currency`, text, required): The three-letter currency code the amounts are in, such as USD.
- Ad account ID (`channel_account_id`, text): The ad account's ID on the platform. Keep it the same on every send.
- Campaign ID (`campaign_id`, text): The campaign's ID on the ad platform.
- Campaign name (`campaign_name`, text): The campaign's name. Needed with its ID.
- Campaign status (`campaign_status`, text): Whether the campaign is running. Needed with its ID. One of: `ACTIVE`, `PAUSED`.
- Ad set ID (`adset_id`, text): The ad set's ID on the ad platform.
- Ad set name (`adset_name`, text): The ad set's name. Needed with its ID.
- Ad set status (`adset_status`, text): Whether the ad set is running. Needed with its ID. One of: `ACTIVE`, `PAUSED`.
- Ad ID (`ad_id`, text): The ad's ID on the ad platform.
- Ad name (`ad_name`, text): The ad's name. Needed with its ID.
- Ad status (`ad_status`, text): Whether the ad is running. Needed with its ID. One of: `ACTIVE`, `PAUSED`.
- Ad image address (`ad_image_url`, text): The address of the ad's thumbnail.
- Spend (`spend`, number): What was spent that day.
- Impressions (`impressions`, number): How many times it was shown.
- Clicks (`clicks`, number): How many clicks.
- Conversions (`conversions`, number): How many purchases.
- Conversion value (`conversion_value`, number): The revenue from those purchases.
- Visits (`visits`, number): How many visits.
- Last updated (`updated_at`, date and time): When the record last changed on your side.

**Outputs**

- `channel` (text): The channel
- `event_date` (text): The day
- `message` (text): Triple Whale's own reply
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "channel": "reddit",
  "event_date": "2026-11-16",
  "message": "Ad record successfully received.",
  "success": true
}
```

### Send customer

Send a customer from a sales platform Triple Whale doesn't connect to. Sending the same customer ID again replaces the whole record. Not for Shopify, BigCommerce or WooCommerce customers.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer's ID. Sending the same ID again replaces the customer.
- Email (`email_address`, text): Their email address.
- Phone (`phone`, text): Their phone number.
- First name (`first_name`, text): Their first name.
- Last name (`last_name`, text): Their last name.
- Display name (`display_name`, text): The name to show for them.
- Created at (`created_at`, date and time): When they became a customer.
- Tags (`customer_tags`, list): Their tags.
- Amount spent (`amount_spent`, number): How much they have spent in total.
- Orders (`orders`, number): How many orders they have placed.
- Last order ID (`last_order_id`, text): Their most recent order.
- Address line 1 (`address1`, text): Their default address.
- Address line 2 (`address2`, text): The second line of it.
- City (`city`, text): The address's city.
- State or province (`state`, text): The address's state or province.
- State code (`state_code`, text): Its code, such as CA.
- ZIP or postal code (`zip_code`, text): The address's postal code.
- Country (`country`, text): The address's country.
- Country code (`country_code`, text): Its two-letter code, such as US.
- Note (`note`, text): A note on the customer.
- Status (`status`, text): Their status in your system.
- Tax exempt (`tax_exempt`, true/false): Whether they don't pay tax.
- Email marketing consent (`email_marketing_consent_status`, text): Their email marketing consent, such as subscribed.
- Platform (`platform`, text): The sales platform's name, if not custom-msp. Use the same value on orders and products so product costs apply to orders.
- Platform account ID (`platform_account_id`, text): The account on that platform, if not custom-msp. Use the same value on orders and products.

**Outputs**

- `customer_id` (text): The customer sent
- `message` (text): Triple Whale's own reply
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "customer_id": "cus_1001",
  "message": "Customer record successfully received.",
  "success": true
}
```

### Send email or SMS figures

Send a day's figures for an email, SMS or direct mail campaign or flow from a tool Triple Whale doesn't connect to. Sending the same day and IDs again replaces them.

**Inputs**

- Day (`event_date`, date, required): The day the figures are for, in the shop's time zone.
- Currency (`currency`, text, required): The three-letter currency code the amounts are in, such as USD.
- Channel (`channel`, text): How it was sent, such as email, sms or directmail. Defaults to directmail.
- Account ID (`account_id`, text): Your account's ID on the sending platform.
- Type (`campaign_type`, text): A one-time campaign or an automated flow. Defaults to campaign. One of: `campaign` (Campaign (one-time send, default)), `flow` (Flow (automated series)).
- Campaign ID (`campaign_id`, text): The campaign's ID.
- Campaign name (`campaign_name`, text): The campaign's name.
- Campaign status (`campaign_status`, text): Its status, such as sent, scheduled or draft.
- Flow step ID (`flow_action_id`, text): For a flow, the step's ID.
- Flow step name (`flow_action_name`, text): For a flow, the step's name.
- Message ID (`message_id`, text): The message (or A/B variant) ID.
- Message name (`message_name`, text): The message's name.
- Subject (`message_subject`, text): The email's subject line.
- Variation (`message_variation`, text): The A/B variation.
- Sent (`sent`, number): How many were sent.
- Delivered (`delivered`, number): How many were delivered.
- Opened (`opened`, number): How many unique opens.
- Clicks (`clicks`, number): How many clicks.
- Received (`received`, number): How many were received.
- Purchases (`purchases`, number): How many purchases it led to.
- Conversion value (`conversion_value`, number): The revenue from those purchases.
- Cost (`spend`, number): What the send cost.
- Unsubscribed (`unsubscribed`, number): How many unsubscribed.
- Spam complaints (`marked_as_spam`, number): How many marked it as spam.
- Last updated (`updated_at`, date and time): When the record last changed on your side.

**Outputs**

- `event_date` (text): The day
- `message` (text): Triple Whale's own reply
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "event_date": "2026-11-16",
  "message": "Email/SMS record successfully received.",
  "success": true
}
```

### Send offline event

Send an event that happened away from your site, such as a lead, a booked demo or a custom event, to the Triple Pixel, matched to the person by email, phone or your own ID.

**Inputs**

- Event (`event_type`, text, required): What happened. One of: `lead`, `mql` (Marketing qualified lead (MQL)), `sql` (Sales qualified lead (SQL)), `opportunity`, `book_demo` (Booked a demo), `custom` (Custom event).
- Email (`email`, text): The person's email. Give this, a phone or an external ID.
- Phone (`phone`, text): The person's phone number.
- External ID (`external_id`, text): The person's ID in your own system.
- Event name (`event_name`, text): For a custom event, its name, such as trial_started.
- Event ID (`event_id`, text): An ID of your own, so the same event sent twice counts once.
- When (`occurred_at`, date and time): When it happened. Defaults to now.
- Source (`source`, text): For a custom event, the channel to credit, such as facebook-ads.
- Campaign (`campaign`, text): For a custom event, the campaign to credit.
- Ad set (`adset`, text): For a custom event, the ad set to credit.
- Ad (`ad`, text): For a custom event, the ad to credit.
- Extra properties (`properties`, object): For a custom event, more values to send with it (numbers, text or true/false), such as {"value": 10}. 3 KB at most in all.

**Outputs**

- `event_id` (text): Your event ID, empty if none
- `event_type` (text): The event type
- `message` (text): Triple Whale's own reply
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "event_id": "",
  "event_type": "lead",
  "message": "Pixel event successfully received.",
  "success": true
}
```

### Send order

Send an order from a sales platform Triple Whale doesn't connect to. Sending the same order ID and time again replaces the whole order, so a field left empty is cleared.

**Inputs**

- Order ID (`order_id`, text, required): The order's ID in your sales platform. Sending the same ID and creation time again replaces the order.
- Placed at (`created_at`, date and time, required): When the order was placed. Keep it the same when you send the order again.
- Currency (`currency`, text, required): The three-letter currency code the amounts are in, such as USD.
- Order revenue (`order_revenue`, number, required): The order's total after discounts, shipping, fees and taxes.
- Customer ID (`customer_id`, text, required): The customer's ID in your system.
- Customer email (`customer_email`, text): The customer's email address. Give this or their phone.
- Customer phone (`customer_phone`, text): The customer's phone number. Give this or their email.
- Customer first name (`customer_first_name`, text): The customer's first name.
- Customer last name (`customer_last_name`, text): The customer's last name.
- Order name (`name`, text): The order's name or number as shoppers see it, such as #1001.
- Status (`status`, text): The order's status, such as completed or pending.
- Line items (`line_items`, list): The products bought, each with id, product_id, variant_id, price and quantity (and optionally name, product_name, variant_name, sku).
- Discount codes (`discount_codes`, list): Codes used, each with code, amount and type (percentage or fixed_amount).
- Total discounts (`total_discounts`, number): All discounts on the order, including shipping discounts.
- Taxes (`taxes`, number): The total tax on the order.
- Taxes included (`taxes_included`, true/false): Whether prices include tax.
- Shipping charged (`shipping_price`, number): What the buyer paid for shipping.
- Shipping costs (`shipping_costs`, number): What shipping cost you. Used when Default Shipping Costs is chosen in Triple Whale's cost settings.
- Other expenses (`custom_expenses`, number): Other costs of the order.
- Shipping address (`shipping_address`, object): Where it was sent: address_1, address_2, city, zip, province_code, country and country_code.
- Refunds (`refunds`, list): Refunds on the order, each with refund_id, refunded_at and total_refund (and optionally line_items, total_tax_refund, total_shipping_refund, tags, void).
- Tags (`tags`, list): Tags to mark the order with, such as holiday_sale.
- Source (`source_name`, text): Where the order came from, such as web or pos.
- Payment gateways (`payment_gateway_names`, list): How it was paid, such as paypal or gift_card. Needed for payment fees.
- New customer (`is_new_customer`, text): Whether this is the customer's first order. Leave empty to let Triple Whale work it out. One of: `yes` (Yes, a new customer), `no` (No, a returning customer).
- Subscription ID (`subscription_id`, text): The subscription the order belongs to.
- Platform (`platform`, text): The sales platform's name, if not custom-msp. Use the same value on orders and products so product costs apply to orders.
- Platform account ID (`platform_account_id`, text): The account on that platform, if not custom-msp. Use the same value on orders and products.
- Last updated (`updated_at`, date and time): When the record last changed on your side.
- Void order (`void`, true/false): Remove the order (and its refunds) from Triple Whale's reports. Send the whole order again with this on.

**Outputs**

- `created_at` (text): Its time, as sent (UTC)
- `message` (text): Triple Whale's own reply
- `order_id` (text): The order sent
- `success` (true/false): True once Triple Whale took it
- `voided` (true/false): Whether it was voided

**Example output**

```json
{
  "created_at": "2026-11-17T14:03:00Z",
  "message": "Order record successfully received.",
  "order_id": "1001",
  "success": true,
  "voided": false
}
```

### Send orders in bulk

Send up to 1,000 orders from a sales platform Triple Whale doesn't connect to, each as 'Send order' takes it. An order sent before is replaced.

**Inputs**

- Orders (`orders`, list, required): The orders, each with order_id, created_at, currency, order_revenue and customer (with id and an email or phone).

**Outputs**

- `count` (number): How many orders were sent
- `message` (text): Triple Whale's own reply
- `order_ids` (list): The orders sent
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "count": 2,
  "message": "Orders successfully received.",
  "order_ids": [
    "1001",
    "1002"
  ],
  "success": true
}
```

### Send post-purchase survey answer

Send a customer's answer to a post-purchase survey (such as how they heard of you) for an order already in Triple Whale, to use in attribution.

**Inputs**

- Order ID (`order_id`, text, required): The order the answer is for. It must already be in Triple Whale.
- Answer (`response`, text): What the customer answered, such as Instagram.
- Question (`question_text`, text): The question asked, such as How did you hear about us?
- Question ID (`question_id`, text): The question's ID. Without it the answer is used for attribution but not shown in the survey report.
- Answer ID (`response_id`, text): The answer's own ID.
- Source (`source`, text): The channel to credit, such as facebook-ads. Leave empty to let Triple Whale read it from the answer.
- Use for attribution (`include_in_attribution`, true/false): Count the answer in the Total Impact and Triple Attribution models.
- Order total (`total_price`, number): The order's total.
- Answered at (`created_at`, date and time): When the survey was answered.
- Platform (`platform`, text): The sales platform's name, if not custom-msp. Use the same value on orders and products so product costs apply to orders.
- Platform account ID (`platform_account_id`, text): The account on that platform, if not custom-msp. Use the same value on orders and products.

**Outputs**

- `message` (text): Triple Whale's own reply
- `order_id` (text): The order
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "message": "PPS record successfully received.",
  "order_id": "1001",
  "success": true
}
```

### Send product

Send a product from a sales platform Triple Whale doesn't connect to, with its variants, prices and costs. Sending the same product ID again replaces it.

**Inputs**

- Product ID (`product_id`, text, required): The product's ID; the same ID as on orders' line items.
- Title (`product_title`, text, required): The product's name.
- Variants (`variants`, list): Each with variant_id and variant_title, and optionally variant_price, variant_cost, sku, handling_fee, inventory_quantity, image_src and compare_at_price. Leave empty for a product with no variants.
- Vendor (`vendor`, text): Who makes or supplies it.
- Type (`product_type`, text): The product's type or category.
- Status (`product_status`, text): Its status, such as active, draft or archived. Defaults to active.
- Tags (`product_tags`, list): The product's tags.
- Collections (`collections`, list): The collections it is in.
- Images (`images`, list): Each with image_id and image_src (the image's address).
- Platform (`platform`, text): The sales platform's name, if not custom-msp. Use the same value on orders and products so product costs apply to orders.
- Platform account ID (`platform_account_id`, text): The account on that platform, if not custom-msp. Use the same value on orders and products.
- Created at (`created_at`, date and time): When the product was created.
- Last updated (`updated_at`, date and time): When the record last changed on your side.

**Outputs**

- `message` (text): Triple Whale's own reply
- `product_id` (text): The product sent
- `success` (true/false): True once Triple Whale took it
- `variant_count` (number): How many variants were sent

**Example output**

```json
{
  "message": "Product record successfully received.",
  "product_id": "blue-mug",
  "success": true,
  "variant_count": 1
}
```

### Send subscription

Send a subscription from a platform Triple Whale doesn't connect to, with its items and status. Sending the same ID again replaces it.

**Inputs**

- Subscription ID (`subscription_id`, text, required): The subscription's ID. Sending the same ID again replaces it.
- Started at (`created_at`, date and time, required): When the subscription was created.
- Currency (`currency`, text, required): The three-letter currency code the amounts are in, such as USD.
- Status (`status`, text, required): The subscription's status, such as active or canceled.
- Customer ID (`customer_id`, text, required): The customer's ID in your system.
- Items (`subscription_items`, list, required): At least one, each with subscription_item_id, created_at, status (active, canceled, expired or deleted), interval (day, week, month or year), interval_count, price and quantity.
- Customer email (`customer_email`, text): The customer's email address. Give this or their phone.
- Customer phone (`customer_phone`, text): The customer's phone number. Give this or their email.
- Customer first name (`customer_first_name`, text): The customer's first name.
- Customer last name (`customer_last_name`, text): The customer's last name.
- Canceled at (`canceled_at`, date and time): When it was canceled, if it was.
- Ended at (`ended_at`, date and time): When it ended, if it has.
- Cancellation reason (`cancellation_reason`, text): Why it was canceled.
- Cancellation comments (`cancellation_comments`, text): Anything else said about the cancellation.
- Notes (`metadata`, text): Notes to keep with the subscription.
- Platform (`platform`, text): The sales platform's name, if not custom-msp. Use the same value on orders and products so product costs apply to orders.
- Platform account ID (`platform_account_id`, text): The account on that platform, if not custom-msp. Use the same value on orders and products.
- Last updated (`updated_at`, date and time): When the record last changed on your side.

**Outputs**

- `message` (text): Triple Whale's own reply
- `subscription_id` (text): The subscription sent
- `success` (true/false): True once Triple Whale took it

**Example output**

```json
{
  "message": "Subscription record successfully received.",
  "subscription_id": "sub_1001",
  "success": true
}
```

### Set a product's cost

Set what a product, or one of its variants, costs you, for a product from Shopify, BigCommerce, WooCommerce or another platform Triple Whale connects to.

**Inputs**

- Product ID (`product_id`, text, required): The product's ID on that platform.
- Cost (`variant_cost`, number, required): What one costs you.
- Variant ID (`variant_id`, text): The variant, if only one variant's cost is set.

**Outputs**

- `message` (text): Triple Whale's own reply
- `product_id` (text): The product
- `success` (true/false): True once Triple Whale took it
- `variant_id` (text): The variant, empty if none

**Example output**

```json
{
  "message": "Product enrichment successfully received.",
  "product_id": "7123456789",
  "success": true,
  "variant_id": ""
}
```
