# Billsby

> Manage subscription customers, subscriptions, invoices and feature tags in Billsby.

App · 24 actions. Web page: https://docs.lodol.com/docs/integrations/billsby

## Actions

### Add feature tags

Add custom feature tags to one or more subscriptions, to switch features on in your product.

**Inputs**

- Subscriptions (`subscription_unique_ids`, list, required): The subscriptions to tag.
- Tags (`tag_names`, list, required): The feature tags to add, such as `pro-reports`.

**Outputs**

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

**Example output**

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

### Cancel a subscription

Cancel a customer's subscription straight away.

**Inputs**

- Subscription (`subscription_unique_id`, text, required): The subscription, by its Billsby subscription ID (such as `Y7MX4G314L`).
- Customer (`customer_unique_id`, text, required): The customer the subscription belongs to.

**Outputs**

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

**Example output**

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

### Change a subscription's plan

Move a subscription to another plan and billing cycle, now or at its next renewal.

**Inputs**

- Subscription (`subscription_unique_id`, text, required): The subscription, by its Billsby subscription ID (such as `Y7MX4G314L`).
- Customer (`customer_unique_id`, text, required): The customer the subscription belongs to.
- Product (`product_id`, number): The product whose plans to choose from.
- Plan (`plan_id`, number, required): The plan to move to.
- Billing cycle (`cycle_id`, number, required): The billing cycle (price and frequency) of the new plan.
- When (`when`, text): When the change takes effect. Leave empty to change it now. One of: `Now`, `At next renewal`.
- Units (`units`, number): How many units, for a cycle priced per unit. At least 1.
- Refund unused time (`issue_refund`, true/false): For a change made now, credit the unused part of the current plan on the first invoice of the new one.

**Outputs**

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

**Example output**

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

### Create a customer

Create a customer without a subscription. Add a subscription to them later in Billsby or its checkout.

**Inputs**

- First name (`first_name`, text, required): The customer's first name.
- Last name (`last_name`, text, required): The customer's last name.
- Email (`email`, text, required): The customer's email address.
- Address line 1 (`address_line_1`, text, required): Street address.
- Address line 2 (`address_line_2`, text): Apartment, suite or area.
- City (`city`, text, required): City.
- State or region (`state`, text, required): State, county or region. For a US address, the two-letter state code, such as `CA`.
- Country (`country`, text, required): Three-letter ISO country code, such as `USA`, `GBR` or `DEU`.
- Postcode (`post_code`, text, required): Postcode or ZIP code.

**Outputs**

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

**Example output**

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

### Create a one-time charge

Charge a customer once, outside their subscription. Billsby raises an invoice and takes the payment from the card on file.

**Inputs**

- Customer (`customer_unique_id`, text, required): The customer, by their Billsby customer ID (such as `6ZY37ULDEF`).
- Description (`description`, text, required): What the charge is for, shown on the invoice.
- Amount (`amount`, number, required): The amount in the currency's smallest unit, such as cents: `1000` charges 10.00. At least 1.
- Currency (`currency_code`, text, required): Three-letter currency code, such as `USD`, `GBP` or `EUR`.

**Outputs**

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

**Example output**

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

### Delete a customer

Delete a customer from Billsby.

**Inputs**

- Customer (`customer_unique_id`, text, required): The customer, by their Billsby customer ID (such as `6ZY37ULDEF`).

**Outputs**

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

**Example output**

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

### Get a customer

Get a customer's details, address and payment totals.

**Inputs**

- Customer (`customer_unique_id`, text, required): The customer, by their Billsby customer ID (such as `6ZY37ULDEF`).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "additionalEmail": "example",
    "averageAmountPerMonth": "example",
    "billingAddress": {
      "addressLine1": "example",
      "addressLine2": "example",
      "city": "example",
      "country": "example",
      "postCode": "example",
      "state": "example"
    },
    "cardStatus": "example",
    "companyCurrency": "example",
    "createdOn": "example",
    "customerUniqueId": "example",
    "email": "example",
    "firstName": "example",
    "isMarketingConsentGiven": true,
    "lastName": "example",
    "phoneNumber": "example",
    "phoneNumberDialCode": "example",
    "phoneNumberDialCountry": "example",
    "status": "example",
    "totalAmountPaid": "example"
  }
}
```

### Get a subscription

Get a subscription's plan, status, next billing date and amount.

**Inputs**

- Subscription (`subscription_unique_id`, text, required): The subscription, by its Billsby subscription ID (such as `Y7MX4G314L`).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "contractMinimumTermEnd": "example",
    "createdOn": "example",
    "currency": "example",
    "customerEmail": "example",
    "customerFullname": "example",
    "customerId": 1,
    "customerUniqueId": "example",
    "cycleId": 1,
    "nextBillingAmount": 1,
    "nextBillingAmountFormatted": "example",
    "nextBillingDate": "example",
    "planId": 1,
    "planName": "example",
    "planPricingModel": {},
    "productId": 1,
    "productName": "example",
    "status": "example",
    "subscriptionId": 1,
    "subscriptionUniqueId": "example",
    "totalRevenue": 1,
    "totalRevenueFormatted": "example",
    "units": 1
  }
}
```

### Get an invoice

Get an invoice with its customer, amounts, taxes and line items.

**Inputs**

- Invoice number (`invoice_number`, text, required): The invoice number, such as `0WX1VTRPWY-1`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "addressCity": "example",
    "addressCountry": "example",
    "addressLine1": "example",
    "amount": "example",
    "createdOn": "example",
    "currency": "example",
    "customerEmail": "example",
    "customerFirstName": "example",
    "customerLastName": "example",
    "customerUniqueId": "example",
    "formattedAmount": "example",
    "invoiceId": "example",
    "invoiceNumber": "example",
    "invoiceType": "example",
    "status": "example",
    "subTotal": "example",
    "subscriptions": [
      {}
    ],
    "taxTotal": "example",
    "taxes": [
      {}
    ]
  }
}
```

### List a customer's invoices

List the invoices of one customer.

**Inputs**

- Customer (`customer_unique_id`, text, required): The customer, by their Billsby customer ID (such as `6ZY37ULDEF`).

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "amount": 1,
      "createdOn": "example",
      "currency": "example",
      "formattedAmount": "example",
      "invoiceId": 1,
      "invoiceNumber": "example",
      "linkedTransactionsCount": 1,
      "refundableAmount": 1,
      "status": "example"
    }
  ]
}
```

### List a customer's subscriptions

List the subscriptions of one customer.

**Inputs**

- Customer (`customer_unique_id`, text, required): The customer, by their Billsby customer ID (such as `6ZY37ULDEF`).

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "createdOn": "example",
      "currency": "example",
      "nextBilling": "example",
      "planId": 1,
      "planName": "example",
      "productId": 1,
      "productName": "example",
      "revenue": "example",
      "status": "example",
      "subscriptionId": "example",
      "units": 1
    }
  ]
}
```

### List a product's plans

List the plans of a product, with their billing cycles and feature tags.

**Inputs**

- Product (`product_id`, number, required): The product.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "cycles": [
        {
          "cycleId": 1,
          "planId": 1,
          "pricingModel": {},
          "visibility": "example"
        }
      ],
      "description": "example",
      "displayName": "example",
      "featureTags": [
        "example"
      ],
      "hasActiveSubscription": true,
      "name": "example",
      "planId": 1,
      "pricingModelType": 1,
      "productId": 1,
      "visibility": "example"
    }
  ]
}
```

### List a subscription's events

List the event log of a subscription: plan changes, payments, cancellations and more.

**Inputs**

- Subscription (`subscription_unique_id`, text, required): The subscription, by its Billsby subscription ID (such as `Y7MX4G314L`).
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Results per page (`page_size`, number): How many results per page, up to 100. Leave empty for 50. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "currentPage": 1,
    "pageCount": 1,
    "pageSize": 1,
    "results": [
      {
        "createdOn": "example",
        "eventData": {},
        "subscriptionEventLogId": 1,
        "type": "example"
      }
    ],
    "rowCount": 1
  }
}
```

### List a subscription's feature tags

List the feature tags on a subscription, from its plan and added by hand.

**Inputs**

- Subscription (`subscription_unique_id`, text, required): The subscription, by its Billsby subscription ID (such as `Y7MX4G314L`).

**Outputs**

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

**Example output**

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

### List credit notes

List the credit notes (refunds) across your Billsby account.

**Inputs**

- Search (`search`, text): Only credit notes matching this text.
- Status (`status`, text): Only credit notes with this status. One of: `Pending`, `Paid`, `Failed`.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Results per page (`page_size`, number): How many results per page, up to 100. Leave empty for 50. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "currentPage": 1,
    "pageCount": 1,
    "pageSize": 1,
    "results": [
      {
        "amount": "example",
        "createdOn": "example",
        "creditNoteId": 1,
        "creditNoteUniqueId": "example",
        "currency": "example",
        "customerFirstName": "example",
        "customerFullName": "example",
        "customerId": 1,
        "customerLastName": "example",
        "customerUniqueId": "example",
        "status": "example"
      }
    ],
    "rowCount": 1
  }
}
```

### List customers

List the customers in your Billsby account, a page at a time, optionally searching by name.

**Inputs**

- Search (`search`, text): Only customers whose name contains this text.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Results per page (`page_size`, number): How many results per page, up to 100. Leave empty for 50. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "currentPage": 1,
    "pageCount": 1,
    "pageSize": 1,
    "results": [
      {
        "billingAddress": {
          "addressLine1": "example",
          "addressLine2": "example",
          "city": "example",
          "country": "example",
          "postCode": "example",
          "state": "example"
        },
        "createdOn": "example",
        "customerUniqueId": "example",
        "email": "example",
        "firstName": "example",
        "lastName": "example",
        "phoneNumber": "example",
        "status": "example"
      }
    ],
    "rowCount": 1
  }
}
```

### List invoices

List the invoices across your Billsby account, optionally by status or a search.

**Inputs**

- Search (`search`, text): Only invoices matching this text, such as a customer name or invoice number.
- Status (`status`, text): Only invoices with this status. One of: `Pending`, `Paid`, `Unpaid`, `Paid offline`, `Written off`.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Results per page (`page_size`, number): How many results per page, up to 100. Leave empty for 50. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "currentPage": 1,
    "pageCount": 1,
    "pageSize": 1,
    "results": [
      {
        "amount": 1,
        "createdOn": "example",
        "currency": "example",
        "customerFirstName": "example",
        "customerFullName": "example",
        "customerId": 1,
        "customerLastName": "example",
        "customerUniqueId": "example",
        "formattedAmount": "example",
        "invoiceId": 1,
        "invoiceNumber": "example",
        "status": "example"
      }
    ],
    "rowCount": 1
  }
}
```

### List products

List the products in your Billsby account.

**Inputs**

- Search (`search`, text): Only products whose name contains this text.
- Visibility (`visibility`, text): Only products with this visibility. One of: `Public`, `Hidden`, `Internal`, `Off sale`.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Results per page (`page_size`, number): How many results per page, up to 100. Leave empty for 50. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "currentPage": 1,
    "pageCount": 1,
    "pageSize": 1,
    "results": [
      {
        "alertEmail": "example",
        "billingCurrency": "example",
        "description": "example",
        "displayName": "example",
        "hasPlans": true,
        "name": "example",
        "numberOfPlans": 1,
        "productId": 1,
        "visibility": 1
      }
    ],
    "rowCount": 1
  }
}
```

### List subscriptions

List subscriptions, optionally only active ones, those in a free trial, or those on a product or plan.

**Inputs**

- Active only (`is_active`, true/false): Only active subscriptions.
- In free trial only (`is_in_free_trial`, true/false): Only subscriptions in a free trial.
- Product name (`product_name`, text): Only subscriptions to products with this name.
- Plan name (`plan_name`, text): Only subscriptions on plans with this name.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first page. At least 1.
- Results per page (`page_size`, number): How many results per page, up to 100. Leave empty for 50. From 1 to 100.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "currentPage": 1,
    "pageCount": 1,
    "pageSize": 1,
    "results": [
      {
        "createdOn": "example",
        "customerEmail": "example",
        "customerFullname": "example",
        "customerId": 1,
        "customerUniqueId": "example",
        "isInFreeTrial": true,
        "planId": "example",
        "planName": "example",
        "productId": "example",
        "productName": "example",
        "status": "example",
        "subscriptionId": 1,
        "subscriptionUniqueId": "example"
      }
    ],
    "rowCount": 1
  }
}
```

### Mark an invoice paid offline

Record that an unpaid invoice was paid outside Billsby, such as by bank transfer.

**Inputs**

- Invoice number (`invoice_number`, text, required): The invoice number, such as `0WX1VTRPWY-1`.

**Outputs**

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

**Example output**

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

### Remove a feature tag

Remove a custom feature tag from a subscription.

**Inputs**

- Tag (`tag_name`, text, required): The feature tag to remove.
- Subscription (`subscription_unique_id`, text, required): The subscription to remove it from.

**Outputs**

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

**Example output**

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

### Update a customer

Change a customer's name, email, phone number or billing address. Fields left empty keep their current value.

**Inputs**

- Customer (`customer_unique_id`, text, required): The customer, by their Billsby customer ID (such as `6ZY37ULDEF`).
- First name (`first_name`, text): New first name.
- Last name (`last_name`, text): New last name.
- Email (`email`, text): New email address.
- Phone country (`phone_dial_country`, text): The country of the phone number, such as `UK` or `US`.
- Phone dialing code (`phone_dial_code`, text): The phone number's dialing code, such as `+44`.
- Phone number (`phone_number`, text): The phone number, without the leading 0.
- Address line 1 (`address_line_1`, text): Street address.
- Address line 2 (`address_line_2`, text): Apartment, suite or area.
- City (`city`, text): City.
- State or region (`state`, text): State, county or region. For a US address, the two-letter state code, such as `CA`.
- Country (`country`, text): Three-letter ISO country code, such as `USA`, `GBR` or `DEU`.
- Postcode (`post_code`, text): Postcode or ZIP code.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "additionalEmail": "example",
    "averageAmountPerMonth": "example",
    "billingAddress": {
      "addressLine1": "example",
      "addressLine2": "example",
      "city": "example",
      "country": "example",
      "postCode": "example",
      "state": "example"
    },
    "cardStatus": "example",
    "companyCurrency": "example",
    "createdOn": "example",
    "customerUniqueId": "example",
    "email": "example",
    "firstName": "example",
    "isMarketingConsentGiven": true,
    "lastName": "example",
    "phoneNumber": "example",
    "phoneNumberDialCode": "example",
    "phoneNumberDialCountry": "example",
    "status": "example",
    "totalAmountPaid": "example"
  }
}
```

### Update a subscription's renewal date

Move a subscription's next renewal date, optionally pausing it until then.

**Inputs**

- Subscription (`subscription_unique_id`, text, required): The subscription, by its Billsby subscription ID (such as `Y7MX4G314L`).
- Next renewal date (`new_renewal_date`, date, required): The new next renewal date.
- Pause until then (`pause_subscription`, true/false): Pause the subscription until the new renewal date.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Write off an invoice

Write off an unpaid invoice, so Billsby stops trying to collect it.

**Inputs**

- Invoice number (`invoice_number`, text, required): The invoice number, such as `0WX1VTRPWY-1`.

**Outputs**

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

**Example output**

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