# Hyros

> Work with your Hyros ad tracking: find and update leads, sales, calls and subscriptions, record orders, refunds, calls, carts and clicks, and pull attribution reports by ad or ad account. Start workflows on new leads, sales, calls, subscriptions and refunds.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/hyros

## Actions

### Create call

Record a call, such as a booked sales call, and whether it qualified. Creates the lead if Hyros has none yet. A call with the same external id is updated instead.

**Inputs**

- Call name (`name`, text, required): The call's name.
- Email (`email`, text, required): The email of the lead who made the call.
- First name (`first_name`, text): The lead's first name.
- Last name (`last_name`, text): The lead's last name.
- Phone numbers (`phone_numbers`, list): The lead's phone numbers.
- Call state (`state`, text): Whether the call qualified. One of: `QUALIFIED`, `UNQUALIFIED`, `CANCELLED`, `NO_SHOW` (No-show).
- Qualification (`qualification`, text): Your own name for how it qualified, such as Hot lead.
- Date (`date`, date and time): When the call happened. Leave empty for now.
- External ID (`external_id`, text): The call's id in your calendar or phone app.
- Lead stage (`stage`, text): A lead stage to put the lead in, such as MQL.
- IP addresses (`lead_ips`, list): The lead's IP addresses, which Hyros uses to match them to ad clicks.

**Outputs**

- `email` (text): The lead's email, as sent
- `external_id` (text): The external id sent, if any
- `name` (text): The call's name
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "email": "jo@example.com",
  "external_id": "c1843a78418c925",
  "name": "Discovery call",
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create cart

Record a cart someone filled but hasn't bought yet, for add-to-cart reporting. Creates the lead if Hyros has none yet. Returns the cart id to link a later order to.

**Inputs**

- Email (`email`, text): The lead's email. An email or a phone number is needed.
- Phone numbers (`phone_numbers`, list): The lead's phone numbers. An email or a phone number is needed.
- Product name (`product_name`, text): The product bought, at least 3 characters. Needed unless 'Items' is given.
- Price (`price`, number): The price of one. Needed with 'Product name'. At least 0.
- Quantity (`quantity`, number): How many. 1 if left empty. At least 1.
- SKU (`sku`, text): The product's SKU.
- Items (advanced) (`items`, list): Several products at once, as a list such as [{"name": "T-shirt", "price": 9.5, "quantity": 3, "sku": "TS-BLU"}]. Each takes name, price, externalId, quantity, sku; name and price are needed. When given it replaces the single-product fields.
- Cart ID (`cart_id`, text): Your id for the cart. Leave empty and Hyros makes one.
- First name (`first_name`, text): The lead's first name.
- Last name (`last_name`, text): The lead's last name.
- Date (`date`, date and time): When the cart was filled. Leave empty for now.
- Currency (`currency`, text): The three-letter currency code, such as USD. Leave empty for the account's currency.
- Price format (`price_format`, text): How prices are written. Decimal unless you choose whole cents. One of: `DECIMAL` (Decimal, such as 15.50 (default)), `INTEGER` (Whole cents, such as 1550).
- IP addresses (`lead_ips`, list): The lead's IP addresses, which Hyros uses to match them to ad clicks.

**Outputs**

- `cart_id` (text): The cart's id, to pass to 'Create order'
- `items` (list): The items sent
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "cart_id": "d49b708b3df50505869ca54f026e7c97a4959b587605f14f91c7e289de9f80bd",
  "items": [
    {
      "name": "T-shirt, blue",
      "price": 9.5,
      "quantity": 3,
      "sku": "TS-BLU"
    }
  ],
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create click

Record a click on one of your pages, from an ad or an organic source, so Hyros can attribute what the visitor does next. Give an email to tie it to a lead.

**Inputs**

- Page (`referrer_url`, text, required): The address of the page clicked to.
- Session ID (`session_id`, text): An id for the visitor's session, the same for all their clicks.
- Email (`email`, text): The visitor's email, to tie the click to a lead.
- Phone numbers (`phones`, list): The visitor's phone numbers.
- IP address (`ip`, text): The visitor's IP address, which helps match sales.
- Source (`source_tag`, text): The source it came from, by its tag (starting with @). A new tag makes a new source.
- Organic (`organic`, text): Yes if the source is organic. One of: `true` (Yes), `false` (No).
- Ad platform (`platform`, text): The ad platform. One of: `FACEBOOK`, `GOOGLE`, `TIKTOK`, `SNAPCHAT`, `LINKEDIN`, `TWITTER` (X (Twitter)), `PINTEREST`, `BING` (Microsoft (Bing)).
- Ad set or campaign ID (`ad_source_id`, text): For an ad platform: the ad set, campaign, ad group or ad squad id.
- Ad ID (`ad_id`, text): For Facebook and Google: the ad's id.
- Platform click ID (`ad_click_id`, text): The click's id on the ad platform, such as a gclid or fbclid.
- Previous page (`previous_url`, text): The page the visitor was on before.
- Browser (`user_agent`, text): The visitor's browser user agent.
- Lead tag (`tag`, text): A tag to give the lead.
- Date (`date`, date and time): When the click happened. Leave empty for now.

**Outputs**

- `referrer_url` (text): The page sent
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "referrer_url": "https://example.com/offer",
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create lead

Add a lead with their name, tags and stage. If Hyros already has a lead with that email or phone, the tags and details are added to it. A tag that matches a product records a sale of it.

**Inputs**

- Email (`email`, text): The lead's email. An email or a phone number is needed.
- Phone numbers (`phone_numbers`, list): The lead's phone numbers. An email or a phone number is needed.
- First name (`first_name`, text): The lead's first name.
- Last name (`last_name`, text): The lead's last name.
- Tags (`tags`, list): Tags to give the lead, such as !opted-in.
- IP addresses (`lead_ips`, list): The lead's IP addresses, which Hyros uses to match them to ad clicks.
- Lead stage (`stage`, text): A lead stage to put the lead in, such as MQL.
- Ad optimization consent (`ad_optimization_consent`, text): Whether the lead agreed to their data being used to optimize ads. One of: `GRANTED`, `DENIED`, `UNSPECIFIED`.

**Outputs**

- `email` (text): The lead's email, as sent
- `phone_numbers` (list): The phone numbers sent
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "email": "jo@example.com",
  "phone_numbers": [
    "202-555-0184"
  ],
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create order

Record an order with its products, so Hyros attributes the revenue to the ad behind it. Creates the lead if Hyros has none yet. Returns the order id, made for you when you give none.

**Inputs**

- Email (`email`, text): The lead's email. An email or a phone number is needed.
- Phone numbers (`phone_numbers`, list): The lead's phone numbers. An email or a phone number is needed.
- First name (`first_name`, text): The lead's first name.
- Last name (`last_name`, text): The lead's last name.
- Product name (`product_name`, text): The product bought, at least 3 characters. Needed unless 'Items' is given.
- Price (`price`, number): The price of one, including its cost of goods. Needed with 'Product name'. At least 0.
- Quantity (`quantity`, number): How many. 1 if left empty. At least 1.
- Product tag (`product_tag`, text): The product's tag in Hyros, starting with $. Leave empty to let Hyros make one from the name.
- Cost of goods (`cost_of_goods`, number): What one costs you to make, already included in the price. At least 0.
- Items (advanced) (`items`, list): Several products at once, as a list such as [{"name": "T-shirt", "price": 15.5, "quantity": 2}]. Each takes name, price, externalId, quantity, costOfGoods, taxes, itemDiscount, packages, tag, categoryName; name and price are needed. When given it replaces the single-product fields.
- Order ID (`order_id`, text): Your id for the order: letters, digits and _ - . : only. Leave empty and one is made for you.
- Date (`date`, date and time): When the order was placed. Leave empty for now.
- Currency (`currency`, text): The three-letter currency code, such as USD. Leave empty for the account's currency.
- Price format (`price_format`, text): How prices are written. Decimal unless you choose whole cents. One of: `DECIMAL` (Decimal, such as 15.50 (default)), `INTEGER` (Whole cents, such as 1550).
- Taxes (`taxes`, number): The order's taxes, spread over its items. At least 0.
- Shipping cost (`shipping_cost`, number): The order's shipping, spread over its items. At least 0.
- Order discount (`order_discount`, number): A discount on the whole order, spread evenly over its items. At least 0.
- Lead stage (`stage`, text): A lead stage to put the lead in, such as MQL.
- Referring lead's email (`parent_email`, text): The email of the lead who brought this one in. The purchase is then credited to that lead.
- IP addresses (`lead_ips`, list): The lead's IP addresses, which Hyros uses to match them to ad clicks.
- Cart ID (`cart_id`, text): The cart this order came from, if any.
- Subscription ID (`external_subscription_id`, text): The subscription this order is a payment of, if any (its id in your billing app).

**Outputs**

- `email` (text): The lead's email, as sent
- `items` (list): The items sent
- `order_id` (text): The order's id, to refund or update it
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "email": "jo@example.com",
  "items": [
    {
      "name": "T-shirt, blue",
      "price": 15.5,
      "quantity": 2,
      "tag": "$t-shirt"
    }
  ],
  "order_id": "lodol-3f2a9c41d07b4e5f8a61",
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create product

Create a product with its price and category. Hyros makes its tag from the name.

**Inputs**

- Name (`name`, text, required): The product's name.
- Price (`price`, number, required): The product's price. At least 0.
- Category (`category`, text): The product's category.
- Packages (`packages`, list): Packages it belongs to, used to attribute recurring sales.

**Outputs**

- `name` (text): The product's name
- `price` (number): The product's price
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "name": "Coaching program",
  "price": 997,
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create source

Create a traffic source: an organic one, such as Instagram posts, or one for an ad set or campaign on an ad platform.

**Inputs**

- Name (`name`, text, required): The source's name.
- Organic (`organic`, text): Yes for an organic (unpaid) source. One of: `true` (Yes), `false` (No).
- Category (`category`, text): The source's category.
- Goal (`goal`, text): The source's goal, such as opt ins.
- Traffic source (`traffic_source`, text): Its traffic source, such as organic.
- Disregard (`disregard`, text): Yes to have attribution ignore this source. One of: `true` (Yes), `false` (No).
- Ad platform (`platform`, text): The ad platform. One of: `FACEBOOK`, `GOOGLE`, `TIKTOK`, `SNAPCHAT`, `LINKEDIN`, `TWITTER` (X (Twitter)), `PINTEREST`, `BING` (Microsoft (Bing)).
- Ad set or campaign ID (`ad_source_id`, text): For an ad platform: the Facebook ad set, Google campaign, TikTok ad group, Snapchat ad squad or LinkedIn campaign id.
- Ad account ID (`ad_account_id`, text): For an ad platform: the ad account's id.
- Campaign ID (`campaign_id`, text): For Facebook: the campaign the ad set is in.
- Google ad type (`google_ad_type`, text): For Google: display or video. One of: `DISPLAY`, `VIDEO`.

**Outputs**

- `name` (text): The source's name
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "name": "Instagram posts",
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Create subscription

Record a subscription with its price, period, status and dates, so Hyros attributes recurring revenue. Creates the lead if Hyros has none yet.

**Inputs**

- Email (`email`, text): The lead's email. An email or a phone number is needed.
- Phone numbers (`phone_numbers`, list): The lead's phone numbers. An email or a phone number is needed.
- Status (`status`, text, required): The subscription's status. One of: `ACTIVE`, `TRIALING`, `CANCELED`, `PAST_DUE` (Past due), `INCOMPLETE`, `INCOMPLETE_EXPIRED` (Incomplete, expired), `UNPAID`, `COMPLETED`, `PAUSED`.
- Price (`price`, number, required): What each payment costs. At least 0.
- Billed (`periodicity`, text, required): How often it is billed. One of: `DAY` (Daily), `WEEK` (Weekly), `MONTH` (Monthly), `QUARTER` (Quarterly), `YEAR` (Yearly).
- Start date (`start_date`, date and time, required): When it started.
- Name (`name`, text): The subscription's name, such as Monthly plan.
- Subscription ID (`subscription_id`, text): Its id in your billing app.
- Plan ID (`plan_id`, text): The plan's id in your billing app.
- End date (`end_date`, date and time): When it ended.
- Canceled on (`cancel_at_date`, date and time): When it was canceled.
- Trial start (`trial_start_date`, date and time): When its free trial started.
- Trial end (`trial_end_date`, date and time): When its free trial ended.
- First name (`first_name`, text): The lead's first name.
- Last name (`last_name`, text): The lead's last name.
- Referring lead's email (`parent_email`, text): The email of the lead who brought this one in. The purchase is then credited to that lead.
- Lead stage (`stage`, text): A lead stage to put the lead in, such as MQL.
- IP addresses (`lead_ips`, list): The lead's IP addresses, which Hyros uses to match them to ad clicks.

**Outputs**

- `email` (text): The lead's email, as sent
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request
- `status` (text): The status sent
- `subscription_id` (text): The subscription id sent, if any

**Example output**

```json
{
  "email": "jo@example.com",
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK",
  "status": "ACTIVE",
  "subscription_id": "sub_1Pq2r3"
}
```

### Delete call

Delete a call from Hyros.

**Inputs**

- Call ID (`call_id`, text, required): The call's id, from 'List calls' or a trigger.

**Outputs**

- `call_id` (text): The call deleted
- `deleted` (true/false): Always true once deleted
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "call_id": "cll-eec11d39e6ec1843a78418c925d2a42a44e9fba95638c9ceac41cc2c3362e8dd",
  "deleted": true,
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Get ad account attribution report

Get the same columns for a whole ad account over a range of days, as one row or by day, week, month or year.

**Inputs**

- Ad account (`ad_account_id`, text, required): The ad account, as its id on the ad platform.
- Attribution model (`attribution_model`, text, required): Which click gets the credit for a sale. One of: `last_click` (Last click), `first_click` (First click), `scientific`.
- From (`start_date`, date, required): The first day of the report.
- Until (`end_date`, date, required): The last day of the report, included.
- Columns (`fields`, list, required): What to report, such as total revenue, sales and cost. One or more of: `sales`, `revenue`, `calls`, `total_revenue` (Total revenue), `recurring_revenue` (Recurring revenue), `refund`, `unique_sales` (Unique sales), `leads`, `new_leads` (New leads), `cost`, and 80 more.
- Currency (`currency`, text): Report in the account's currency unless you choose US dollars. One of: `user_currency` (My account's currency (default)), `usd` (US dollars).
- Date by click (`day_of_attribution`, text): Yes to count sales from clicks made in the range; no (the default) to count sales made in the range. One of: `true` (Yes), `false` (No).
- Scientific window (days) (`scientific_days_range`, number): For the scientific model: how many days back to look for the first ad, 1 to 30. Hyros's default is 30. From 1 to 30.
- Organic sources (`source_configuration`, text): How to treat organic sources. Hyros ignores them unless you choose. One of: `all_sources` (All sources), `only_organic` (Only organic), `only_paid` (Only paid), `prioritize_organic` (Prioritize organic), `prioritize_paid` (Prioritize paid).
- Leave out recurring sales (`ignore_recurring_sales`, text): Yes to count only first-time sales. One of: `true` (Yes), `false` (No).
- Group by (`group_by`, text): One row for the account, or one per period. One of: `ad_account` (One row for the account (default)), `day` (By day), `week` (By week), `month` (By month), `year` (By year).

**Outputs**

- `count` (number): How many rows
- `rows` (list): The report: one row, or one per period

**Example output**

```json
{
  "count": 1,
  "rows": [
    {
      "cost": 9172.25,
      "end_date": "2026-11-16T23:59:59",
      "id": "205044496234",
      "sales": 64,
      "start_date": "2026-11-01T00:00:00",
      "total_revenue": 9283.41
    }
  ]
}
```

### Get ad attribution report

Get the revenue, sales, calls, cost, ROAS and any other columns Hyros attributes to chosen campaigns, ad sets or ads over a range of days, optionally by day, week, month or year. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Report on (`level`, text, required): What each row is: a campaign, ad set, ad group or ad. One of: `facebook_campaign` (Facebook campaign), `facebook_adset` (Facebook ad set), `facebook_ad` (Facebook ad), `google_campaign` (Google campaign), `google_v2_adgroup` (Google ad group (Google v2 only)), `google_ad` (Google ad), `google_v2_keyword` (Google keyword (Google v2 only)), `tiktok_adgroup` (TikTok ad group), `tiktok_ad` (TikTok ad), `snapchat_adsquad` (Snapchat ad squad), and 7 more.
- Ads (`ad_ids`, list): The campaigns, ad sets or ads to report on, matching 'Report on'. Not needed for Google keywords.
- Attribution model (`attribution_model`, text, required): Which click gets the credit for a sale. One of: `last_click` (Last click), `first_click` (First click), `scientific`.
- From (`start_date`, date, required): The first day of the report.
- Until (`end_date`, date, required): The last day of the report, included.
- Columns (`fields`, list, required): What to report, such as revenue, sales and cost. One or more of: `sales`, `revenue`, `calls`, `total_revenue` (Total revenue), `recurring_revenue` (Recurring revenue), `refund`, `unique_sales` (Unique sales), `leads`, `new_leads` (New leads), `cost`, and 82 more.
- Currency (`currency`, text): Report in the account's currency unless you choose US dollars. One of: `user_currency` (My account's currency (default)), `usd` (US dollars).
- Date by click (`day_of_attribution`, text): Yes to count sales from clicks made in the range; no (the default) to count sales made in the range. One of: `true` (Yes), `false` (No).
- Scientific window (days) (`scientific_days_range`, number): For the scientific model: how many days back to look for the first ad, 1 to 30. Hyros's default is 30. From 1 to 30.
- Organic sources (`source_configuration`, text): How to treat organic sources. Hyros ignores them unless you choose. One of: `all_sources` (All sources), `only_organic` (Only organic), `only_paid` (Only paid), `prioritize_organic` (Prioritize organic), `prioritize_paid` (Prioritize paid).
- Leave out recurring sales (`ignore_recurring_sales`, text): Yes to count only first-time sales. One of: `true` (Yes), `false` (No).
- Group by (`group_by`, text): One row per ad, or one per ad and period. One of: `source_link` (One row per ad (default)), `day` (By day), `week` (By week), `month` (By month), `year` (By year).
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `count` (number): How many records are on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page
- `rows` (list): The report: one row per ad (and period)

**Example output**

```json
{
  "count": 1,
  "next_page_id": "",
  "rows": [
    {
      "calls": 5,
      "campaign_id": "23843648123456789",
      "id": "205044496234",
      "revenue": 997.0,
      "sales": 10
    }
  ]
}
```

### Get lead journey

Get each lead's journey: their sales, calls and carts with the first and last source of each, and the leads linked to them.

**Inputs**

- Lead IDs (`lead_ids`, list, required): The leads (their ids, from 'List leads' or a trigger), up to 50.

**Outputs**

- `count` (number): How many journeys
- `journeys` (list): One journey per lead

**Example output**

```json
{
  "count": 1,
  "journeys": [
    {
      "calls": [],
      "carts": [],
      "lead": {
        "creationDate": "2026-11-04T04:36:41-05:00",
        "email": "jo@example.com",
        "firstName": "Jo",
        "id": "40b5af5444756c2b5e666fcb658affd2a4b455bce3711c43f88763147381e368",
        "ips": [
          "203.0.113.7"
        ],
        "lastName": "Doe",
        "phoneNumbers": [
          "202-555-0184"
        ],
        "provider": {
          "id": "sd54sa56dsa64sd56as4d5a5s",
          "integration": {
            "id": "wef45ewf4we64634",
            "name": "Shopify store",
            "type": "SHOPIFY"
          }
        },
        "tags": [
          "!clicked",
          "@spring-sale",
          "$t-shirt"
        ]
      },
      "linkedLeads": [],
      "sales": [
        {
          "creationDate": "2026-11-04T04:36:41-05:00",
          "firstSource": {
            "adSource": {
              "adAccountId": "887874684917514",
              "adSourceId": "23843648148170123",
              "platform": "FACEBOOK"
            },
            "category": {
              "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
              "name": "Spring sale"
            },
            "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
            "clickId": "fa4567fc3611afeb888e314298",
            "disregarded": false,
            "goal": {
              "id": "cat-909ba403c207fbdfb6344b96f3294342",
              "name": "all"
            },
            "name": "Spring sale ad set",
            "organic": false,
            "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
            "tag": "@spring-sale",
            "trafficSource": {
              "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
              "name": "facebook"
            }
          },
          "id": "sfds65f4ds6f54df",
          "lastSource": {
            "adSource": {
              "adAccountId": "887874684917514",
              "adSourceId": "23843648148170123",
              "platform": "FACEBOOK"
            },
            "category": {
              "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
              "name": "Spring sale"
            },
            "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
            "clickId": "fa4567fc3611afeb888e314298",
            "disregarded": false,
            "goal": {
              "id": "cat-909ba403c207fbdfb6344b96f3294342",
              "name": "all"
            },
            "name": "Spring sale ad set",
            "organic": false,
            "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
            "tag": "@spring-sale",
            "trafficSource": {
              "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
              "name": "facebook"
            }
          },
          "orderId": "ukik651iuk984k",
          "price": {
            "currency": "USD",
            "price": 10.5,
            "refunded": 0
          },
          "quantity": 2,
          "recurring": false
        }
      ]
    }
  ]
}
```

### List calls

Find calls by email, lead, product, id, date or qualification, with their state, lead and first and last source. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Emails (`emails`, list): Only these emails, or emails starting with these, up to 50.
- Lead IDs (`lead_ids`, list): Only these leads (their ids), up to 50.
- Call IDs (`call_ids`, list): Only these calls (their ids), up to 50.
- Product tags (`product_tags`, list): Only these products, by their tag (starting with $), up to 20.
- Qualified (`qualified`, text): Only qualified or only unqualified calls. Both if left empty. One of: `true` (Yes), `false` (No).
- Qualifications (`qualification_stages`, list): Only calls with these custom qualifications, up to 50.
- From (`from_date`, date and time): Only those dated at or after this time.
- Until (`to_date`, date and time): Only those dated at or before this time.
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `calls` (list): The calls on this page
- `count` (number): How many records are on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page

**Example output**

```json
{
  "calls": [
    {
      "creationDate": "Fri Nov 13 08:51:20 UTC 2026",
      "externalId": "c1843a78418c925",
      "firstSource": {
        "adSource": {
          "adAccountId": "887874684917514",
          "adSourceId": "23843648148170123",
          "platform": "FACEBOOK"
        },
        "category": {
          "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
          "name": "Spring sale"
        },
        "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
        "clickId": "fa4567fc3611afeb888e314298",
        "disregarded": false,
        "goal": {
          "id": "cat-909ba403c207fbdfb6344b96f3294342",
          "name": "all"
        },
        "name": "Spring sale ad set",
        "organic": false,
        "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
        "tag": "@spring-sale",
        "trafficSource": {
          "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
          "name": "facebook"
        }
      },
      "id": "cll-eec11d39e6ec1843a78418c925d2a42a44e9fba95638c9ceac41cc2c3362e8dd",
      "lastSource": {
        "adSource": {
          "adAccountId": "887874684917514",
          "adSourceId": "23843648148170123",
          "platform": "FACEBOOK"
        },
        "category": {
          "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
          "name": "Spring sale"
        },
        "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
        "clickId": "fa4567fc3611afeb888e314298",
        "disregarded": false,
        "goal": {
          "id": "cat-909ba403c207fbdfb6344b96f3294342",
          "name": "all"
        },
        "name": "Spring sale ad set",
        "organic": false,
        "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
        "tag": "@spring-sale",
        "trafficSource": {
          "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
          "name": "facebook"
        }
      },
      "lead": {
        "creationDate": "2026-11-04T04:36:41-05:00",
        "email": "jo@example.com",
        "firstName": "Jo",
        "id": "40b5af5444756c2b5e666fcb658affd2a4b455bce3711c43f88763147381e368",
        "ips": [
          "203.0.113.7"
        ],
        "lastName": "Doe",
        "phoneNumbers": [
          "202-555-0184"
        ],
        "tags": [
          "!clicked",
          "@spring-sale",
          "$t-shirt"
        ]
      },
      "name": "Discovery call",
      "qualification": {
        "name": "Qualified",
        "oldName": null
      },
      "qualified": true,
      "score": 1.0,
      "state": "QUALIFIED",
      "tag": "$discovery-call"
    }
  ],
  "count": 1,
  "next_page_id": ""
}
```

### List lead clicks

List the tracked clicks of one lead, found by its id or email: each page, ad platform, source and tracking parameter. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Lead ID (`lead_id`, text): The lead's id. Or leave empty and give its email.
- Lead's email (`email`, text): Find the lead by this email instead.
- From (`from_date`, date and time): Only those dated at or after this time.
- Until (`to_date`, date and time): Only those dated at or before this time.
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `clicks` (list): The clicks on this page
- `count` (number): How many records are on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page

**Example output**

```json
{
  "clicks": [
    {
      "adSpendId": 112331,
      "adspendType": "FACEBOOK",
      "agent": "Mozilla/5.0 (X11; Linux x86_64) Chrome/116.0.0.0 Safari/537.36",
      "cartId": null,
      "date": "Mon Nov 16 21:37:58 UTC 2026",
      "deduplicationParams": {
        "fbpId": "1231332"
      },
      "id": "fcdb598ccxf04025a2fxb2275a55952b",
      "ip": "203.0.113.7",
      "page": "https://www.example.com/product/",
      "parsedParameters": {
        "fbclid": "PAZXh0bgNhZW0B"
      },
      "previousUrl": "https://www.example.com/",
      "sourceLinkName": "Spring sale ad set",
      "trackedUrl": "https://www.example.com/product?fbclid=PAZXh0bgNhZW0B"
    }
  ],
  "count": 1,
  "next_page_id": ""
}
```

### List leads

Find leads by email (or the start of one), id or the date they joined, with their tags, IPs and phone numbers. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Emails (`emails`, list): Only these emails, or emails starting with these, up to 50.
- Lead IDs (`lead_ids`, list): Only these leads (their ids), up to 50.
- From (`from_date`, date and time): Only those dated at or after this time.
- Until (`to_date`, date and time): Only those dated at or before this time.
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `count` (number): How many records are on this page
- `leads` (list): The leads on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "leads": [
    {
      "creationDate": "2026-11-04T04:36:41-05:00",
      "email": "jo@example.com",
      "firstName": "Jo",
      "id": "40b5af5444756c2b5e666fcb658affd2a4b455bce3711c43f88763147381e368",
      "ips": [
        "203.0.113.7"
      ],
      "lastName": "Doe",
      "phoneNumbers": [
        "202-555-0184"
      ],
      "provider": {
        "id": "sd54sa56dsa64sd56as4d5a5s",
        "integration": {
          "id": "wef45ewf4we64634",
          "name": "Shopify store",
          "type": "SHOPIFY"
        }
      },
      "tags": [
        "!clicked",
        "@spring-sale",
        "$t-shirt"
      ]
    }
  ],
  "next_page_id": ""
}
```

### List sales

Find sales by email, lead, product, id or date, recurring or not and refunded or not, with their price, product, lead and first and last source. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Emails (`emails`, list): Only these emails, or emails starting with these, up to 50.
- Lead IDs (`lead_ids`, list): Only these leads (their ids), up to 50.
- Sale IDs (`sale_ids`, list): Only these sales (their ids), up to 50.
- Product tags (`product_tags`, list): Only these products, by their tag (starting with $), up to 20.
- Recurring (`recurring`, text): Only recurring or only first-time sales. Both if left empty. One of: `ALL` (Both (default)), `RECURRING` (Only recurring sales), `NON_RECURRING` (Only first-time sales).
- Refunded (`refunded`, text): Only refunded or only sales not refunded. Both if left empty. One of: `ALL` (Both (default)), `REFUNDED` (Only refunded sales), `NON_REFUNDED` (Only sales not refunded).
- From (`from_date`, date and time): Only those dated at or after this time.
- Until (`to_date`, date and time): Only those dated at or before this time.
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `count` (number): How many records are on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page
- `sales` (list): The sales on this page

**Example output**

```json
{
  "count": 1,
  "next_page_id": "",
  "sales": [
    {
      "creationDate": "Thu Nov 17 10:51:54 UTC 2026",
      "firstSource": {
        "adSource": {
          "adAccountId": "887874684917514",
          "adSourceId": "23843648148170123",
          "platform": "FACEBOOK"
        },
        "category": {
          "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
          "name": "Spring sale"
        },
        "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
        "clickId": "fa4567fc3611afeb888e314298",
        "disregarded": false,
        "goal": {
          "id": "cat-909ba403c207fbdfb6344b96f3294342",
          "name": "all"
        },
        "name": "Spring sale ad set",
        "organic": false,
        "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
        "tag": "@spring-sale",
        "trafficSource": {
          "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
          "name": "facebook"
        }
      },
      "id": "sle-db882bfed1b5280735eb03ac5b9be0c6edf04d7a52204d41f0c6cf6c28ad52234",
      "lastSource": {
        "adSource": {
          "adAccountId": "887874684917514",
          "adSourceId": "23843648148170123",
          "platform": "FACEBOOK"
        },
        "category": {
          "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
          "name": "Spring sale"
        },
        "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
        "clickId": "fa4567fc3611afeb888e314298",
        "disregarded": false,
        "goal": {
          "id": "cat-909ba403c207fbdfb6344b96f3294342",
          "name": "all"
        },
        "name": "Spring sale ad set",
        "organic": false,
        "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
        "tag": "@spring-sale",
        "trafficSource": {
          "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
          "name": "facebook"
        }
      },
      "lead": {
        "creationDate": "2026-11-04T04:36:41-05:00",
        "email": "jo@example.com",
        "firstName": "Jo",
        "id": "40b5af5444756c2b5e666fcb658affd2a4b455bce3711c43f88763147381e368",
        "ips": [
          "203.0.113.7"
        ],
        "lastName": "Doe",
        "phoneNumbers": [
          "202-555-0184"
        ],
        "tags": [
          "!clicked",
          "@spring-sale",
          "$t-shirt"
        ]
      },
      "orderId": "7016953413",
      "price": {
        "currency": "USD",
        "discount": 0,
        "hardCost": null,
        "price": 84.34,
        "refunded": 0.0
      },
      "product": {
        "category": {
          "id": "e958d53903cccd4354abe6cce7b04151",
          "name": "Apparel"
        },
        "id": "9b1b1049ba4dd325fb9b130ecd12e1ff",
        "name": "T-shirt",
        "tag": "$t-shirt"
      },
      "provider": {
        "id": "9b1b1049ba4dd325f30ecd12e1ff",
        "integration": {
          "externalIntegrationType": "STRIPE",
          "id": "9ba4dd325fb9b130ecd1",
          "name": "Stripe integration"
        }
      },
      "qualified": true,
      "quantity": 1,
      "recurring": false,
      "score": 1.0
    }
  ]
}
```

### List sources

List traffic sources: organic ones and the ad sets or campaigns Hyros tracks from each ad platform, with their tags and categories. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Ad platform (`platform`, text): The ad platform. One of: `FACEBOOK`, `GOOGLE`, `TIKTOK`, `SNAPCHAT`, `LINKEDIN`, `TWITTER` (X (Twitter)), `PINTEREST`, `BING` (Microsoft (Bing)).
- Ad set or campaign IDs (`ad_source_ids`, list): Only these, by their id on the ad platform.
- Include organic (`include_organic`, text): Yes to include organic sources. One of: `true` (Yes), `false` (No).
- Include disregarded (`include_disregarded`, text): Yes to include sources attribution ignores. One of: `true` (Yes), `false` (No).
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `count` (number): How many records are on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page
- `sources` (list): The sources on this page

**Example output**

```json
{
  "count": 1,
  "next_page_id": "",
  "sources": [
    {
      "adSource": {
        "adAccountId": "923897907978784",
        "adSourceId": "23843652874910293",
        "platform": "FACEBOOK"
      },
      "category": {
        "id": "cat-c044d31f87bfb9ae9ade087da8583ee0",
        "name": "offline conversions"
      },
      "creationDate": 1677152849000,
      "disregarded": false,
      "goal": {
        "id": "cat-1cb412f139ce7d0ab5d175baa1121dba",
        "name": "all"
      },
      "name": "offline conversions",
      "organic": false,
      "tag": "@offline-conversions",
      "trafficSource": {
        "id": "cat-99444f9605562704afad35045a403150",
        "name": "facebook"
      }
    }
  ]
}
```

### List subscriptions

Find subscriptions by email, lead, product, id, status or start date, with their price, period, lead and sources. Gets one page; to see more, run it again with the next_page_id it gives.

**Inputs**

- Emails (`emails`, list): Only these emails, or emails starting with these, up to 50.
- Lead IDs (`lead_ids`, list): Only these leads (their ids), up to 50.
- Subscription IDs (`subscription_ids`, list): Only these subscriptions (their ids), up to 50.
- Product tags (`product_tags`, list): Only these products, by their tag (starting with $), up to 20.
- Statuses (`statuses`, list): Only subscriptions in these statuses. All if left empty. One or more of: `ACTIVE`, `TRIALING`, `CANCELED`, `PAST_DUE` (Past due), `INCOMPLETE`, `INCOMPLETE_EXPIRED` (Incomplete, expired), `UNPAID`, `COMPLETED`, `PAUSED`.
- From (`from_date`, date and time): Only those dated at or after this time.
- Until (`to_date`, date and time): Only those dated at or before this time.
- Page size (`page_size`, number): How many to return, 1 to 250. From 1 to 250.
- Next page (`page_id`, text): The next_page_id from an earlier run of this step with the same filters, to get the page after it.

**Outputs**

- `count` (number): How many records are on this page
- `next_page_id` (text): Give this as 'Next page' to get the next page; empty on the last page
- `subscriptions` (list): The subscriptions on this page

**Example output**

```json
{
  "count": 1,
  "next_page_id": "",
  "subscriptions": [
    {
      "cancelAtDate": null,
      "category": {
        "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
        "name": "Plans"
      },
      "endDate": null,
      "firstSource": {
        "adSource": {
          "adAccountId": "887874684917514",
          "adSourceId": "23843648148170123",
          "platform": "FACEBOOK"
        },
        "category": {
          "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
          "name": "Spring sale"
        },
        "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
        "clickId": "fa4567fc3611afeb888e314298",
        "disregarded": false,
        "goal": {
          "id": "cat-909ba403c207fbdfb6344b96f3294342",
          "name": "all"
        },
        "name": "Spring sale ad set",
        "organic": false,
        "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
        "tag": "@spring-sale",
        "trafficSource": {
          "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
          "name": "facebook"
        }
      },
      "id": "sle-db882bfed1b5280735eb03ac5b9be0c6edf04d7a52204d41f0c6cf6c28ad5223",
      "lastSource": {
        "adSource": {
          "adAccountId": "887874684917514",
          "adSourceId": "23843648148170123",
          "platform": "FACEBOOK"
        },
        "category": {
          "id": "cat-b83d72b83a742f9bd8d93a2403ba3809",
          "name": "Spring sale"
        },
        "clickDate": "Thu Nov 17 10:40:11 UTC 2026",
        "clickId": "fa4567fc3611afeb888e314298",
        "disregarded": false,
        "goal": {
          "id": "cat-909ba403c207fbdfb6344b96f3294342",
          "name": "all"
        },
        "name": "Spring sale ad set",
        "organic": false,
        "sourceLinkId": "8e5c10ea09ed899f9e7a386501b8003e7fe8a0429633b0c1bf647ce92f51433a",
        "tag": "@spring-sale",
        "trafficSource": {
          "id": "cat-cc4342fa4567fc3611afeb888e31eba2",
          "name": "facebook"
        }
      },
      "lead": {
        "creationDate": "2026-11-04T04:36:41-05:00",
        "email": "jo@example.com",
        "firstName": "Jo",
        "id": "40b5af5444756c2b5e666fcb658affd2a4b455bce3711c43f88763147381e368",
        "ips": [
          "203.0.113.7"
        ],
        "lastName": "Doe",
        "phoneNumbers": [
          "202-555-0184"
        ],
        "tags": [
          "!clicked",
          "@spring-sale",
          "$t-shirt"
        ]
      },
      "name": "Weekly plan",
      "periodicity": "WEEK",
      "planId": "WEEK8434",
      "price": 84.34,
      "provider": {
        "id": "9b1b1049ba4dd325f30ecd12e1ff",
        "integration": {
          "externalIntegrationType": "STRIPE",
          "id": "9ba4dd325fb9b130ecd1",
          "name": "Stripe integration"
        }
      },
      "startDate": "Tue Nov 17 10:51:54 UTC 2026",
      "status": "ACTIVE",
      "subscriptionId": "7016953413",
      "tag": "$week-plan-8434",
      "trialEndDate": "Thu Nov 19 10:51:54 UTC 2026",
      "trialStartDate": "Tue Nov 17 10:51:54 UTC 2026"
    }
  ]
}
```

### List tags

List every tag in the account: source tags (@), action tags (!) and product tags ($), or only one kind.

**Inputs**

- Kind (`tag_type`, text): Only one kind of tag. All of them if left empty. One of: `@` (Source tags (start with @)), `!` (Action tags (start with !)), `$` (Product and sale tags (start with $)).

**Outputs**

- `count` (number): How many tags
- `tags` (list): The tags

**Example output**

```json
{
  "count": 3,
  "tags": [
    "!opted-in",
    "@spring-sale",
    "$t-shirt"
  ]
}
```

### Refund order

Record an order as refunded, in full or by an amount, and lower its lead's revenue. This records a refund made elsewhere; it moves no money.

**Inputs**

- Order ID (`order_id`, text, required): The order's id, as given when it was created (from 'Create order' or your store).
- Refunded amount (`refunded_amount`, number): How much was refunded. Leave empty for the whole order. At least 0.

**Outputs**

- `order_id` (text): The order refunded
- `refunded_amount` (number): The amount sent; empty for the whole order
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "order_id": "lodol-3f2a9c41d07b4e5f8a61",
  "refunded_amount": null,
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Update calls

Change the name, state or qualification of calls, by their ids or external ids.

**Inputs**

- Call IDs (`call_ids`, list): The calls (their ids, from 'List calls'), up to 50. Or give external ids.
- External IDs (`external_ids`, list): The calls' ids in your calendar or phone app, up to 50.
- Call name (`name`, text): A new name for the calls.
- Call state (`state`, text): Whether the call qualified. One of: `QUALIFIED`, `UNQUALIFIED`, `CANCELLED`, `NO_SHOW` (No-show).
- Qualification (`qualification`, text): A new custom qualification.

**Outputs**

- `call_ids` (list): The call ids sent
- `external_ids` (list): The external ids sent
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "call_ids": [
    "cll-eec11d39e6ec1843a78418c925d2a42a44e9fba95638c9ceac41cc2c3362e8dd"
  ],
  "external_ids": [],
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Update lead

Change a lead, found by its id, email or phone: a new email or name, more tags, IPs or phone numbers, or a stage. Only fields given change.

**Inputs**

- Lead ID (`lead_id`, text): The lead's id. Or leave empty and give its email or phone.
- Lead's email (`lead_email`, text): Find the lead by this email.
- Lead's phone (`lead_phone`, text): Find the lead by this phone number.
- New email (`new_email`, text): Change the lead's email to this.
- First name (`first_name`, text): The lead's first name.
- Last name (`last_name`, text): The lead's last name.
- Tags to add (`tags`, list): Tags to give the lead.
- IP addresses (`lead_ips`, list): The lead's IP addresses, which Hyros uses to match them to ad clicks.
- Phone numbers (`phone_numbers`, list): Phone numbers to add.
- Lead stage (`stage`, text): Move the lead to this stage.
- Stage date (`stage_date`, date and time): When the lead reached that stage. Leave empty for now.
- Ad optimization consent (`ad_optimization_consent`, text): Whether the lead agreed to their data being used to optimize ads. One of: `GRANTED`, `DENIED`, `UNSPECIFIED`.

**Outputs**

- `lead` (object): How the lead was found
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "lead": {
    "email": "jo@example.com",
    "id": null,
    "phone": null
  },
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Update order

Replace an order's products, and change its taxes, shipping, discount, currency or stage. The old items' sales are removed and the new ones recorded.

**Inputs**

- Order ID (`order_id`, text, required): The order's id, as given when it was created (from 'Create order' or your store).
- Product name (`product_name`, text): The product bought, at least 3 characters. Needed unless 'Items' is given.
- Price (`price`, number): The price of one, including its cost of goods. Needed with 'Product name'. At least 0.
- Quantity (`quantity`, number): How many. 1 if left empty. At least 1.
- Product tag (`product_tag`, text): The product's tag in Hyros, starting with $. Leave empty to let Hyros make one from the name.
- Cost of goods (`cost_of_goods`, number): What one costs you to make, already included in the price. At least 0.
- Items (advanced) (`items`, list): Several products at once, as a list such as [{"name": "T-shirt", "price": 15.5, "quantity": 2}]. Each takes name, price, externalId, quantity, costOfGoods, taxes, itemDiscount, packages, tag, categoryName; name and price are needed. When given it replaces the single-product fields.
- Find by item from (`integration_type`, text): Leave empty to find the order by its id. Choose an app to find it by an item's id in that app instead. One of: `STRIPE`, `SHOPIFY`, `KONNEKTIVE`, `API`.
- Currency (`currency`, text): The three-letter currency code, such as USD. Leave empty for the account's currency.
- Price format (`price_format`, text): How prices are written. Decimal unless you choose whole cents. One of: `DECIMAL` (Decimal, such as 15.50 (default)), `INTEGER` (Whole cents, such as 1550).
- Taxes (`taxes`, number): The order's taxes, spread over its items. At least 0.
- Shipping cost (`shipping_cost`, number): The order's shipping, spread over its items. At least 0.
- Order discount (`order_discount`, number): A discount on the whole order, spread evenly over its items. At least 0.
- Lead stage (`stage`, text): A lead stage to put the lead in, such as MQL.
- Cart ID (`cart_id`, text): The cart this order came from, if any.
- Subscription ID (`external_subscription_id`, text): The subscription this order is a payment of, if any (its id in your billing app).

**Outputs**

- `items` (list): The items sent
- `order_id` (text): The order changed
- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request

**Example output**

```json
{
  "items": [
    {
      "name": "T-shirt, blue",
      "price": 15.5,
      "quantity": 2,
      "tag": "$t-shirt"
    }
  ],
  "order_id": "lodol-3f2a9c41d07b4e5f8a61",
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK"
}
```

### Update sales

Mark sales refunded, in full or by an amount, or mark them recurring or not, by their ids.

**Inputs**

- Sale IDs (`sale_ids`, list, required): The sales (their ids, from 'List sales' or a trigger), up to 50.
- Refunded (`refunded`, text): Yes to mark them refunded. One of: `true` (Yes), `false` (No).
- Refunded amount (`refunded_amount`, number): How much was refunded. Leave empty for the whole sale. At least 0.
- Refunded on (`refunded_date`, date and time): When the refund was made. Leave empty for now.
- Recurring (`recurring`, text): Yes to mark them recurring payments. One of: `true` (Yes), `false` (No).

**Outputs**

- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request
- `sale_ids` (list): The sales changed

**Example output**

```json
{
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK",
  "sale_ids": [
    "sle-db882bfed1b5280735eb03ac5b9be0c6edf04d7a52204d41f0c6cf6c28ad52234"
  ]
}
```

### Update subscriptions

Change subscriptions' status, name, price or dates, by their ids, such as marking one canceled. Only fields given change.

**Inputs**

- Subscription IDs (`subscription_ids`, list, required): The subscriptions (their ids, from 'List subscriptions' or a trigger), up to 50.
- Status (`status`, text): The subscription's status. One of: `ACTIVE`, `TRIALING`, `CANCELED`, `PAST_DUE` (Past due), `INCOMPLETE`, `INCOMPLETE_EXPIRED` (Incomplete, expired), `UNPAID`, `COMPLETED`, `PAUSED`.
- Name (`name`, text): A new name.
- Price (`price`, number): A new price for each payment. At least 0.
- Start date (`start_date`, date and time): When it started.
- End date (`end_date`, date and time): When it ended.
- Canceled on (`cancel_at_date`, date and time): When it was canceled.
- Trial start (`trial_start_date`, date and time): When its free trial started.
- Trial end (`trial_end_date`, date and time): When its free trial ended.

**Outputs**

- `request_id` (text): Hyros's id for the request, for its support team
- `result` (text): OK when Hyros accepted the request
- `subscription_ids` (list): The subscriptions changed

**Example output**

```json
{
  "request_id": "78c6d764d40547928ae36fd2d0103252",
  "result": "OK",
  "subscription_ids": [
    "sle-db882bfed1b5280735eb03ac5b9be0c6edf04d7a52204d41f0c6cf6c28ad5223"
  ]
}
```
