# ThriveCart API

> Every ThriveCart endpoint on Cotlet: inputs, JSON Schema, cURL, Python and Node.js examples and an example response for each call.

Source: https://cotlet.dev/docs/api/thrivecart

Docs sections: [Get started](https://cotlet.dev/docs.md) · [REST API](https://cotlet.dev/docs/api.md) · [MCP](https://cotlet.dev/docs/mcp.md) · [SDKs & CLI](https://cotlet.dev/docs/sdks.md) · [Integrations](https://cotlet.dev/docs/integrations.md)

15 endpoints for ThriveCart. Each one is a POST with a JSON body, called with your API key.

- Base URL: `https://cotlet.dev/api/v1/thrivecart`
- Connects with: Your own ThriveCart account (account owner; sub-users cannot clone products)
- Integration page: https://cotlet.dev/integrations/thrivecart-api-mcp-server

## Endpoints

| Endpoint | Access | Description |
|---|---|---|
| `list_products` | read | Products in your account with type, status and ID. |
| `get_product` | read | One product with its pricing options, bumps, upsells and downsells. |
| `list_transactions` | read | Payments, rebills, refunds and cancellations with customer, product, amount and invoice ID. |
| `list_subscriptions` | read | Subscriptions with status and next payment, plus the count, monthly recurring revenue and yearly revenue of the filter. |
| `list_coupons` | read | Coupons with code, discount, status, dates, products and number of uses. |
| `list_affiliates` | read | Affiliates with their approval status per product. |
| `create_coupon` | write | New coupon with a fixed or percentage discount, dates, use limit and products. |
| `update_coupon` | write | Enable or disable a coupon, or change its discount, dates, use limit or products. |
| `clone_product` | write | Copy a product with its checkout and settings, e.g. for a new cohort. |
| `set_product_status` | write | Switch a product between live, test and disabled, or archive or restore it. |
| `refund_transaction` | write | Full or partial refund of one payment, with an internal note. Does not cancel the subscription. |
| `pause_subscription` | write | Pause billing indefinitely, for a number of billing periods or until a date. |
| `cancel_subscription` | write | Stop all future payments of a subscription. Cannot be undone. |
| `approve_affiliate` | write | Approve or reject a pending affiliate application for one or more products. |
| `set_affiliate_commission` | write | Custom commission for one affiliate on one product. |

## List products

`POST https://cotlet.dev/api/v1/thrivecart/list_products`

Access: read.

Lists the products of your account with name, type, status and ID. Filter by status the way the Products page does; the default is Active, which holds live, test and disabled products and leaves out archived ones. Use the product_id of each item in the other tools.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | enum | no | live, test, disabled, archived, active (all but archived) or all. Default: active. |
| `search` | string | no | Part of the product name. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/list_products \
  -H "Authorization: Bearer $COTLET_API_KEY"
```

**Python**

```python
result = client.call("thrivecart", "list_products")
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'list_products');
```

**CLI**

```bash
cotlet call thrivecart list_products
```

### Example response

```json
{
  "products": [
    {
      "product_id": "12",
      "name": "Landing Page Course",
      "type": "digital",
      "status": "live"
    },
    {
      "product_id": "15",
      "name": "Spring Workshop",
      "type": "digital",
      "status": "disabled"
    }
  ]
}
```

## Get product

`POST https://cotlet.dev/api/v1/thrivecart/get_product`

Access: read.

Returns one product with its pricing options and the bumps, upsells and downsells in its funnel, each with its own ID and price. Use it to pick the product_ids for a coupon or an affiliate.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `product_id` | string | yes | Product ID from list_products. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/get_product \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"product_8c41d2"}'
```

**Python**

```python
result = client.call("thrivecart", "get_product", {"product_id":"product_8c41d2"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'get_product', {"product_id":"product_8c41d2"});
```

**CLI**

```bash
cotlet call thrivecart get_product --data '{"product_id":"product_8c41d2"}'
```

### Example response

```json
{
  "product_id": "12",
  "name": "Landing Page Course",
  "status": "live",
  "pricing_options": [
    {
      "id": "po_1",
      "name": "One-time",
      "amount": "197.00",
      "currency": "USD"
    },
    {
      "id": "po_2",
      "name": "Monthly",
      "amount": "49.00",
      "currency": "USD"
    }
  ],
  "bumps": [
    {
      "bump_id": "31",
      "name": "Template pack",
      "amount": "27.00"
    }
  ],
  "upsells": [],
  "downsells": []
}
```

## List transactions

`POST https://cotlet.dev/api/v1/thrivecart/list_transactions`

Access: read.

Searches your transactions by customer name, email, order ID or invoice ID, and by type. Pages hold up to 100 transactions; pass page to read on. Use the transaction_id of an item in refund_transaction and the subscription_id of a rebill in pause_subscription or cancel_subscription.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Customer name or email, order ID or invoice ID. |
| `type` | enum | no | any, charge, rebill, refund or cancel. Default: any. |
| `per_page` | integer | no | 1 to 100. Default: 50. |
| `page` | integer | no | Page number, starting at 1. Default: 1. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/list_transactions \
  -H "Authorization: Bearer $COTLET_API_KEY"
```

**Python**

```python
result = client.call("thrivecart", "list_transactions")
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'list_transactions');
```

**CLI**

```bash
cotlet call thrivecart list_transactions
```

### Example response

```json
{
  "transactions": [
    {
      "transaction_id": "tx_20418",
      "type": "charge",
      "customer": {
        "name": "Dana Client",
        "email": "client@example.com"
      },
      "product": "Landing Page Course",
      "amount": "97.00",
      "currency": "USD",
      "invoice_id": "INV-20418",
      "subscription_id": "sub_7731",
      "date": "2026-10-02"
    }
  ],
  "page": 1,
  "has_more": false
}
```

## List subscriptions

`POST https://cotlet.dev/api/v1/thrivecart/list_subscriptions`

Access: read.

Returns the subscriptions that match your filter, as the Subscriptions dashboard does, plus the number of matches and their monthly recurring revenue and yearly revenue. Use it to see how much paused or overdue subscriptions cost you. Cancelled (still active) means the customer cancelled renewals but has access until the last paid date.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `status` | enum | no | new_signups, trial, active, cancelled, cancelled_still_active, paused, completed, overdue or all. Default: active. |
| `product_id` | string | no | Only this product. |
| `query` | string | no | Customer name or email. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/list_subscriptions \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"overdue"}'
```

**Python**

```python
result = client.call("thrivecart", "list_subscriptions", {"status":"overdue"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'list_subscriptions', {"status":"overdue"});
```

**CLI**

```bash
cotlet call thrivecart list_subscriptions --data '{"status":"overdue"}'
```

### Example response

```json
{
  "subscriptions": [
    {
      "subscription_id": "sub_7731",
      "customer": "Dana Client",
      "product": "Landing Page Course",
      "status": "overdue",
      "amount": "49.00",
      "currency": "USD",
      "billing": "monthly",
      "next_payment": "2026-10-05"
    },
    {
      "subscription_id": "sub_7802",
      "customer": "Sam Rivers",
      "product": "Membership",
      "status": "overdue",
      "amount": "97.00",
      "currency": "USD",
      "billing": "monthly",
      "next_payment": "2026-10-08"
    }
  ],
  "total": 2,
  "mrr": "146.00",
  "yearly_revenue": "1752.00",
  "currency": "USD"
}
```

## List coupons

`POST https://cotlet.dev/api/v1/thrivecart/list_coupons`

Access: read.

Lists the coupons of the Coupons area with code, discount, status, redeemable dates, the products they work on and how many times each was used. Use the coupon_id of each item in update_coupon.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `search` | string | no | Part of the coupon name or code. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/list_coupons \
  -H "Authorization: Bearer $COTLET_API_KEY"
```

**Python**

```python
result = client.call("thrivecart", "list_coupons")
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'list_coupons');
```

**CLI**

```bash
cotlet call thrivecart list_coupons
```

### Example response

```json
{
  "coupons": [
    {
      "coupon_id": "87",
      "name": "Black Friday 30% main course",
      "code": "BLACKFRIDAY",
      "status": "enabled",
      "discount": "30%",
      "starts_on": "2026-11-27",
      "ends_on": "2026-12-01",
      "max_uses": 100,
      "uses": 0,
      "product_ids": [
        "12"
      ]
    },
    {
      "coupon_id": "71",
      "name": "Spring 20% off",
      "code": "SPRING20",
      "status": "enabled",
      "discount": "20%",
      "starts_on": null,
      "ends_on": null,
      "max_uses": null,
      "uses": 14,
      "product_ids": [
        "15"
      ]
    }
  ]
}
```

## List affiliates

`POST https://cotlet.dev/api/v1/thrivecart/list_affiliates`

Access: read.

Lists your affiliates with contact details and, for each product, whether the affiliate is approved or pending. Pages hold up to 25 affiliates; pass page to read on. Use the affiliate_id of an item in approve_affiliate and set_affiliate_commission.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `product_id` | string | no | Only affiliates of this product. |
| `query` | string | no | Affiliate name, email or affiliate ID. |
| `page` | integer | no | Page number, starting at 1. Default: 1. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/list_affiliates \
  -H "Authorization: Bearer $COTLET_API_KEY"
```

**Python**

```python
result = client.call("thrivecart", "list_affiliates")
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'list_affiliates');
```

**CLI**

```bash
cotlet call thrivecart list_affiliates
```

### Example response

```json
{
  "affiliates": [
    {
      "affiliate_id": "3481",
      "name": "Jo Partner",
      "email": "jo@example.com",
      "products": [
        {
          "product_id": "12",
          "status": "pending"
        }
      ]
    }
  ],
  "page": 1,
  "has_more": false
}
```

## Create coupon

`POST https://cotlet.dev/api/v1/thrivecart/create_coupon`

Access: write. Confirm: waits for the user's OK before it runs.

Creates a coupon the way the Coupons area does. The code needs at least 3 characters, letters and digits only. A percentage coupon can apply to the funnel, the main product, bumps only or the main product plus bumps; a fixed coupon applies to the main product only, once. max_uses counts all uses together, not per customer. The coupon is enabled when created, so buyers can use it from the start date. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Internal name. |
| `code` | string | yes | At least 3 characters, letters and digits only. |
| `discount_type` | enum | yes | fixed or percentage. |
| `discount` | string | yes | Amount or percent, decimals allowed for percent, e.g. 20 or 12.5. |
| `applies_to` | enum | no | Percentage only: funnel, main_product, bumps_only or main_and_bumps. Default: main_product. |
| `apply_to_recurring` | boolean | no | Percentage only: also discount recurring payments. |
| `product_ids` | string[] | no | Products it works on. Default: all products. |
| `starts_on` | date | no | First day it works. Default: now. |
| `ends_on` | date | no | Last day it works, until 23:59:59 in your account time zone. |
| `max_uses` | integer | no | Disable after this many uses in total. |
| `affiliate_id` | string | no | Credit this affiliate on every use. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/create_coupon \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Black Friday 30% main course","code":"BLACKFRIDAY","discount_type":"percentage","discount":"30","applies_to":"main_product","product_ids":["12"],"starts_on":"2026-11-27","ends_on":"2026-12-01","max_uses":100}'
```

**Python**

```python
result = client.call("thrivecart", "create_coupon", {"name":"Black Friday 30% main course","code":"BLACKFRIDAY","discount_type":"percentage","discount":"30","applies_to":"main_product","product_ids":["12"],"starts_on":"2026-11-27","ends_on":"2026-12-01","max_uses":100})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'create_coupon', {"name":"Black Friday 30% main course","code":"BLACKFRIDAY","discount_type":"percentage","discount":"30","applies_to":"main_product","product_ids":["12"],"starts_on":"2026-11-27","ends_on":"2026-12-01","max_uses":100});
```

**CLI**

```bash
cotlet call thrivecart create_coupon --data '{"name":"Black Friday 30% main course","code":"BLACKFRIDAY","discount_type":"percentage","discount":"30","applies_to":"main_product","product_ids":["12"],"starts_on":"2026-11-27","ends_on":"2026-12-01","max_uses":100}'
```

### Example response

```json
{
  "coupon_id": "87",
  "name": "Black Friday 30% main course",
  "code": "BLACKFRIDAY",
  "status": "enabled",
  "discount": "30%",
  "applies_to": "main_product",
  "product_ids": [
    "12"
  ],
  "starts_on": "2026-11-27",
  "ends_on": "2026-12-01",
  "max_uses": 100,
  "uses": 0
}
```

## Update coupon

`POST https://cotlet.dev/api/v1/thrivecart/update_coupon`

Access: write. Confirm: waits for the user's OK before it runs.

Changes one coupon. Disabling keeps the coupon and enabling turns it back on. Discount, dates and the use limit apply to the next buyer. If you add bumps to a product after creating a coupon, send product_ids again, because new bumps are not added automatically. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `coupon_id` | string | yes | Coupon ID from list_coupons. |
| `fields` | object | yes | Any of status (enabled or disabled), discount, starts_on, ends_on, max_uses, product_ids. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/update_coupon \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"coupon_id":"coupon_8c41d2","fields":"fields"}'
```

**Python**

```python
result = client.call("thrivecart", "update_coupon", {"coupon_id":"coupon_8c41d2","fields":"fields"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'update_coupon', {"coupon_id":"coupon_8c41d2","fields":"fields"});
```

**CLI**

```bash
cotlet call thrivecart update_coupon --data '{"coupon_id":"coupon_8c41d2","fields":"fields"}'
```

### Example response

```json
{
  "coupon_id": "71",
  "code": "SPRING20",
  "status": "disabled",
  "discount": "20%",
  "uses": 14
}
```

## Clone product

`POST https://cotlet.dev/api/v1/thrivecart/clone_product`

Access: write.

Copies a product the way the copy button does, including archived products. Only the account owner can clone; for a sub-user the call fails with a permission error. The copy is a separate product with its own ID, ready for you to edit. clone_product runs without asking first: it sends nothing to anyone, and set_product_status archives the copy in one call.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `product_id` | string | yes | Product ID from list_products. |
| `name` | string | no | Name for the copy. Default: ThriveCart's default for a copy. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/clone_product \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"15","name":"Autumn Workshop 2026"}'
```

**Python**

```python
result = client.call("thrivecart", "clone_product", {"product_id":"15","name":"Autumn Workshop 2026"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'clone_product', {"product_id":"15","name":"Autumn Workshop 2026"});
```

**CLI**

```bash
cotlet call thrivecart clone_product --data '{"product_id":"15","name":"Autumn Workshop 2026"}'
```

### Example response

```json
{
  "product_id": "27",
  "name": "Spring Workshop, autumn cohort",
  "cloned_from": "15"
}
```

## Set product status

`POST https://cotlet.dev/api/v1/thrivecart/set_product_status`

Access: write. Confirm: waits for the user's OK before it runs.

Sets the status of a product. Live products can be bought, test products are in test mode, disabled products are inactive. Archiving removes a product from the active list and disables its checkout, while its stats and transactions stay in your reports; restoring makes it active again. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `product_id` | string | yes | Product ID from list_products. |
| `status` | enum | yes | live, test, disabled, archived or restored. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/set_product_status \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"product_8c41d2","status":"live"}'
```

**Python**

```python
result = client.call("thrivecart", "set_product_status", {"product_id":"product_8c41d2","status":"live"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'set_product_status', {"product_id":"product_8c41d2","status":"live"});
```

**CLI**

```bash
cotlet call thrivecart set_product_status --data '{"product_id":"product_8c41d2","status":"live"}'
```

### Example response

```json
{
  "product_id": "15",
  "name": "Spring Workshop",
  "status": "archived"
}
```

## Refund transaction

`POST https://cotlet.dev/api/v1/thrivecart/refund_transaction`

Access: write. Confirm: waits for the user's OK before it runs.

Refunds one payment or rebill, in full or in part. You can refund partly several times, up to the transaction total and never more. A refund cannot be reversed, and the note stays internal. It does not cancel the subscription, so call cancel_subscription too. A PayPal refund fails if your PayPal account has too little balance. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `transaction_id` | string | yes | Transaction ID from list_transactions. |
| `amount` | string | no | Partial amount. Default: the full remaining amount. |
| `note` | string | no | Internal note, never shown to the customer. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/refund_transaction \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"transaction_id":"tx_20418","note":"30-day guarantee, asked 10 Oct"}'
```

**Python**

```python
result = client.call("thrivecart", "refund_transaction", {"transaction_id":"tx_20418","note":"30-day guarantee, asked 10 Oct"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'refund_transaction', {"transaction_id":"tx_20418","note":"30-day guarantee, asked 10 Oct"});
```

**CLI**

```bash
cotlet call thrivecart refund_transaction --data '{"transaction_id":"tx_20418","note":"30-day guarantee, asked 10 Oct"}'
```

### Example response

```json
{
  "transaction_id": "tx_20418",
  "status": "refunded",
  "amount": "97.00",
  "refunded_total": "97.00",
  "remaining": "0.00",
  "currency": "USD"
}
```

## Pause subscription

`POST https://cotlet.dev/api/v1/thrivecart/pause_subscription`

Access: write. Confirm: waits for the user's OK before it runs.

Pauses billing of one subscription. Without resume_on or periods the pause lasts until you resume it. Pausing does not remove payments the customer owes: a subscription with 5 rebills is still charged 5 times, later. resume_on must be at least 24 hours ahead. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `subscription_id` | string | yes | Subscription ID from list_subscriptions. |
| `resume_on` | date | no | Resume automatically on this date, at least 24 hours from now. |
| `periods` | integer | no | Pause for this many billing periods instead. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/pause_subscription \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subscription_id":"subscription_8c41d2"}'
```

**Python**

```python
result = client.call("thrivecart", "pause_subscription", {"subscription_id":"subscription_8c41d2"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'pause_subscription', {"subscription_id":"subscription_8c41d2"});
```

**CLI**

```bash
cotlet call thrivecart pause_subscription --data '{"subscription_id":"subscription_8c41d2"}'
```

### Example response

```json
{
  "subscription_id": "sub_7731",
  "status": "paused",
  "resume_on": "2026-11-15"
}
```

## Cancel subscription

`POST https://cotlet.dev/api/v1/thrivecart/cancel_subscription`

Access: write. Confirm: waits for the user's OK before it runs.

Cancels one active or paused subscription for good. ThriveCart tells the payment processor, tags the original transaction as cancelled and adds a $0.00 transaction on that day to mark it. It does not refund anything. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `subscription_id` | string | yes | Subscription ID from list_subscriptions. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/cancel_subscription \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subscription_id":"subscription_8c41d2"}'
```

**Python**

```python
result = client.call("thrivecart", "cancel_subscription", {"subscription_id":"subscription_8c41d2"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'cancel_subscription', {"subscription_id":"subscription_8c41d2"});
```

**CLI**

```bash
cotlet call thrivecart cancel_subscription --data '{"subscription_id":"subscription_8c41d2"}'
```

### Example response

```json
{
  "subscription_id": "sub_7731",
  "status": "cancelled",
  "cancelled_on": "2026-10-11"
}
```

## Approve affiliate

`POST https://cotlet.dev/api/v1/thrivecart/approve_affiliate`

Access: write. Confirm: waits for the user's OK before it runs.

Approves or rejects an affiliate for the products you name. Approving needs a pending application for each of them. An affiliate approved for the main product is also approved for the upsells and downsells of its funnel. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `affiliate_id` | string | yes | Affiliate ID from list_affiliates. |
| `product_ids` | string[] | yes | Product IDs to decide on. |
| `decision` | enum | yes | approve or reject. |
| `trigger_emails` | boolean | no | Send ThriveCart's emails to the affiliate and you. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/approve_affiliate \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"affiliate_id":"affiliate_8c41d2","product_ids":["product ids"],"decision":"approve"}'
```

**Python**

```python
result = client.call("thrivecart", "approve_affiliate", {"affiliate_id":"affiliate_8c41d2","product_ids":["product ids"],"decision":"approve"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'approve_affiliate', {"affiliate_id":"affiliate_8c41d2","product_ids":["product ids"],"decision":"approve"});
```

**CLI**

```bash
cotlet call thrivecart approve_affiliate --data '{"affiliate_id":"affiliate_8c41d2","product_ids":["product ids"],"decision":"approve"}'
```

### Example response

```json
{
  "affiliate_id": "3481",
  "name": "Jo Partner",
  "products": [
    {
      "product_id": "12",
      "status": "approved"
    }
  ]
}
```

## Set affiliate commission

`POST https://cotlet.dev/api/v1/thrivecart/set_affiliate_commission`

Access: write. Confirm: waits for the user's OK before it runs.

Sets a custom commission for one approved affiliate on one product, instead of the default rate. It applies to all pricing options of the product, not to single ones. Upfront and recurring commissions are set separately. By default you confirm each call; you can switch that off for this tool.

### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `affiliate_id` | string | yes | Affiliate ID from list_affiliates. |
| `product_id` | string | yes | Product ID from list_products. |
| `type` | enum | yes | percentage or fixed. |
| `amount` | string | yes | Percent or amount, e.g. 40. |
| `recurring_type` | enum | no | percentage or fixed, for recurring payments. |
| `recurring_amount` | string | no | Percent or amount for recurring payments. |

### Request

**cURL**

```bash
curl -X POST https://cotlet.dev/api/v1/thrivecart/set_affiliate_commission \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"affiliate_id":"affiliate_8c41d2","product_id":"product_8c41d2","type":"percentage","amount":"amount"}'
```

**Python**

```python
result = client.call("thrivecart", "set_affiliate_commission", {"affiliate_id":"affiliate_8c41d2","product_id":"product_8c41d2","type":"percentage","amount":"amount"})
```

**Node.js**

```js
const result = await cotlet.call('thrivecart', 'set_affiliate_commission', {"affiliate_id":"affiliate_8c41d2","product_id":"product_8c41d2","type":"percentage","amount":"amount"});
```

**CLI**

```bash
cotlet call thrivecart set_affiliate_commission --data '{"affiliate_id":"affiliate_8c41d2","product_id":"product_8c41d2","type":"percentage","amount":"amount"}'
```

### Example response

```json
{
  "affiliate_id": "3481",
  "product_id": "12",
  "upfront": {
    "type": "percentage",
    "amount": "40"
  }
}
```
