# Partnerize

> Manage partner programs in Partnerize: approve partners, conversions and transaction queries, run deals and voucher codes, and report on clicks and sales.

App · 22 actions. Web page: https://docs.lodol.com/docs/integrations/partnerize

## Actions

### Approve a transaction query

Approve a pending transaction query, which creates the missing conversion.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Transaction query (`transaction_query_id`, text, required): The transaction query: a partner's claim for a sale that wasn't tracked.
- Commission (`commission`, number): The commission the conversion should have. Leave empty for the expected commission. At least 0.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "actions_available": [
      "example"
    ],
    "campaign_id": "example",
    "conversion_currency": "example",
    "conversion_date_time": "example",
    "conversion_id": "example",
    "conversion_reference": "example",
    "conversion_value": 1,
    "created_at": "example",
    "current_state": "example",
    "expected_commission": 1,
    "notes": "example",
    "publisher_id": "example",
    "publisher_reference": "example",
    "transaction_query_id": "example"
  }
}
```

### Approve or reject a partner

Approve, reject or set back to pending a partner's place on a campaign.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Partner (`publisher_id`, text, required): The partner.
- Status (`status`, text, required): The partner's new status on the campaign. One of: `a` (Approved), `p` (Pending), `r` (Rejected).

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "account_name": "example",
    "campaign_status": "example",
    "company_name": "example",
    "contact_email": "example",
    "contact_name": "example",
    "default_currency": "example",
    "network_status": "example",
    "operating_country": "example",
    "promotional_method_name": "example",
    "publisher_id": "example",
    "vertical_name": "example",
    "websites": [
      {
        "website_id": "example",
        "website_type_name": "example",
        "website_url": "example"
      }
    ]
  }
}
```

### Approve or reject conversions

Approve, reject or set back to pending one or more of a campaign's conversions. Partnerize applies the change in the background and returns the job.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Conversion IDs (`conversion_ids`, list, required): The conversions, by conversion ID.
- Status (`status`, text, required): The new status. One of: `approved`, `rejected`, `pending`.
- Reason (`reason`, text): Why, such as `cancelled order`. Letters, digits, spaces and :-_.,;# only.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "completed_at": "example",
    "created_at": "example",
    "id": "example",
    "item_error_count": 1,
    "item_success_count": 1,
    "item_total_count": 1,
    "percentage_complete": 1,
    "status": "example",
    "type": "example"
  }
}
```

### Create a deal

Add a deal (an offer, sale or coupon) to a campaign for partners to promote.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Title (`title`, text, required): The deal's title.
- Description (`description`, text, required): What the deal offers.
- Type (`offer_type`, text, required): The kind of deal. One of: `coupon`, `offer`, `sale`.
- Value (`offer_value`, text, required): What the deal is worth, such as `40% off`.
- Coupon code (`coupon_code`, text): The coupon code for the deal.
- Destination URL (`destination`, text): The page the deal links to.
- Starts (`start`, date and time): When the deal starts.
- Ends (`end`, date and time): When the deal ends.
- Terms (`terms`, text): The deal's terms.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "active": "example",
    "campaign_deal_id": "example",
    "category": "example",
    "country_iso": "example",
    "coupon_code": "example",
    "created_at": "example",
    "description": "example",
    "destination": "example",
    "end_date_time": "example",
    "offer_type": "example",
    "offer_value": "example",
    "start_date_time": "example",
    "terms": "example",
    "title": "example",
    "updated_at": "example"
  }
}
```

### Create a voucher code

Add a voucher code to a campaign, so sales that use it are credited to the partners in its groups.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Code (`code`, text, required): The voucher code itself.
- Description (`description`, text): A description of the code.
- Starts (`start`, date and time): When the code starts, in UTC.
- Ends (`end`, date and time): When the code ends, in UTC.
- Partner groups (`group_ids`, list): The partner groups the code belongs to.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "active": "example",
    "campaign_id": "example",
    "commission_groups": [
      "example"
    ],
    "description": "example",
    "end_date_time": "example",
    "start_date_time": "example",
    "voucher_code": "example",
    "voucher_code_id": "example"
  }
}
```

### End a deal

Turn a deal off, which is how Partnerize deletes one.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Deal (`deal_id`, text, required): The deal.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "active": "example",
    "campaign_deal_id": "example"
  }
}
```

### Get a campaign

Get a campaign's settings.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "advertiser_id": "example",
    "advertiser_name": "example",
    "auto_approve_publisher": "example",
    "campaign_id": "example",
    "conversion_type": "example",
    "default_commission_rate": "example",
    "default_currency": "example",
    "destination_url": "example",
    "reporting_timezone": "example",
    "status": "example",
    "title": "example",
    "tq_enabled": "example",
    "vertical_name": "example"
  }
}
```

### Get a campaign partner

Get a partner on a campaign, with their websites and status.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Partner (`publisher_id`, text, required): The partner.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "account_name": "example",
    "campaign_status": "example",
    "company_name": "example",
    "contact_email": "example",
    "contact_name": "example",
    "default_currency": "example",
    "network_status": "example",
    "operating_country": "example",
    "promotional_method_name": "example",
    "publisher_id": "example",
    "vertical_name": "example",
    "websites": [
      {
        "website_id": "example",
        "website_type_name": "example",
        "website_url": "example"
      }
    ]
  }
}
```

### Get a deal

Get one of a campaign's deals.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Deal (`deal_id`, text, required): The deal.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "active": "example",
    "campaign_deal_id": "example",
    "category": "example",
    "country_iso": "example",
    "coupon_code": "example",
    "created_at": "example",
    "description": "example",
    "destination": "example",
    "end_date_time": "example",
    "offer_type": "example",
    "offer_value": "example",
    "start_date_time": "example",
    "terms": "example",
    "title": "example",
    "updated_at": "example"
  }
}
```

### Get a job

Check a background job, such as a conversion update, and how many items succeeded.

**Inputs**

- Job ID (`job_id`, text, required): The job ID a bulk step returned.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "completed_at": "example",
    "created_at": "example",
    "id": "example",
    "item_error_count": 1,
    "item_success_count": 1,
    "item_total_count": 1,
    "percentage_complete": 1,
    "status": "example",
    "type": "example"
  }
}
```

### List a campaign's partners

List the partners on a campaign, with their status: approved, pending or rejected.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Status (`status`, text): Only partners with this status. One of: `a` (Approved), `p` (Pending), `r` (Rejected).

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "publishers": [
      {
        "account_name": "example",
        "campaign_status": "example",
        "company_name": "example",
        "contact_email": "example",
        "contact_name": "example",
        "default_currency": "example",
        "network_status": "example",
        "operating_country": "example",
        "promotional_method_name": "example",
        "publisher_id": "example",
        "vertical_name": "example",
        "websites": [
          {
            "website_id": "example",
            "website_type_name": "example",
            "website_url": "example"
          }
        ]
      }
    ]
  }
}
```

### List brands

List the brands (advertisers) on your Partnerize network.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "advertisers": [
      {
        "account_name": "example",
        "advertiser_id": "example",
        "company_name": "example",
        "country": "example",
        "default_currency": "example",
        "display_name": "example",
        "status": "example"
      }
    ]
  }
}
```

### List campaigns

List the campaigns you can see in Partnerize.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "campaigns": [
      {
        "advertiser_id": "example",
        "advertiser_name": "example",
        "auto_approve_publisher": "example",
        "campaign_id": "example",
        "conversion_type": "example",
        "default_commission_rate": "example",
        "default_currency": "example",
        "destination_url": "example",
        "reporting_timezone": "example",
        "status": "example",
        "title": "example",
        "tq_enabled": "example",
        "vertical_name": "example"
      }
    ]
  }
}
```

### List clicks

List the clicks on a campaign's tracking links over a period. A page holds 300.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- From (`start`, date and time, required): The start of the period, in UTC.
- To (`end`, date and time): The end of the period, in UTC. Leave empty for now.
- Skip (`offset`, number): How many to skip, for paging. A page holds 300. At least 0.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "clicks": [
      {
        "campaign_id": "example",
        "click_id": "example",
        "clickref": "example",
        "country": "example",
        "last_used": "example",
        "publisher_id": "example",
        "publisher_name": "example",
        "referer": "example",
        "set_time": "example",
        "status": "example"
      }
    ],
    "count": 1,
    "limit": 1
  }
}
```

### List conversions

List a campaign's conversions (sales and leads) over a period, with their value, commission and status. A page holds 300.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- From (`start`, date and time, required): The start of the period, in UTC.
- To (`end`, date and time): The end of the period, in UTC. Leave empty for now.
- Statuses (`statuses`, list): Only conversions with these statuses. One or more of: `approved`, `pending`, `rejected`.
- Period by (`date_type`, text): Which date the period applies to. Leave empty for when the conversion happened. One of: `last_modified` (Last changed), `approved_at` (Approved).
- Skip (`offset`, number): How many to skip, for paging. A page holds 300. At least 0.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "conversions": [
      {
        "advertiser_reference": "example",
        "campaign_id": "example",
        "conversion_id": "example",
        "conversion_reference": "example",
        "conversion_time": "example",
        "conversion_value": {
          "commission": 1,
          "conversion_status": "example",
          "publisher_commission": 1,
          "value": 1
        },
        "country": "example",
        "currency": "example",
        "customer_reference": "example",
        "last_modified": "example",
        "publisher_id": "example",
        "publisher_name": "example"
      }
    ],
    "count": 1,
    "limit": 1
  }
}
```

### List deals

List a campaign's deals: offers and coupons partners can promote.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "campaign_deals": [
      {
        "active": "example",
        "campaign_deal_id": "example",
        "category": "example",
        "country_iso": "example",
        "coupon_code": "example",
        "created_at": "example",
        "description": "example",
        "destination": "example",
        "end_date_time": "example",
        "offer_type": "example",
        "offer_value": "example",
        "start_date_time": "example",
        "terms": "example",
        "title": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### List invoices

List a brand's invoices with their totals and status.

**Inputs**

- Brand (`brand_id`, text, required): The brand.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "invoices": [
      {
        "campaign_id": "example",
        "creation_date": "example",
        "currency": "example",
        "invoice_id": "example",
        "invoice_net_value": 1,
        "invoice_reference": "example",
        "invoice_total_value": 1,
        "payment_date": "example",
        "payment_due_by_date": "example",
        "publisher_commission": 1,
        "status": "example"
      }
    ]
  }
}
```

### List partner groups

List a campaign's partner (commission) groups and the partners in each.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "commission_groups": [
      {
        "active": "example",
        "commission_group_id": "example",
        "description": "example",
        "end_date_time": "example",
        "name": "example",
        "publishers": [
          "example"
        ],
        "start_date_time": "example"
      }
    ]
  }
}
```

### List transaction queries

List partners' claims for sales that weren't tracked on a campaign.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- State (`state`, text): Only queries in this state. One of: `pending`, `approved`, `rejected`.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "count": 1,
    "transaction_queries": [
      {
        "actions_available": [
          "example"
        ],
        "campaign_id": "example",
        "conversion_currency": "example",
        "conversion_date_time": "example",
        "conversion_id": "example",
        "conversion_reference": "example",
        "conversion_value": 1,
        "created_at": "example",
        "current_state": "example",
        "expected_commission": 1,
        "notes": "example",
        "publisher_id": "example",
        "publisher_reference": "example",
        "transaction_query_id": "example"
      }
    ]
  }
}
```

### List voucher codes

List a campaign's voucher codes.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "voucher_codes": [
      {
        "active": "example",
        "campaign_id": "example",
        "commission_groups": [
          "example"
        ],
        "description": "example",
        "end_date_time": "example",
        "start_date_time": "example",
        "voucher_code": "example",
        "voucher_code_id": "example"
      }
    ]
  }
}
```

### Reject a transaction query

Reject a pending transaction query, with the reason.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Transaction query (`transaction_query_id`, text, required): The transaction query: a partner's claim for a sale that wasn't tracked.
- Reason (`reason`, text, required): Why it is rejected.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "actions_available": [
      "example"
    ],
    "campaign_id": "example",
    "conversion_currency": "example",
    "conversion_date_time": "example",
    "conversion_id": "example",
    "conversion_reference": "example",
    "conversion_value": 1,
    "created_at": "example",
    "current_state": "example",
    "expected_commission": 1,
    "notes": "example",
    "publisher_id": "example",
    "publisher_reference": "example",
    "transaction_query_id": "example"
  }
}
```

### Update a deal

Change a deal. Only the fields filled in change.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Deal (`deal_id`, text, required): The deal.
- Title (`title`, text): The deal's title.
- Description (`description`, text): What the deal offers.
- Type (`offer_type`, text): The kind of deal. One of: `coupon`, `offer`, `sale`.
- Value (`offer_value`, text): What the deal is worth, such as `40% off`.
- Coupon code (`coupon_code`, text): The coupon code for the deal.
- Destination URL (`destination`, text): The page the deal links to.
- Starts (`start`, date and time): When the deal starts.
- Ends (`end`, date and time): When the deal ends.
- Terms (`terms`, text): The deal's terms.

**Outputs**

- `data` (object): The response from Partnerize.

**Example output**

```json
{
  "data": {
    "active": "example",
    "campaign_deal_id": "example",
    "category": "example",
    "country_iso": "example",
    "coupon_code": "example",
    "created_at": "example",
    "description": "example",
    "destination": "example",
    "end_date_time": "example",
    "offer_type": "example",
    "offer_value": "example",
    "start_date_time": "example",
    "terms": "example",
    "title": "example",
    "updated_at": "example"
  }
}
```
