# Skio

> Manage Skio subscriptions on your Shopify store: pause, skip, reschedule, cancel or change products, and read customers and orders.

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

## Actions

### Add a product to a subscription

Add a product variant to a subscription, every order or once with the next order. A line with the same variant and price gets its quantity raised instead.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Product variant (`variant_id`, text, required): The product variant to add.
- Quantity (`quantity`, number): How many to add. Leave empty for 1. At least 1.
- Price (`price`, number): Price per unit. Leave empty for the variant's subscription price. At least 0.
- Next order only (`one_time`, true/false): Add it to the next order only, as a one-time add-on. Prepaid subscriptions take only one-time add-ons.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Apply a discount code

Apply a Shopify discount code to a subscription's future orders. Your store's stacking rules apply.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Code (`code`, text, required): The Shopify discount code.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "ok": true
  }
}
```

### Cancel a subscription

Cancel a subscription in Skio and Shopify. A prepaid subscription that has completed a cycle finishes the deliveries already paid for.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Notify the customer (`send_notification`, true/false): Send the customer your cancellation email and tell your integrations, such as Klaviyo. On unless you turn it off.
- Cancel permanently (`permanently`, true/false): Cancel for good, so the subscription can never be reactivated.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Change billing frequency

Change how often a subscription bills and ships, and set its next billing date. This also ends a timed pause. Prepaid subscriptions can't change frequency.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Every (`interval`, text, required): The period between orders. One of: `DAY` (Days), `WEEK` (Weeks), `MONTH` (Months), `YEAR` (Years).
- Number of periods (`interval_count`, number, required): How many of those periods between orders: 4 with Weeks is every 4 weeks. At least 1.
- Next billing date (`next_billing_date`, date, required): The date of the next order.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "subscriptionId": "example"
  }
}
```

### Change the next billing date

Change when a subscription next bills. The customer gets your next-order-date email. Cancelled subscriptions can't be changed.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Next billing date (`date`, date, required): The new next billing date.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "ok": true
  }
}
```

### Create a subscription

Create a subscription for an existing customer. Skio picks the closest selling plan; the customer isn't charged and no order is placed now.

**Inputs**

- Customer (`customer_id`, text, required): The customer the subscription is for.
- Shipping address (`address_id`, text, required): One of the customer's saved addresses, to ship to.
- Product variant (`variant_id`, text, required): The product variant to subscribe to. It must be in Skio's subscription selling plan group.
- Quantity (`quantity`, number, required): How many of the product each order. At least 1.
- Price (`price`, number): Price per unit. Leave empty for the variant's subscription price. At least 0.
- Bill every (`interval`, text, required): How often the customer is charged. One of: `DAY` (Days), `WEEK` (Weeks), `MONTH` (Months), `YEAR` (Years).
- Number of periods (`interval_count`, number, required): How many of those periods between charges: 2 with Weeks bills every 2 weeks. At least 1.
- First billing date (`next_billing_date`, date): The date of the first charge, up to 5 years ahead. Leave empty for one billing period from now.
- Payment method ID (`payment_method_id`, text): The Skio ID of one of the customer's payment methods. Without one, the subscription can't bill.
- Discount code (`discount_code`, text): A Shopify discount code to apply after the subscription is created.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": "example",
    "platformId": "example"
  }
}
```

### Generate a customer portal login link

Make a one-click login link to a customer's Skio portal. It expires after 10 minutes.

**Inputs**

- Customer email (`email`, text, required): The customer's email address, exactly as Skio has it.
- Open page (`return_to_path`, text): The portal page to open after login, such as /subscriptions. It starts with /.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "error": "example",
    "expiresAt": "example",
    "magicLinkUrl": "example",
    "ok": true
  }
}
```

### Get a customer's loyalty credit

Get a customer's loyalty credit balance, in credits and as money in the store's and the customer's currency.

**Inputs**

- Customer email (`email`, text, required): The customer's email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "credits": 1,
    "currencyCode": "example",
    "currencyStringValue": "example",
    "currencyValue": 1,
    "siteCurrencyCode": "example",
    "siteCurrencyStringValue": "example",
    "siteCurrencyValue": 1,
    "storefrontUserId": "example"
  }
}
```

### Get a subscription

Get one subscription with its status, next billing date, billing frequency, customer and current products.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to read.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "BillingPolicy": {
      "interval": "DAY",
      "intervalCount": 1
    },
    "StorefrontUser": {
      "email": "example",
      "firstName": "example",
      "id": "example",
      "lastName": "example"
    },
    "SubscriptionLines": [
      {
        "ProductVariant": {
          "id": "example",
          "sku": "example",
          "title": "example"
        },
        "id": "example",
        "priceWithoutDiscount": 1,
        "productVariantId": "example",
        "quantity": 1
      }
    ],
    "billingPolicyId": "example",
    "cancelledAt": "example",
    "churnScore": 1,
    "createdAt": "example",
    "currencyCode": "example",
    "cyclesCompleted": 1,
    "deliveryPolicyId": "example",
    "deliveryPrice": 1,
    "id": "example",
    "isPickup": true,
    "lastBillingAttemptAt": "example",
    "nextBillingDate": "example",
    "nextRenewalDate": "example",
    "note": "example",
    "platformId": "example",
    "shippingAddressId": "example",
    "status": "ACTIVE",
    "statusContext": "example",
    "storefrontUserId": "example",
    "updatedAt": "example"
  }
}
```

### Get an order

Get one order with its total and line items.

**Inputs**

- Order ID (`order_id`, text, required): The order's Skio ID.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "OrderLineItems": [
      {
        "id": "example",
        "priceWithoutDiscount": 1,
        "productVariantId": "example",
        "quantity": 1,
        "subscriptionLineId": "example"
      }
    ],
    "cancelledAt": "example",
    "createdAt": "example",
    "currencyCode": "example",
    "deliveredAt": "example",
    "fulfillAt": "example",
    "id": "example",
    "name": "example",
    "note": "example",
    "platformId": "example",
    "platformNumber": "example",
    "prepaidSubscriptionId": "example",
    "processedAt": "example",
    "storefrontUserId": "example",
    "totalPrice": 1,
    "totalPricePresentmentAmount": 1,
    "updatedAt": "example"
  }
}
```

### List a customer's addresses

List the saved addresses of a customer, for creating a subscription or changing where one ships.

**Inputs**

- Customer (`customer_id`, text, required): The customer whose addresses to list.
- Limit (`limit`, number): How many addresses to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many addresses to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "address1": "example",
      "address2": "example",
      "city": "example",
      "company": "example",
      "country": "example",
      "createdAt": "example",
      "firstName": "example",
      "id": "example",
      "lastName": "example",
      "phoneNumber": "example",
      "platformId": "example",
      "province": "example",
      "storefrontUserId": "example",
      "updatedAt": "example",
      "zip": "example"
    }
  ]
}
```

### List a subscription's products

List the products (lines) on a subscription, with quantity and price. Removed lines are left out unless you ask for them.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription whose products to list.
- Include removed products (`include_removed`, true/false): Also list products that were removed from the subscription.
- Limit (`limit`, number): How many lines to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many lines to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "ProductVariant": {
        "id": "example",
        "price": 1,
        "productId": "example",
        "sku": "example",
        "title": "example"
      },
      "createdAt": "example",
      "id": "example",
      "isPrepaid": true,
      "ordersRemaining": 1,
      "priceWithoutDiscount": 1,
      "productVariantId": "example",
      "quantity": 1,
      "removedAt": "example",
      "subscriptionId": "example",
      "titleOverride": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List customers

List customers, newest first. Look one up by email address.

**Inputs**

- Email (`email`, text): Only the customer with exactly this email address.
- Updated since (`updated_since`, date and time): Only customers changed at or after this time.
- Limit (`limit`, number): How many customers to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many customers to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "createdAt": "example",
      "email": "example",
      "firstName": "example",
      "id": "example",
      "lastName": "example",
      "phoneNumber": "example",
      "platformId": "example",
      "removedAt": "example",
      "smsTransactionalOptIn": true,
      "updatedAt": "example"
    }
  ]
}
```

### List orders

List orders, newest first: checkout orders, recurring orders and prepaid deliveries. Filter by customer, subscription or date.

**Inputs**

- Customer (`customer_id`, text): Only this customer's orders.
- Subscription (`subscription_id`, text): Only orders made by this subscription.
- Created since (`created_since`, date and time): Only orders created at or after this time.
- Limit (`limit`, number): How many orders to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many orders to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "cancelledAt": "example",
      "createdAt": "example",
      "currencyCode": "example",
      "deliveredAt": "example",
      "fulfillAt": "example",
      "id": "example",
      "name": "example",
      "note": "example",
      "platformId": "example",
      "platformNumber": "example",
      "prepaidSubscriptionId": "example",
      "processedAt": "example",
      "storefrontUserId": "example",
      "totalPrice": 1,
      "totalPricePresentmentAmount": 1,
      "updatedAt": "example"
    }
  ]
}
```

### List product variants

List product variants with their Skio ID, which adding a product to a subscription needs. Find one by SKU.

**Inputs**

- Product (`product_id`, text): Only variants of this product.
- SKU (`sku`, text): Only the variant with exactly this SKU.
- Include deleted variants (`include_deleted`, true/false): Also list variants deleted in Shopify.
- Limit (`limit`, number): How many variants to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many variants to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "Product": {
        "id": "example",
        "title": "example"
      },
      "compareAtPrice": 1,
      "createdAt": "example",
      "deletedAt": "example",
      "id": "example",
      "outOfStockAt": "example",
      "platformId": "example",
      "price": 1,
      "productId": "example",
      "requiresShipping": true,
      "sku": "example",
      "title": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List products

List the store's products, newest first. Deleted products are left out unless you ask for them.

**Inputs**

- Title contains (`title`, text): Only products whose title contains this text.
- Include deleted products (`include_deleted`, true/false): Also list products deleted in Shopify.
- Limit (`limit`, number): How many products to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many products to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "createdAt": "example",
      "deletedAt": "example",
      "description": "example",
      "id": "example",
      "imageSrc": "example",
      "platformId": "example",
      "slug": "example",
      "status": "example",
      "title": "example",
      "updatedAt": "example"
    }
  ]
}
```

### List subscriptions

List subscriptions, newest first, with their customer and current products. Filter by status, customer email or when they changed.

**Inputs**

- Status (`status`, text): Only subscriptions with this status. One of: `ACTIVE`, `PAUSED`, `CANCELLED`, `FAILED` (Payment failed), `UNDER_REVIEW` (Under fraud review).
- Customer email (`customer_email`, text): Only the subscriptions of the customer with this email address.
- Updated since (`updated_since`, date and time): Only subscriptions changed at or after this time.
- Next billing on or before (`next_billing_before`, date): Only subscriptions that next bill on or before this date, such as the coming week's renewals.
- Limit (`limit`, number): How many subscriptions to return, up to 100. From 1 to 100. Default: `25`.
- Offset (`offset`, number): How many subscriptions to skip, to read the next page. At least 0.

**Outputs**

- `data` (list): The response from Skio.

**Example output**

```json
{
  "data": [
    {
      "BillingPolicy": {
        "interval": "DAY",
        "intervalCount": 1
      },
      "StorefrontUser": {
        "email": "example",
        "firstName": "example",
        "id": "example",
        "lastName": "example"
      },
      "SubscriptionLines": [
        {
          "ProductVariant": {
            "id": "example",
            "sku": "example",
            "title": "example"
          },
          "id": "example",
          "priceWithoutDiscount": 1,
          "productVariantId": "example",
          "quantity": 1
        }
      ],
      "billingPolicyId": "example",
      "cancelledAt": "example",
      "churnScore": 1,
      "createdAt": "example",
      "currencyCode": "example",
      "cyclesCompleted": 1,
      "deliveryPolicyId": "example",
      "deliveryPrice": 1,
      "id": "example",
      "isPickup": true,
      "lastBillingAttemptAt": "example",
      "nextBillingDate": "example",
      "nextRenewalDate": "example",
      "note": "example",
      "platformId": "example",
      "shippingAddressId": "example",
      "status": "ACTIVE",
      "statusContext": "example",
      "storefrontUserId": "example",
      "updatedAt": "example"
    }
  ]
}
```

### Pause a subscription

Pause an active subscription. Leave the length empty to pause until it is resumed; give one to pause for that long, after which it bills again.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Pause for (`pause_for`, number): How long to pause, such as 2. Leave empty to pause until resumed.
- Unit (`unit`, text): The unit of the pause length. Billing intervals counts the subscription's own billing periods. One of: `DAY` (Days), `WEEK` (Weeks), `MONTH` (Months), `YEAR` (Years), `RELATIVE` (Billing intervals).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "ok": true
  }
}
```

### Reactivate a subscription

Reactivate a cancelled subscription and set when it next bills. No order is placed now.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Next billing date (`next_billing_date`, date, required): When the subscription next bills, up to 5 years ahead.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Resume a subscription

Resume a paused subscription. If its next billing date has passed, it bills almost right away.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- End a timed pause (`end_temporary_pause`, true/false): End a pause that was set for a length of time, keeping the next billing date, instead of resuming an indefinitely paused subscription.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "ok": true
  }
}
```

### Skip the next order

Move the next billing date forward, by one billing period unless you say how far. The customer gets your skip email.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Skip by (`skip_by`, number): How far to move the date, such as 2. Leave empty for one billing period.
- Unit (`unit`, text): The unit of how far to skip. One of: `DAY` (Days), `WEEK` (Weeks), `MONTH` (Months), `YEAR` (Years), `RELATIVE` (Billing intervals).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "nextBillingDate": "example",
    "ok": true
  }
}
```

### Swap a product on a subscription

Replace one product variant on a subscription with another, keeping the price unless you choose otherwise.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Current variant (`old_variant_id`, text, required): The variant now on the subscription.
- New variant (`new_variant_id`, text, required): The variant to swap in.
- Price (`pricing`, text): Which price the swapped-in product gets. Leave empty to keep the current price. One of: `SAME` (Keep the current price), `NEW_VARIANT_PRICE` (Use the new product's subscription price), `CUSTOM` (Set a custom price).
- Custom price (`custom_price`, number): The price per unit, before the selling plan's discount, when Price is a custom price. At least 0.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Update a subscription's note

Replace a subscription's note in Skio and Shopify. No email is sent.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- Note (`note`, text, required): The new note, such as delivery instructions. It replaces the current one.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "note": "example",
    "ok": true
  }
}
```

### Update a subscription's product

Change the quantity, price or title of a product on a subscription. A quantity of 0 removes it; a subscription's last product can't be removed.

**Inputs**

- Subscription line ID (`line_id`, text, required): The subscription line to change, from List a subscription's products.
- Quantity (`quantity`, number): The new quantity. 0 removes the product. At least 0.
- Price (`price`, number): The new price per unit, before discounts. At least 0.
- Title (`title`, text): A custom title for the product on this subscription.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "ok": true
  }
}
```

### Update the shipping address

Change where a subscription ships. Only the fields you fill in change. The customer gets your subscription-edited email.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription to change.
- First name (`first_name`, text): First name.
- Last name (`last_name`, text): Last name.
- Company (`company`, text): Company name.
- Address line 1 (`address1`, text): Street address.
- Address line 2 (`address2`, text): Apartment, suite or unit.
- City (`city`, text): City.
- State (`province`, text): State or province name or code, such as TX.
- ZIP code (`zip`, text): ZIP or postal code.
- Country (`country`, text): Country name or code, such as US.
- Phone (`phone`, text): Phone number, such as +15125550123. Skio clears a number it can't read.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "message": "example",
    "ok": true
  }
}
```
