# Payhip

> Manage store coupons and verify or update software license keys.

App · 8 actions. Web page: https://docs.lodol.com/docs/integrations/payhip

## Actions

### Create a coupon

Create a coupon.

**Inputs**

- Code (`code`, text, required): Code.
- Coupon type (`coupon_type`, text, required): Coupon type. One of: `single`, `multi`, `collection`.
- Percent off (`percent_off`, number): Percent off. At most 100.
- Amount off (`amount_off`, number): Discount in cents. At least 1.
- Product key (`product_key`, text): Product key.
- Collection ID (`collection_id`, text): Collection id.
- Usage limit (`usage_limit`, number): Usage limit. At least 1.
- Notes (`notes`, text): Notes.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "amount_off": 1,
      "code": "example",
      "collection_id": "example",
      "coupon_type": "example",
      "end_date": "example",
      "id": 1,
      "notes": "example",
      "percent_off": 1.0,
      "product_key": "example",
      "start_date": "example",
      "usage_limit": 1
    }
  }
}
```

### Decrease license usage

Decrease license usage.

**Inputs**

- License key (`license_key`, text, required): License key.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "buyer_email": "example",
      "date": "example",
      "enabled": false,
      "license_key": "example",
      "product_link": "example",
      "product_name": "example",
      "uses": 1,
      "variant_id": "example",
      "variant_name": "example"
    }
  }
}
```

### Disable a license key

Disable a license key.

**Inputs**

- License key (`license_key`, text, required): License key.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "buyer_email": "example",
      "date": "example",
      "enabled": false,
      "license_key": "example",
      "product_link": "example",
      "product_name": "example",
      "uses": 1,
      "variant_id": "example",
      "variant_name": "example"
    }
  }
}
```

### Enable a license key

Enable a license key.

**Inputs**

- License key (`license_key`, text, required): License key.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "buyer_email": "example",
      "date": "example",
      "enabled": false,
      "license_key": "example",
      "product_link": "example",
      "product_name": "example",
      "uses": 1,
      "variant_id": "example",
      "variant_name": "example"
    }
  }
}
```

### Get a coupon

Get a coupon.

**Inputs**

- Coupon ID (`coupon_id`, number, required): Coupon id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "amount_off": 1,
      "code": "example",
      "collection_id": "example",
      "coupon_type": "example",
      "end_date": "example",
      "id": 1,
      "notes": "example",
      "percent_off": 1.0,
      "product_key": "example",
      "start_date": "example",
      "usage_limit": 1
    }
  }
}
```

### Increase license usage

Increase license usage.

**Inputs**

- License key (`license_key`, text, required): License key.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "buyer_email": "example",
      "date": "example",
      "enabled": false,
      "license_key": "example",
      "product_link": "example",
      "product_name": "example",
      "uses": 1,
      "variant_id": "example",
      "variant_name": "example"
    }
  }
}
```

### List coupons

List coupons.

**Inputs**

- Offset (`offset`, number): Offset. At least 0.
- Limit (`limit`, number): Limit. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "coupons": []
    }
  }
}
```

### Verify a license key

Verify a license key.

**Inputs**

- License key (`license_key`, text, required): License key.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "buyer_email": "example",
      "date": "example",
      "enabled": false,
      "license_key": "example",
      "product_link": "example",
      "product_name": "example",
      "uses": 1,
      "variant_id": "example",
      "variant_name": "example"
    }
  }
}
```
