# ThriveCart

> Read products, offers, customers, transactions and affiliates; manage subscriptions, refunds and event notifications.

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

## Actions

### Cancel a subscription

Cancel a subscription. This changes the connected account; use test mode for QA.

**Inputs**

- Order ID (`order_id`, text, required): Order ID
- Subscription ID (`subscription_id`, text, required): Subscription ID

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "message": "example",
    "success": false
  },
  "has_more": false,
  "next_cursor": null
}
```

### Create affiliate

Create an affiliate or register an existing affiliate for a product. May send account emails.

**Inputs**

- Email (`email`, text, required): Affiliate's email (used to sign in)
- Name (`name`, text): (Optional) Affiliate's name
- Affiliate (`affiliate_id`, text): (Optional) Desired affiliate ID - may be updated by the system
- Product IDS (`product_ids`, list): Array of at least one product ID to add them to
- Auto approve (`auto_approve`, true/false): (Optional) Auto-approve the affiliate for these products?
- Parent affiliate (`parent_affiliate`, number): (Optional) Mark this affiliate as having been referred by another?
- First name (`first_name`, text): (Optional) Affiliate's first name
- Last name (`last_name`, text): (Optional) Affiliate's last name
- Company (`company`, text): (Optional) Affiliate's company/business name
- Country (`country`, text): (Optional) 2-digit country code for affiliate's country
- City (`city`, text): (Optional) Affiliate's city
- State (`state`, text): (Optional) Affiliate's state/region
- Zip (`zip`, text): (Optional) Affiliate's ZIP/post code
- Trigger emails (`trigger_emails`, true/false): (Optional) Trigger email to affiliate and vendor? Defaults to true

**Outputs**: Value.

- `data` (object): The new affiliate.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Create event subscription

Create event subscription. This changes the connected account; use test mode for QA.

**Inputs**

- Event (`event`, text, required): Event. One of: `*`, `order_created`, `order_payment_product`, `order_payment_bump`, `order_payment_upsell`, `order_payment_downsell`, `order_rebill`, `order_rebill_failed`, `order_rebill_completed`, `order_rebill_cancelled`, and 12 more.
- Target URL (`target_url`, text, required): Target url.
- Trigger fields (`trigger_fields`, object): Trigger fields.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "subscription_id": 1
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get bump

Get bump.

**Inputs**

- Bump (`bump_id`, text, required): Bump id.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "bump_id": "example",
    "embed_type": "example",
    "label": "example",
    "name": "example",
    "payment_currency": "example",
    "product_id": "example",
    "product_name": "example",
    "slug": "example",
    "status": "example",
    "statusString": "example",
    "type": "example",
    "typeString": "example",
    "url": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get bump price details

Get bump price details.

**Inputs**

- Bump (`bump_id`, text, required): Bump id.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Get downsell

Get downsell.

**Inputs**

- Downsell (`downsell_id`, text, required): Downsell

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "downsell_id": "example",
    "label": "example",
    "name": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get downsell price details

Get downsell price details.

**Inputs**

- Downsell (`downsell_id`, text, required): Downsell id.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Get product

Get product.

**Inputs**

- Product (`product_id`, text, required): Product

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "embed_type": "example",
    "label": "example",
    "name": "example",
    "payment_currency": "example",
    "product_id": "example",
    "slug": "example",
    "status": "example",
    "statusString": "example",
    "type": "example",
    "typeString": "example",
    "url": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get product price details

Get product price details.

**Inputs**

- Product (`product_id`, text, required): Product id.
- Affiliate (`affiliate_id`, text): (Optional) Provide an affiliate ID to query the commissions tailored to this specific affiliate

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Get upsell

Get upsell.

**Inputs**

- Upsell (`upsell_id`, text, required): Upsell

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "label": "example",
    "name": "example",
    "upsell_id": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get upsell price details

Get upsell price details.

**Inputs**

- Upsell (`upsell_id`, text, required): Upsell id.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### List bump offers

List bump offers.

**Inputs**: None.

**Outputs**: Value.

- `data` (list): Data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": [
    {
      "bump_id": "example",
      "bump_name": "example",
      "embed_type": "example",
      "id": "example",
      "name": "example",
      "payment_amount": 1,
      "payment_currency": "example",
      "product_id": "example",
      "product_label": "example",
      "product_name": "example",
      "status": "example",
      "statusString": "example",
      "type": "example",
      "typeString": "example",
      "url": "example"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

### List downsells

List downsells.

**Inputs**: None.

**Outputs**: Value.

- `data` (list): Data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": [
    {
      "downsell_id": "example",
      "label": "example",
      "name": "example",
      "type": "example",
      "typeString": "example"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

### List products

List products.

**Inputs**: None.

**Outputs**: Value.

- `data` (list): Data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": [
    {
      "embed_type": "example",
      "label": "example",
      "name": "example",
      "product_id": "example",
      "status": "example",
      "statusString": "example",
      "type": "example",
      "typeString": "example",
      "url": "example"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

### List upsells

List upsells.

**Inputs**: None.

**Outputs**: Value.

- `data` (list): Data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": [
    {
      "label": "example",
      "name": "example",
      "type": "example",
      "typeString": "example",
      "upsell_id": "example"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

### Pause a subscription

Pause a subscription. This changes the connected account; use test mode for QA.

**Inputs**

- Order ID (`order_id`, text, required): Order ID
- Subscription ID (`subscription_id`, text, required): Subscription ID
- Auto resume (`auto_resume`, date and time): (Optional) Unix timestamp to automatically resume this subscription - must be 24 hours in the future

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "customer_id": "example",
    "frequency": "example",
    "message": "example",
    "plan_id": "example",
    "success": false
  },
  "has_more": false,
  "next_cursor": null
}
```

### Ping

Ping.

**Inputs**: None.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "account_id": "example",
    "account_name": "example",
    "account_url": "example",
    "account_version": "example",
    "custom_domain": "example",
    "custom_domain_enabled": false,
    "user_id": "example",
    "user_name": "example",
    "user_username": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Read affiliate info

Read affiliate info.

**Inputs**

- Affiliate (`affiliate_id`, text, required): Affiliate user ID, affiliate id, or email

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "affiliate_id": "example",
    "email": "example",
    "is_favourite": false,
    "label": "example",
    "name": "example",
    "products": [
      {
        "affiliate_link": "example",
        "product_id": "example",
        "product_name": "example",
        "status": "example",
        "status_string": "example"
      }
    ],
    "user_id": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Read customer information

Read customer information.

**Inputs**

- Email (`email`, text, required): Customer email address

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "customer": {
      "email": "example",
      "name": "example"
    },
    "lifetime_value": {
      "USD": 1
    },
    "purchases": [
      {}
    ],
    "subscriptions": [
      {
        "amount": "example",
        "currency": "example",
        "date_started": "example",
        "events": [
          {
            "amount": 1,
            "date": "example",
            "event_id": "example",
            "event_type": "example",
            "reference": "example"
          }
        ],
        "frequency": "example",
        "invoice_id": "example",
        "item_id": "example",
        "item_name": "example",
        "item_type": "example",
        "last_payment": "example",
        "next_payment": "example",
        "order_id": "example",
        "payments": "example",
        "payments_remaining": "example",
        "processor": "example",
        "status": "example",
        "subscription_id": "example",
        "subscription_reference": "example",
        "total_paid": "example"
      }
    ]
  },
  "has_more": false,
  "next_cursor": null
}
```

### Refund a transaction

Refund a transaction. This changes the connected account; use test mode for QA.

**Inputs**

- Order ID (`order_id`, text, required): Order ID
- Reference (`reference`, text, required): Item reference
- Reason (`reason`, text): Reason.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "message": "example",
    "success": false
  },
  "has_more": false,
  "next_cursor": null
}
```

### Resume a subscription

Resume a subscription. This changes the connected account; use test mode for QA.

**Inputs**

- Order ID (`order_id`, text, required): Order ID
- Subscription ID (`subscription_id`, text, required): Subscription ID

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "message": "example",
    "subscription_id": "example",
    "success": false
  },
  "has_more": false,
  "next_cursor": null
}
```

### Search affiliates

Search affiliates.

**Inputs**

- Product (`product_id`, text): (Optional) Product ID
- Query (`query`, text): (Optional) Search by affiliate name, email, affiliate ID
- Page (`page`, number): Page number (1 through N). From 1 to 1000000.
- PerPage (`perPage`, number): Results per page (max of 25). From 1 to 25.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "affiliates": [
      {
        "affiliate_id": "example",
        "email": "example",
        "is_favourite": false,
        "label": "example",
        "name": "example",
        "products": [
          {
            "affiliate_link": "example",
            "product_id": "example",
            "product_name": "example",
            "status": "example",
            "status_string": "example"
          }
        ],
        "user_id": "example"
      }
    ],
    "meta": {
      "results": 1,
      "total": 1
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### Search transactions

Search transactions.

**Inputs**

- Page (`page`, number): Page number (1 through N). From 1 to 1000000.
- PerPage (`perPage`, number): Results per page (max of 100). From 1 to 100.
- Query (`query`, text): Search query (e.g. customer email, order ID, etc)
- TransactionType (`transactionType`, text): 'any', 'charge', 'rebill', 'refund', 'cancel'. One of: `any`, `charge`, `rebill`, `refund`, `cancel`.
- Currency (`currency`, text): 'usd', 'gbp', etc (optional; leave blank for all currencies)

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "meta": {
      "results": 1,
      "total": 1
    },
    "transactions": [
      {
        "amount": 1,
        "base_product": "example",
        "currency": "example",
        "customer": {
          "email": "example",
          "name": "example"
        },
        "date": "example",
        "event_id": "example",
        "invoice_id": "example",
        "item_id": 1,
        "item_type": "example",
        "order_id": "example",
        "processor": "example",
        "reference": "example",
        "time": "example",
        "timestamp": 1,
        "transaction_type": "example"
      }
    ]
  },
  "has_more": false,
  "next_cursor": null
}
```

### Unsubscribe from an event

Unsubscribe from an event. This changes the connected account; use test mode for QA.

**Inputs**

- URL (`url`, text, required): Your endpoint URL to remove

**Outputs**: Value.

- `data` (list): Data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": [
    {}
  ],
  "has_more": false,
  "next_cursor": null
}
```

### Update Customer Email Address

Update Customer Email Address. This changes the connected account; use test mode for QA.

**Inputs**

- Current email (`current_email`, text, required): Current email.
- New email (`new_email`, text, required): New email.
- Allow merge (`allow_merge`, true/false): Allow merge.

**Outputs**: Value.

- `data` (object): API response.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation value, or empty at the end.

**Example output**

```json
{
  "data": {
    "data": {
      "current_email": "example",
      "customer_id": "example",
      "previous_email": "example",
      "updated_at": "example"
    },
    "message": "example",
    "success": false
  },
  "has_more": false,
  "next_cursor": null
}
```
