# Maxio

> Manage customers, subscriptions, usage and invoices in Maxio Advanced Billing (formerly Chargify).

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

## Actions

### Cancel subscription

Cancel a subscription now, so it stops renewing. It can be reactivated later.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.
- Reason (`cancellation_message`, text): Why it is being canceled, for your own records.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### Create customer

Create a customer, whom you can then sign up for subscriptions.

**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 email address Maxio sends invoices and receipts to.
- CC emails (`cc_emails`, text): More addresses to copy on emails, separated by commas.
- Company (`organization`, text): The customer's company name.
- Reference (`reference`, text): Your own unique ID for the customer, such as the ID in your app.
- Phone (`phone`, text): The customer's phone number.
- Address (`address`, text): The first line of the billing address.
- Address line 2 (`address_2`, text): The second line of the billing address.
- City (`city`, text): The billing address's city.
- State (`state`, text): The state or region as its ISO code, such as MA for Massachusetts.
- Postal code (`zip`, text): The postal or ZIP code.
- Country (`country`, text): The country as its two-letter ISO code, such as US or GB.
- Language (`locale`, text): The language for this customer's invoices, such as en-US or es-MX.
- VAT number (`vat_number`, text): The customer's VAT number.
- Tax exempt (`tax_exempt`, true/false): Whether the customer is exempt from tax.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "address": "example",
    "address_2": "example",
    "cc_emails": "example",
    "city": "example",
    "country": "example",
    "created_at": "example",
    "email": "example",
    "first_name": "example",
    "id": 1,
    "last_name": "example",
    "locale": "example",
    "organization": "example",
    "parent_id": 1,
    "phone": "example",
    "reference": "example",
    "state": "example",
    "tax_exempt": true,
    "updated_at": "example",
    "vat_number": "example",
    "zip": "example"
  }
}
```

### Create subscription

Sign an existing customer up to a product. With Send an invoice, no card is needed.

**Inputs**

- Customer (`customer_id`, number, required): The customer to subscribe.
- Product (`product_handle`, text, required): The product to subscribe them to.
- Collect payment by (`payment_collection_method`, text): How Maxio collects payment: charge the customer's saved payment method, send an invoice, or draw on a prepaid balance. One of: `automatic` (Charge the saved payment method), `remittance` (Send an invoice), `prepaid` (Prepaid balance).
- Coupon codes (`coupon_codes`, list): Coupon codes to apply.
- Reference (`reference`, text): Your own unique ID for the subscription.
- First billing (`next_billing_at`, date and time): Bill first at this time instead of now. No trial or signup charges apply, which suits moving existing subscribers over.
- Expires (`expires_at`, date and time): When the subscription ends. Leave empty to keep renewing.
- Payment terms (days) (`net_terms`, number): For invoiced subscriptions, how many days after an invoice is issued it is due, from 0 to 180. From 0 to 180.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### Delete customer

Delete a customer. Maxio refuses while the customer has subscriptions.

**Inputs**

- Customer (`customer_id`, number, required): The Maxio customer.

**Outputs**

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

**Example output**

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

### Get customer

Get a customer's details.

**Inputs**

- Customer (`customer_id`, number, required): The Maxio customer.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "address": "example",
    "address_2": "example",
    "cc_emails": "example",
    "city": "example",
    "country": "example",
    "created_at": "example",
    "email": "example",
    "first_name": "example",
    "id": 1,
    "last_name": "example",
    "locale": "example",
    "organization": "example",
    "parent_id": 1,
    "phone": "example",
    "reference": "example",
    "state": "example",
    "tax_exempt": true,
    "updated_at": "example",
    "vat_number": "example",
    "zip": "example"
  }
}
```

### Get invoice

Get an invoice with its amounts, dates, status and line items.

**Inputs**

- Invoice (`invoice_uid`, text, required): The invoice. Its ID starts with inv_; it is not the invoice number.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "collection_method": "example",
    "created_at": "example",
    "currency": "example",
    "customer": {
      "chargify_id": 1,
      "email": "example",
      "first_name": "example",
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "customer_id": 1,
    "discount_amount": "example",
    "due_amount": "example",
    "due_date": "example",
    "issue_date": "example",
    "memo": "example",
    "number": "example",
    "paid_amount": "example",
    "paid_date": "example",
    "product_name": "example",
    "public_url": "example",
    "status": "example",
    "subscription_id": 1,
    "subtotal_amount": "example",
    "tax_amount": "example",
    "total_amount": "example",
    "uid": "example",
    "updated_at": "example"
  }
}
```

### Get subscription

Get a subscription with its state, product, customer and billing dates.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### List components

List the add-ons and usage-based components of your products.

**Inputs**

- Include archived (`include_archived`, true/false): Include archived components.
- Page (`page`, number): Which page of components to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many components to return, up to 200. Maxio's default is 20. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "archived": true,
        "created_at": "example",
        "description": "example",
        "handle": "example",
        "id": 1,
        "kind": "example",
        "name": "example",
        "pricing_scheme": "example",
        "product_family_id": 1,
        "product_family_name": "example",
        "unit_name": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List coupons

List your coupons with their codes and discounts.

**Inputs**

- Page (`page`, number): Which page of coupons to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many coupons to return, up to 200. Maxio's default is 30. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "amount_in_cents": 1,
        "archived_at": "example",
        "code": "example",
        "created_at": "example",
        "description": "example",
        "end_date": "example",
        "id": 1,
        "name": "example",
        "percentage": "example",
        "product_family_id": 1,
        "product_family_name": "example",
        "recurring": true,
        "stackable": true,
        "start_date": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List customers

List your customers, or search them by name, email, company, reference or ID.

**Inputs**

- Search (`q`, text): Search text: an email, a name, a company, a reference or a Maxio ID.
- Order (`direction`, text): Newest first or oldest first. One of: `desc` (Newest first), `asc` (Oldest first).
- Filter by date (`date_field`, text): Which of the customers' dates From and To filter on. One of: `created_at` (Created), `updated_at` (Updated).
- From (`start_date`, date): Only those on or after this date, in your site's time zone.
- To (`end_date`, date): Only those on or before this date, in your site's time zone.
- Page (`page`, number): Which page of customers to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many customers to return, up to 200. Maxio's default is 50. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "address": "example",
        "address_2": "example",
        "cc_emails": "example",
        "city": "example",
        "country": "example",
        "created_at": "example",
        "email": "example",
        "first_name": "example",
        "id": 1,
        "last_name": "example",
        "locale": "example",
        "organization": "example",
        "parent_id": 1,
        "phone": "example",
        "reference": "example",
        "state": "example",
        "tax_exempt": true,
        "updated_at": "example",
        "vat_number": "example",
        "zip": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List events

List what has happened on your site, such as signups, payments, renewals and state changes, newest first.

**Inputs**

- Kinds of event (`kinds`, list): Only these kinds of events. Leave empty for all. One or more of: `signup_success` (Signup succeeded), `signup_failure` (Signup failed), `payment_success` (Payment succeeded), `payment_failure` (Payment failed), `renewal_success` (Renewal succeeded), `renewal_failure` (Renewal failed), `subscription_state_change` (Subscription state changed), `subscription_product_change` (Subscription product changed), `pending_cancellation_change` (Scheduled cancellation changed), `billing_date_change` (Billing date changed), and 21 more.
- From event ID (`since_id`, number): Only events with this ID or a later one.
- Order (`direction`, text): Newest first or oldest first. One of: `desc` (Newest first), `asc` (Oldest first).
- Page (`page`, number): Which page of events to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many events to return, up to 200. Maxio's default is 20. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "created_at": "example",
        "customer_id": 1,
        "event_specific_data": {},
        "id": 1,
        "key": "example",
        "message": "example",
        "subscription_id": 1
      }
    ],
    "next_page": 1
  }
}
```

### List invoices

List invoices, filtered by status, subscription, customer or a date.

**Inputs**

- Status (`status`, text): Only invoices with this status. One of: `draft`, `open`, `pending`, `processing`, `paid`, `voided`, `canceled`.
- Subscription (`subscription_id`, number): Only this subscription's invoices.
- Customers (`customer_ids`, list): Only these customers' invoices.
- Sort by (`sort`, text): What to sort by. Maxio sorts by invoice number unless told otherwise. One of: `number` (Invoice number), `created_at` (Created), `updated_at` (Updated), `issue_date` (Issue date), `due_date` (Due date), `status`, `total_amount` (Total), `due_amount` (Amount due).
- Order (`direction`, text): Newest first or oldest first. One of: `desc` (Newest first), `asc` (Oldest first).
- Filter by date (`date_field`, text): Which of the invoices' dates From and To filter on. One of: `due_date` (Due date), `issue_date` (Issue date), `paid_date` (Paid date), `created_at` (Created), `updated_at` (Updated).
- From (`start_date`, date): Only those on or after this date, in your site's time zone.
- To (`end_date`, date): Only those on or before this date, in your site's time zone.
- Include line items (`line_items`, true/false): Include each invoice's line items.
- Page (`page`, number): Which page of invoices to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many invoices to return, up to 200. Maxio's default is 20. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "collection_method": "example",
        "created_at": "example",
        "currency": "example",
        "customer": {
          "chargify_id": 1,
          "email": "example",
          "first_name": "example",
          "last_name": "example",
          "organization": "example",
          "reference": "example"
        },
        "customer_id": 1,
        "discount_amount": "example",
        "due_amount": "example",
        "due_date": "example",
        "issue_date": "example",
        "memo": "example",
        "number": "example",
        "paid_amount": "example",
        "paid_date": "example",
        "product_name": "example",
        "public_url": "example",
        "status": "example",
        "subscription_id": 1,
        "subtotal_amount": "example",
        "tax_amount": "example",
        "total_amount": "example",
        "uid": "example",
        "updated_at": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List product families

List your product families, the groups your products, components and coupons belong to.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "archived_at": "example",
        "created_at": "example",
        "description": "example",
        "handle": "example",
        "id": 1,
        "name": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### List products

List the products customers can subscribe to, with their prices and handles.

**Inputs**

- Include archived (`include_archived`, true/false): Include archived products.
- Page (`page`, number): Which page of products to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many products to return, up to 200. Maxio's default is 20. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "archived_at": "example",
        "created_at": "example",
        "description": "example",
        "handle": "example",
        "id": 1,
        "initial_charge_in_cents": 1,
        "interval": 1,
        "interval_unit": "example",
        "name": "example",
        "price_in_cents": 1,
        "product_family": {
          "handle": "example",
          "id": 1,
          "name": "example"
        },
        "require_credit_card": true,
        "trial_price_in_cents": 1,
        "updated_at": "example"
      }
    ],
    "next_page": 1
  }
}
```

### List subscription components

List the components on a subscription, with their allocated quantities.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.
- Only in use (`in_use`, true/false): Only components the subscription is using now.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "allocated_quantity": 1,
        "component_handle": "example",
        "component_id": 1,
        "created_at": "example",
        "enabled": true,
        "kind": "example",
        "name": "example",
        "price_point_id": 1,
        "price_point_name": "example",
        "pricing_scheme": "example",
        "subscription_id": 1,
        "unit_balance": 1,
        "unit_name": "example",
        "updated_at": "example"
      }
    ]
  }
}
```

### List subscriptions

List subscriptions, filtered by state, customer or a date.

**Inputs**

- State (`state`, text): Only subscriptions in this state. One of: `active`, `trialing`, `trial_ended` (Trial ended), `past_due` (Past due), `unpaid`, `on_hold` (On hold), `awaiting_signup` (Awaiting signup), `awaiting_signup_date` (Awaiting signup date), `pending_cancellation` (Pending cancellation), `pending_renewal` (Pending renewal), and 5 more.
- Customer (`customer_id`, number): Only this customer's subscriptions.
- Search (`q`, text): Search text, such as a customer's name or email or a reference.
- Sort by (`sort`, text): What to sort by. Maxio sorts by signup date unless told otherwise. One of: `signup_date` (Signup date), `created_at` (Created), `updated_at` (Updated), `period_start` (Period start), `period_end` (Period end), `next_assessment` (Next billing), `expires_at` (Expires), `total_payments` (Total paid), `open_balance` (Open balance), `id`.
- Order (`direction`, text): Newest first or oldest first. One of: `desc` (Newest first), `asc` (Oldest first).
- Filter by date (`date_field`, text): Which of the subscriptions' dates From and To filter on. One of: `created_at` (Created), `updated_at` (Updated), `activated_at` (Activated), `canceled_at` (Canceled), `expires_at` (Expires), `current_period_starts_at` (Current period start), `current_period_ends_at` (Current period end), `trial_started_at` (Trial start), `trial_ended_at` (Trial end).
- From (`start_date`, date): Only those on or after this date, in your site's time zone.
- To (`end_date`, date): Only those on or before this date, in your site's time zone.
- Page (`page`, number): Which page of subscriptions to read, starting at 1. Use the next_page a previous list step returned. At least 1.
- Per page (`per_page`, number): How many subscriptions to return, up to 200. Maxio's default is 20. From 1 to 200.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "activated_at": "example",
        "automatically_resume_at": "example",
        "balance_in_cents": 1,
        "canceled_at": "example",
        "cancellation_message": "example",
        "coupon_codes": [
          "example"
        ],
        "created_at": "example",
        "currency": "example",
        "current_billing_amount_in_cents": 1,
        "current_period_ends_at": "example",
        "current_period_started_at": "example",
        "customer": {
          "email": "example",
          "first_name": "example",
          "id": 1,
          "last_name": "example",
          "organization": "example",
          "reference": "example"
        },
        "expires_at": "example",
        "id": 1,
        "next_assessment_at": "example",
        "on_hold_at": "example",
        "payment_collection_method": "example",
        "previous_state": "example",
        "product": {
          "handle": "example",
          "id": 1,
          "name": "example",
          "price_in_cents": 1
        },
        "product_price_in_cents": 1,
        "reference": "example",
        "state": "example",
        "total_revenue_in_cents": 1,
        "updated_at": "example"
      }
    ],
    "next_page": 1
  }
}
```

### Pause subscription

Put a subscription on hold so it stops renewing. Maxio refuses within 24 hours of the next billing date.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.
- Resume on (`automatically_resume_at`, date and time): Resume the subscription at this time. Leave empty to keep it on hold until it is resumed.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### Reactivate subscription

Reactivate a canceled subscription or one whose trial ended. The customer may be charged for a new period.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.
- Resume the canceled period (`resume`, true/false): Pick up the billing period it was canceled in, if that period has not ended, instead of starting a new one.
- Include trial (`include_trial`, true/false): Start with the product's trial, if it has one.
- Keep balance (`preserve_balance`, true/false): Keep the balance it had when canceled instead of clearing it.
- Coupon code (`coupon_code`, text): A coupon code to apply on reactivation.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### Record invoice payment

Record a payment received outside Maxio, such as a check or bank transfer, against an invoice.

**Inputs**

- Invoice (`invoice_uid`, text, required): The invoice. Its ID starts with inv_; it is not the invoice number.
- Amount (`amount`, number, required): How much was paid, in the invoice's currency, for example 10.50. At least 0.01.
- Paid by (`method`, text): How the customer paid. Maxio uses Other when this is empty. One of: `check`, `cash`, `money_order` (Money order), `ach` (ACH bank transfer), `credit_card` (Card), `other`.
- Details (`details`, text): Details of the payment, such as a check number.
- Memo (`memo`, text): A note about the payment.
- Received on (`received_on`, date): The date the payment was received. It must be in the past.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "collection_method": "example",
    "created_at": "example",
    "currency": "example",
    "customer": {
      "chargify_id": 1,
      "email": "example",
      "first_name": "example",
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "customer_id": 1,
    "discount_amount": "example",
    "due_amount": "example",
    "due_date": "example",
    "issue_date": "example",
    "memo": "example",
    "number": "example",
    "paid_amount": "example",
    "paid_date": "example",
    "product_name": "example",
    "public_url": "example",
    "status": "example",
    "subscription_id": 1,
    "subtotal_amount": "example",
    "tax_amount": "example",
    "total_amount": "example",
    "uid": "example",
    "updated_at": "example"
  }
}
```

### Record usage

Record usage of a metered or prepaid component, such as API calls or hours, for the next invoice.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.
- Component (`component_id`, number, required): The metered or prepaid component on the subscription.
- Quantity (`quantity`, number, required): How many units were used. Whole numbers unless the component allows fractions.
- Memo (`memo`, text): A note shown with the usage, such as what it was for.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "component_handle": "example",
    "component_id": 1,
    "created_at": "example",
    "id": 1,
    "memo": "example",
    "price_point_id": 1,
    "quantity": 1,
    "subscription_id": 1
  }
}
```

### Resume subscription

Take a subscription off hold. If its renewal date has passed, Maxio bills it now.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### Update customer

Change a customer's details. Anything left empty stays as it is.

**Inputs**

- Customer (`customer_id`, number, required): The Maxio customer.
- First name (`first_name`, text): The customer's first name.
- Last name (`last_name`, text): The customer's last name.
- Email (`email`, text): The email address Maxio sends invoices and receipts to.
- CC emails (`cc_emails`, text): More addresses to copy on emails, separated by commas.
- Company (`organization`, text): The customer's company name.
- Reference (`reference`, text): Your own unique ID for the customer, such as the ID in your app.
- Phone (`phone`, text): The customer's phone number.
- Address (`address`, text): The first line of the billing address.
- Address line 2 (`address_2`, text): The second line of the billing address.
- City (`city`, text): The billing address's city.
- State (`state`, text): The state or region as its ISO code, such as MA for Massachusetts.
- Postal code (`zip`, text): The postal or ZIP code.
- Country (`country`, text): The country as its two-letter ISO code, such as US or GB.
- Language (`locale`, text): The language for this customer's invoices, such as en-US or es-MX.
- VAT number (`vat_number`, text): The customer's VAT number.
- Tax exempt (`tax_exempt`, true/false): Whether the customer is exempt from tax.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "address": "example",
    "address_2": "example",
    "cc_emails": "example",
    "city": "example",
    "country": "example",
    "created_at": "example",
    "email": "example",
    "first_name": "example",
    "id": 1,
    "last_name": "example",
    "locale": "example",
    "organization": "example",
    "parent_id": 1,
    "phone": "example",
    "reference": "example",
    "state": "example",
    "tax_exempt": true,
    "updated_at": "example",
    "vat_number": "example",
    "zip": "example"
  }
}
```

### Update subscription

Change a subscription's product, billing date, end date, reference or how it is paid. Anything left empty stays as it is.

**Inputs**

- Subscription (`subscription_id`, number, required): The Maxio subscription.
- New product (`product_handle`, text): Move the subscription to this product.
- Change product at renewal (`product_change_delayed`, true/false): Make the product change at the next renewal instead of now.
- Next billing (`next_billing_at`, date and time): Move the next billing date to this time.
- Expires (`expires_at`, date and time): When the subscription ends.
- Reference (`reference`, text): Your own unique ID for the subscription.
- Collect payment by (`payment_collection_method`, text): How Maxio collects payment from now on. One of: `automatic` (Charge the saved payment method), `remittance` (Send an invoice), `prepaid` (Prepaid balance).
- Email invoices (`receives_invoice_emails`, true/false): Whether the customer is emailed this subscription's invoices.
- Payment terms (days) (`net_terms`, number): Days after an invoice is issued that it is due, from 0 to 180. From 0 to 180.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "activated_at": "example",
    "automatically_resume_at": "example",
    "balance_in_cents": 1,
    "canceled_at": "example",
    "cancellation_message": "example",
    "coupon_codes": [
      "example"
    ],
    "created_at": "example",
    "currency": "example",
    "current_billing_amount_in_cents": 1,
    "current_period_ends_at": "example",
    "current_period_started_at": "example",
    "customer": {
      "email": "example",
      "first_name": "example",
      "id": 1,
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "expires_at": "example",
    "id": 1,
    "next_assessment_at": "example",
    "on_hold_at": "example",
    "payment_collection_method": "example",
    "previous_state": "example",
    "product": {
      "handle": "example",
      "id": 1,
      "name": "example",
      "price_in_cents": 1
    },
    "product_price_in_cents": 1,
    "reference": "example",
    "state": "example",
    "total_revenue_in_cents": 1,
    "updated_at": "example"
  }
}
```

### Validate coupon

Check that a coupon code exists and can be used, and get its discount. An unknown code fails the step.

**Inputs**

- Code (`code`, text, required): The coupon code to check.
- Product family (`product_family_id`, number): Only accept the code in this product family.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "amount_in_cents": 1,
    "archived_at": "example",
    "code": "example",
    "created_at": "example",
    "description": "example",
    "end_date": "example",
    "id": 1,
    "name": "example",
    "percentage": "example",
    "product_family_id": 1,
    "product_family_name": "example",
    "recurring": true,
    "stackable": true,
    "start_date": "example"
  }
}
```

### Void invoice

Void an open, pending or canceled invoice so it is no longer owed. This cannot be undone.

**Inputs**

- Invoice (`invoice_uid`, text, required): The invoice. Its ID starts with inv_; it is not the invoice number.
- Reason (`reason`, text, required): Why the invoice is voided. It is kept with the invoice.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "collection_method": "example",
    "created_at": "example",
    "currency": "example",
    "customer": {
      "chargify_id": 1,
      "email": "example",
      "first_name": "example",
      "last_name": "example",
      "organization": "example",
      "reference": "example"
    },
    "customer_id": 1,
    "discount_amount": "example",
    "due_amount": "example",
    "due_date": "example",
    "issue_date": "example",
    "memo": "example",
    "number": "example",
    "paid_amount": "example",
    "paid_date": "example",
    "product_name": "example",
    "public_url": "example",
    "status": "example",
    "subscription_id": 1,
    "subtotal_amount": "example",
    "tax_amount": "example",
    "total_amount": "example",
    "uid": "example",
    "updated_at": "example"
  }
}
```
