# Pax8

> Run your Pax8 cloud marketplace: manage customer companies and contacts, look up products and pricing, place orders, change or cancel subscriptions, and read invoices and usage.

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

## Actions

### Cancel subscription

Cancel a subscription now or on a date. A commitment may not allow it, or may charge a fee.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription. Pick one, or give its id from an earlier step.
- Cancel on (`cancel_date`, date): The day to cancel it. Leave empty to cancel now.

**Outputs**

- `cancel_date` (text): The day asked for (YYYY-MM-DD), empty for now
- `cancelled` (true/false): Always true once Pax8 accepts it
- `subscription_id` (text): The subscription cancelled

**Example output**

```json
{
  "cancel_date": "",
  "cancelled": true,
  "subscription_id": "05c587df-9e7d-4ef9-8218-0262198e36c9"
}
```

### Create company

Add a customer company. Give a primary contact to make it active at once; without one it stays inactive until contacts are added.

**Inputs**

- Company name (`name`, text, required): The customer company's name.
- Street (`street`, text, required): The street address.
- City (`city`, text, required): The city.
- Postal code (`postal_code`, text, required): The postal or ZIP code.
- Country (`country`, text, required): The country of the address. One of: `AF` (Afghanistan), `AX` (Åland Islands), `AL` (Albania), `DZ` (Algeria), `AD` (Andorra), `AO` (Angola), `AI` (Anguilla), `AQ` (Antarctica), `AG` (Antigua & Barbuda), `AR` (Argentina), and 239 more.
- Phone (`phone`, text, required): The company's main phone number, such as 303-555-0100.
- Website (`website`, text, required): The company's website, such as https://acme-dental.com.
- Street, line 2 (`street2`, text): A suite, floor or unit.
- State or province (`state_or_province`, text): The state or province, such as CO.
- External ID (`external_id`, text): Your own reference for the company, such as its id in your PSA.
- Pax8 bills the company (`bill_on_behalf_of_enabled`, text): Yes if Pax8 bills the company directly on your behalf; no if you bill it. One of: `true` (Yes), `false` (No).
- Self-service (`self_service_allowed`, text): Whether the company can order for itself in Pax8. One of: `true` (Yes), `false` (No).
- Orders need approval (`order_approval_required`, text): Whether the company's own orders wait for your approval. One of: `true` (Yes), `false` (No).
- Primary contact first name (`contact_first_name`, text): To make the company active straight away, give a primary contact: their first name here, and their last name, email and phone.
- Primary contact last name (`contact_last_name`, text): Their last name.
- Primary contact email (`contact_email`, text): Their email address.
- Primary contact phone (`contact_phone`, text): Their phone number.

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "address": {
      "city": "Denver",
      "country": "US",
      "postalCode": "80210",
      "stateOrProvince": "Colorado",
      "street": "48918 Liberty Lane Ave",
      "street2": ""
    },
    "billOnBehalfOfEnabled": false,
    "externalId": "A123",
    "id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
    "name": "VFC Network, Inc",
    "orderApprovalRequired": false,
    "phone": "123-456-5555",
    "phoneCountryCallingCode": "",
    "phoneCountryCode": "",
    "phoneNumber": "",
    "selfServiceAllowed": false,
    "status": "Active",
    "updatedDate": "2023-08-11T11:33:12.314-0600",
    "website": "vfc-network-inc-liberty.com"
  }
}
```

### Create contact

Add a contact to a company, optionally as its primary admin, billing or technical contact.

**Inputs**

- Company (`company_id`, text, required): The customer company. Pick one, or give its id from an earlier step.
- First name (`first_name`, text, required): The contact's first name.
- Last name (`last_name`, text, required): The contact's last name.
- Email (`email`, text, required): The contact's email address.
- Phone (`phone`, text, required): The contact's phone number, such as 303-555-0100.
- Primary contact for (`primary_for`, list): Make this person the company's primary contact for these. A company needs one primary contact of each kind to be active. One or more of: `Admin`, `Billing`, `Technical`.

**Outputs**

- `company_id` (text): The company the contact is in
- `contact` (object): The contact

**Example output**

```json
{
  "company_id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
  "contact": {
    "createdDate": "2020-05-12",
    "email": "john.doe@vfc-network-inc-liberty.com",
    "firstName": "John",
    "id": "18d6329e-93f9-46a5-9df7-37e4c29d2840",
    "lastName": "Doe",
    "phone": "555-555-5555",
    "types": [
      {
        "primary": true,
        "type": "Admin"
      },
      {
        "primary": true,
        "type": "Billing"
      },
      {
        "primary": true,
        "type": "Technical"
      }
    ]
  }
}
```

### Delete contact

Remove a contact from a company.

**Inputs**

- Company (`company_id`, text, required): The customer company. Pick one, or give its id from an earlier step.
- Contact (`contact_id`, text, required): The contact. Pick one, or give its id from an earlier step.

**Outputs**

- `company_id` (text): The company
- `contact_id` (text): The contact deleted
- `deleted` (true/false): Always true once deleted

**Example output**

```json
{
  "company_id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
  "contact_id": "18d6329e-93f9-46a5-9df7-37e4c29d2840",
  "deleted": true
}
```

### Get company

Get one customer company with its address, phone, website, billing settings and status.

**Inputs**

- Company (`company_id`, text, required): The customer company. Pick one, or give its id from an earlier step.

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "address": {
      "city": "Denver",
      "country": "US",
      "postalCode": "80210",
      "stateOrProvince": "Colorado",
      "street": "48918 Liberty Lane Ave",
      "street2": ""
    },
    "billOnBehalfOfEnabled": false,
    "externalId": "A123",
    "id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
    "name": "VFC Network, Inc",
    "orderApprovalRequired": false,
    "phone": "123-456-5555",
    "phoneCountryCallingCode": "",
    "phoneCountryCode": "",
    "phoneNumber": "",
    "selfServiceAllowed": false,
    "status": "Active",
    "updatedDate": "2023-08-11T11:33:12.314-0600",
    "website": "vfc-network-inc-liberty.com"
  }
}
```

### Get order

Get one order with who placed it and each line item's product, quantity, term and subscription.

**Inputs**

- Order ID (`order_id`, text, required): The order's id, from 'List orders' or an earlier step.

**Outputs**

- `order` (object): The order

**Example output**

```json
{
  "order": {
    "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
    "createdDate": "2020-12-01",
    "id": "8e42de97-6bfe-4db5-864b-d2e4b18c71e2",
    "isScheduled": false,
    "lineItems": [
      {
        "billingTerm": "Monthly",
        "commitmentTermId": "",
        "id": "4915142b-1b3f-4488-9e68-e979dc661130",
        "lineItemNumber": 1,
        "parentLineItemNumber": 0,
        "parentSubscriptionId": "",
        "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
        "provisionStartDate": "2021-01-01T08:30:00Z",
        "provisioningDetails": [],
        "quantity": 5,
        "subscriptionId": "efcf8cb8-63fc-4dc4-8caa-6d6810ee8a97"
      }
    ],
    "orderedBy": "",
    "orderedByUserEmail": "",
    "orderedByUserId": ""
  }
}
```

### Get product

Get one product with its description, vendor, SKUs and whether it needs a commitment.

**Inputs**

- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.

**Outputs**

- `product` (object): The product

**Example output**

```json
{
  "product": {
    "altVendorSku": "",
    "description": "Microsoft 365 E3 is designed for large organizations.",
    "id": "e91bba5e-a9a3-483f-b036-f80165d410e3",
    "name": "Microsoft Office 365 E3",
    "requiresCommitment": false,
    "shortDescription": "Microsoft Office 365 E3 includes fully installed Office applications across multiple devices, email hosting, HD video conferencing, and features to support compliance.",
    "sku": "MST-OFC-EE3-C100",
    "vendorName": "Microsoft",
    "vendorSku": "796B6B5F-613C-4E24-A17C-EBA730D49C02"
  }
}
```

### Get product dependencies

Get the commitment terms a product can be ordered on and the products it requires.

**Inputs**

- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.

**Outputs**

- `commitment_dependencies` (list): The commitment terms
- `product_dependencies` (list): What the product requires, with the products that satisfy it
- `product_id` (text): The id it was asked about

**Example output**

```json
{
  "commitment_dependencies": [
    {
      "allowForEarlyCancellation": true,
      "allowForQuantityDecrease": true,
      "allowForQuantityIncrease": true,
      "autoRenew": true,
      "cancellationFeeApplied": true,
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "isTransferable": true,
      "renewalWindowDaysAfterTermEnd": 0,
      "renewalWindowDaysBeforeTermEnd": 0,
      "term": "3-Year"
    }
  ],
  "product_dependencies": [
    {
      "name": "Requires",
      "products": [
        {
          "altVendorSku": "",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "Acme Corps Productivity Suite",
          "requiresCommitment": false,
          "shortDescription": "Short description about the product to sell",
          "sku": "4225-776-3234",
          "vendorName": "Acme Corps",
          "vendorSku": ""
        }
      ]
    }
  ],
  "product_id": "e91bba5e-a9a3-483f-b036-f80165d410e3"
}
```

### Get product pricing

Get what a product costs you and its suggested price, for each billing term and quantity range, optionally for one company.

**Inputs**

- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.
- Company (`company_id`, text): See this company's own pricing.

**Outputs**

- `count` (number): How many entries
- `pricing` (list): One entry per billing term
- `product_id` (text): The id it was asked about

**Example output**

```json
{
  "count": 1,
  "pricing": [
    {
      "billingTerm": "Annual",
      "commitmentTerm": "1-Year",
      "commitmentTermInMonths": 12,
      "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
      "productName": "Microsoft Office 365 E3",
      "rates": [
        {
          "chargeType": "Per Unit",
          "endQuantityRange": null,
          "partnerBuyRate": 145.8,
          "startQuantityRange": 1,
          "suggestedRetailPrice": 151.8
        }
      ],
      "type": "Flat",
      "unitOfMeasurement": "Each"
    }
  ],
  "product_id": "e91bba5e-a9a3-483f-b036-f80165d410e3"
}
```

### Get product provisioning details

Get the questions an order for a product must answer, such as a Microsoft domain, with the choices each allows.

**Inputs**

- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.

**Outputs**

- `count` (number): How many questions
- `product_id` (text): The id it was asked about
- `provisioning_details` (list): Each question, by its key

**Example output**

```json
{
  "count": 1,
  "product_id": "e91bba5e-a9a3-483f-b036-f80165d410e3",
  "provisioning_details": [
    {
      "description": "Do not include the TLD when entering your domain (e.g. mydomain.onmicrosoft.com should be entered as mydomain",
      "key": "msDomain",
      "label": "Desired .onmicrosoft.com Customer Domain Prefix",
      "possibleValues": null,
      "valueType": "Input",
      "values": []
    }
  ]
}
```

### Get subscription

Get a subscription as it is now: product, quantity, price, cost, term, commitment and status.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription. Pick one, or give its id from an earlier step.

**Outputs**

- `subscription` (object): The subscription

**Example output**

```json
{
  "subscription": {
    "billingStart": "2021-01-01",
    "billingTerm": "Monthly",
    "commitmentTerm": {
      "endDate": "",
      "id": "",
      "term": ""
    },
    "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
    "createdDate": "2020-12-01T08:30:00Z",
    "currencyCode": "USD",
    "currentSubscriptionId": "",
    "endDate": "",
    "id": "05c587df-9e7d-4ef9-8218-0262198e36c9",
    "parentSubscriptionId": "",
    "partnerCost": 28.5,
    "price": 32.01,
    "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
    "productName": "Microsoft Office 365 E3",
    "provisioningDetails": [],
    "quantity": 5,
    "startDate": "2021-01-01T08:30:00Z",
    "status": "Active",
    "updatedDate": "2020-12-01T08:30:00Z",
    "usageEligible": false,
    "vendorSkuId": "",
    "vendorSubscriptionId": ""
  }
}
```

### Get subscription history

Get every change made to a subscription (quantity, term, price or product), most recent first.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription. Pick one, or give its id from an earlier step.

**Outputs**

- `count` (number): How many records
- `history` (list): One record per change, most recent first
- `subscription_id` (text): The id it was asked about

**Example output**

```json
{
  "count": 1,
  "history": [
    {
      "billingStart": "2021-01-01",
      "billingTerm": "Monthly",
      "commitmentTerm": {
        "endDate": "",
        "id": "",
        "term": ""
      },
      "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
      "createdDate": "2020-12-01T08:30:00Z",
      "currencyCode": "USD",
      "currentSubscriptionId": "",
      "endDate": "",
      "id": "05c587df-9e7d-4ef9-8218-0262198e36c9",
      "parentSubscriptionId": "",
      "partnerCost": 28.5,
      "price": 32.01,
      "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
      "productName": "Microsoft Office 365 E3",
      "provisioningDetails": [],
      "quantity": 5,
      "startDate": "2021-01-01T08:30:00Z",
      "status": "Active",
      "updatedDate": "2020-12-01T08:30:00Z",
      "usageEligible": false,
      "vendorSkuId": "",
      "vendorSubscriptionId": ""
    }
  ],
  "subscription_id": "05c587df-9e7d-4ef9-8218-0262198e36c9"
}
```

### List companies

List your customer companies, filtered by status, place or billing settings. Gets one page; run it again with the next page number for more.

**Inputs**

- Status (`status`, text): Only companies in this state. Leave empty for all. One of: `Active`, `Inactive` (Inactive (no primary contacts yet)), `Deleted`.
- City (`city`, text): Only companies in this city.
- Country (`country`, text): Only companies in this country. One of: `AF` (Afghanistan), `AX` (Åland Islands), `AL` (Albania), `DZ` (Algeria), `AD` (Andorra), `AO` (Angola), `AI` (Anguilla), `AQ` (Antarctica), `AG` (Antigua & Barbuda), `AR` (Argentina), and 239 more.
- State or province (`state_or_province`, text): Only companies in this state.
- Postal code (`postal_code`, text): Only companies with this postal code.
- Pax8 bills the company (`bill_on_behalf_of_enabled`, text): Only companies Pax8 bills for you (yes) or that you bill (no). One of: `true` (Yes), `false` (No).
- Self-service (`self_service_allowed`, text): Only companies that can (yes) or can't (no) order for themselves. One of: `true` (Yes), `false` (No).
- Orders need approval (`order_approval_required`, text): Only companies whose orders do (yes) or don't (no) wait for approval. One of: `true` (Yes), `false` (No).
- Order (`sort`, text): How to sort the companies. One of: `name,asc` (Name, A to Z), `name,desc` (Name, Z to A), `city,asc` (City, A to Z), `country,asc` (Country, A to Z), `stateOrProvince,asc` (State or province, A to Z), `postalCode,asc` (Postal code, lowest first).
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `companies` (list): The companies
- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number, starting at 1
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "companies": [
    {
      "address": {
        "city": "Denver",
        "country": "US",
        "postalCode": "80210",
        "stateOrProvince": "Colorado",
        "street": "48918 Liberty Lane Ave",
        "street2": ""
      },
      "billOnBehalfOfEnabled": false,
      "externalId": "A123",
      "id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
      "name": "VFC Network, Inc",
      "orderApprovalRequired": false,
      "phone": "123-456-5555",
      "phoneCountryCallingCode": "",
      "phoneCountryCode": "",
      "phoneNumber": "",
      "selfServiceAllowed": false,
      "status": "Active",
      "updatedDate": "2023-08-11T11:33:12.314-0600",
      "website": "vfc-network-inc-liberty.com"
    }
  ],
  "count": 1,
  "has_more": false,
  "page": 1,
  "total_count": 1,
  "total_pages": 1
}
```

### List contacts

List a company's contacts, newest first, with the kinds they are primary contact for.

**Inputs**

- Company (`company_id`, text, required): The customer company. Pick one, or give its id from an earlier step.
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `company_id` (text): The company
- `contacts` (list): The contacts
- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number, starting at 1
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "company_id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
  "contacts": [
    {
      "createdDate": "2020-05-12",
      "email": "john.doe@vfc-network-inc-liberty.com",
      "firstName": "John",
      "id": "18d6329e-93f9-46a5-9df7-37e4c29d2840",
      "lastName": "Doe",
      "phone": "555-555-5555",
      "types": [
        {
          "primary": true,
          "type": "Admin"
        },
        {
          "primary": true,
          "type": "Billing"
        },
        {
          "primary": true,
          "type": "Technical"
        }
      ]
    }
  ],
  "count": 1,
  "has_more": false,
  "page": 1,
  "total_count": 1,
  "total_pages": 1
}
```

### List invoice items

List the line items of an invoice: each company, product, quantity, period, price and cost.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice. Pick one, or give its id from an earlier step.
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `invoice_id` (text): The invoice
- `items` (list): The line items
- `page` (number): This page's number, starting at 1
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "invoice_id": "17029935-36b0-4f0f-9d5e-c8af04f7b57a",
  "items": [
    {
      "amountDue": 27500,
      "billedByPax8": false,
      "billingFee": 0,
      "billingFeeRate": 0,
      "chargeType": "per",
      "companyId": "cc0ac255-7c0b-4123-ac8d-a6c280b85eae",
      "companyName": "Brick and Mortar Tech",
      "cost": 2500,
      "costTotal": 27500,
      "currencyCode": "USD",
      "description": "Microsoft Office E3",
      "details": "",
      "endPeriod": "2019-05-01",
      "externalId": "",
      "id": "6b0e2f5a-5c4c-4f0e-9f52-3d1f7f0a8b11",
      "offeredBy": "Pax8",
      "price": 50000,
      "productId": "de4ff8a5-e836-4412-89e7-03236c0641c4",
      "productName": "Microsoft Office E3",
      "purchaseOrderNumber": "N/A",
      "quantity": 11,
      "rateType": "single",
      "salesTax": 2200,
      "sku": "PAX-233-ukw0-9092",
      "startPeriod": "2019-04-01",
      "subTotal": 27500,
      "subscriptionId": "f6b60139-8ab6-45f4-b808-354ebbe53070",
      "term": "Monthly",
      "total": 550000,
      "type": "subscription",
      "unitOfMeasure": "User",
      "vendorName": "Microsoft"
    }
  ],
  "page": 1,
  "total_count": 1,
  "total_pages": 1
}
```

### List invoices

List Pax8's invoices to you with their totals, balances and status, filtered by status, date or company. Gets one page; run it again with the next page number for more.

**Inputs**

- Status (`status`, text): Only invoices in this state. One of: `Unpaid`, `Paid`, `Void`, `Carried`, `Nothing Due`, `Credited`.
- Invoiced on or after (`invoice_date_from`, date): Only invoices dated on or after this day.
- Invoiced on or before (`invoice_date_to`, date): Only invoices dated on or before this day.
- Due on (`due_date`, date): Only invoices due on this day.
- Company (`company_id`, text): Only invoices for this company.
- Order (`sort`, text): How to sort the invoices. One of: `invoiceDate,desc` (Invoice date, newest first), `invoiceDate,asc` (Invoice date, oldest first), `dueDate,desc` (Due date, latest first), `dueDate,asc` (Due date, earliest first), `total,desc` (Total, highest first), `balance,desc` (Balance, highest first), `status,asc` (Status).
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `invoices` (list): The invoices
- `page` (number): This page's number, starting at 1
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "invoices": [
    {
      "balance": 560470.66,
      "carriedBalance": 17204372.33,
      "companyId": "",
      "currencyCode": "USD",
      "dueDate": "2020-09-15",
      "externalId": "",
      "id": "17029935-36b0-4f0f-9d5e-c8af04f7b57a",
      "invoiceDate": "2020-09-01",
      "invoiceNumber": "2020-1-101204",
      "partnerName": "My Partner Name",
      "status": "Paid",
      "total": 17432960
    }
  ],
  "page": 1,
  "total_count": 1,
  "total_pages": 1
}
```

### List orders

List orders, for every company or one. Gets one page; run it again with the next page number for more.

**Inputs**

- Company (`company_id`, text): Only this company's orders.
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `orders` (list): The orders
- `page` (number): This page's number, starting at 1
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "orders": [
    {
      "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
      "createdDate": "2020-12-01",
      "id": "8e42de97-6bfe-4db5-864b-d2e4b18c71e2",
      "isScheduled": false,
      "lineItems": [
        {
          "billingTerm": "Monthly",
          "commitmentTermId": "",
          "id": "4915142b-1b3f-4488-9e68-e979dc661130",
          "lineItemNumber": 1,
          "parentLineItemNumber": 0,
          "parentSubscriptionId": "",
          "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
          "provisionStartDate": "2021-01-01T08:30:00Z",
          "provisioningDetails": [],
          "quantity": 5,
          "subscriptionId": "efcf8cb8-63fc-4dc4-8caa-6d6810ee8a97"
        }
      ],
      "orderedBy": "",
      "orderedByUserEmail": "",
      "orderedByUserId": ""
    }
  ],
  "page": 1,
  "total_count": 1,
  "total_pages": 1
}
```

### List products

Search the products you can sell in Pax8's catalogue by name, SKU or vendor. Gets one page; run it again with the next page number for more.

**Inputs**

- Search (`search`, text): Words in the product's name or SKU.
- Vendor (`vendor_name`, text): Only products from this vendor, such as Microsoft.
- Order (`sort`, text): How to sort the products. One of: `name,asc` (Name, A to Z), `name,desc` (Name, Z to A), `vendor,asc` (Vendor, A to Z), `vendor,desc` (Vendor, Z to A).
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number, starting at 1
- `products` (list): The products
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "page": 1,
  "products": [
    {
      "altVendorSku": "",
      "id": "e91bba5e-a9a3-483f-b036-f80165d410e3",
      "name": "Microsoft Office 365 E3",
      "requiresCommitment": false,
      "shortDescription": "Microsoft Office 365 E3 includes fully installed Office applications across multiple devices, email hosting, HD video conferencing, and features to support compliance.",
      "sku": "MST-OFC-EE3-C100",
      "vendorName": "Microsoft",
      "vendorSku": "796B6B5F-613C-4E24-A17C-EBA730D49C02"
    }
  ],
  "total_count": 1,
  "total_pages": 1
}
```

### List subscriptions

List subscriptions with their product, quantity, price and status, filtered by company, product, status or term. Gets one page; run it again with the next page number for more.

**Inputs**

- Company (`company_id`, text): Only this company's subscriptions.
- Product (`product_id`, text): Only subscriptions to this product.
- Status (`status`, text): Only subscriptions in this state. One of: `Active`, `Cancelled`, `PendingManual` (Pending (manual provisioning)), `PendingAutomated` (Pending (automated provisioning)), `PendingCancel` (Pending cancellation), `WaitingForDetails` (Waiting for details), `Trial`, `Converted`, `PendingActivation` (Pending activation), `Activated`.
- Billing term (`billing_term`, text): Only subscriptions billed on this term. One of: `Monthly`, `Annual`, `2-Year` (2 years), `3-Year` (3 years), `One-Time` (One time), `Trial`, `Activation`.
- Order (`sort`, text): How to sort the subscriptions. One of: `createdDate,desc` (Newest first), `createdDate,asc` (Oldest first), `quantity,desc` (Quantity, highest first), `quantity,asc` (Quantity, lowest first), `price,desc` (Price, highest first), `price,asc` (Price, lowest first), `startDate,desc` (Start date, latest first), `startDate,asc` (Start date, earliest first), `endDate,desc` (End date, latest first), `endDate,asc` (End date, earliest first), `billingStart,desc` (Billing start, latest first), `billingStart,asc` (Billing start, earliest first).
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number, starting at 1
- `subscriptions` (list): The subscriptions
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "page": 1,
  "subscriptions": [
    {
      "billingStart": "2021-01-01",
      "billingTerm": "Monthly",
      "commitmentTerm": {
        "endDate": "",
        "id": "",
        "term": ""
      },
      "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
      "createdDate": "2020-12-01T08:30:00Z",
      "currencyCode": "USD",
      "currentSubscriptionId": "",
      "endDate": "",
      "id": "05c587df-9e7d-4ef9-8218-0262198e36c9",
      "parentSubscriptionId": "",
      "partnerCost": 28.5,
      "price": 32.01,
      "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
      "productName": "Microsoft Office 365 E3",
      "provisioningDetails": [],
      "quantity": 5,
      "startDate": "2021-01-01T08:30:00Z",
      "status": "Active",
      "updatedDate": "2020-12-01T08:30:00Z",
      "usageEligible": false,
      "vendorSkuId": "",
      "vendorSubscriptionId": ""
    }
  ],
  "total_count": 1,
  "total_pages": 1
}
```

### List usage lines

List the usage recorded on one day under a usage summary: each product, quantity, charge and profit.

**Inputs**

- Usage summary ID (`usage_summary_id`, text, required): The usage summary's id, from 'List usage summaries' or an earlier step.
- Day (`usage_date`, date, required): The day to get usage for. Run it once per day.
- Product (`product_id`, text): Only usage of this product.
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number, starting at 1
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are
- `usage_date` (text): The day (YYYY-MM-DD)
- `usage_lines` (list): The usage lines
- `usage_summary_id` (text): The usage summary

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "page": 1,
  "total_count": 1,
  "total_pages": 1,
  "usage_date": "2020-01-14",
  "usage_lines": [
    {
      "currencyCode": "USD",
      "currentCharges": 15.99,
      "currentProfit": 5.61,
      "isTrial": false,
      "partnerTotal": 10.38,
      "productId": "61bf3a55-f1da-4efd-88eb-bf362b0ad51e",
      "productName": "Proofpoint Essentials - Professional",
      "quantity": 3,
      "unitOfMeasure": "User",
      "unitPrice": 5.33,
      "usageDate": "2020-01-14",
      "usageSummaryId": "52d8d4bc-59db-48fe-9aa7-95bed562ff95"
    }
  ],
  "usage_summary_id": "52d8d4bc-59db-48fe-9aa7-95bed562ff95"
}
```

### List usage summaries

List this month's usage charges for a usage-billed subscription, such as Azure, one summary per resource group.

**Inputs**

- Subscription (`subscription_id`, text, required): The usage-billed subscription.
- Company (`company_id`, text): Only this company's usage.
- Resource group (`resource_group`, text): Only this resource group, such as Company 1.
- Page (`page`, number): Which page to get, starting at 1. Defaults to the first. At least 1.
- Page size (`page_size`, number): How many to get on each page, 1 to 200. Defaults to 50. From 1 to 200.

**Outputs**

- `count` (number): How many are on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number, starting at 1
- `subscription_id` (text): The subscription
- `total_count` (number): How many there are in all, across every page
- `total_pages` (number): How many pages there are
- `usage_summaries` (list): The usage summaries

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "page": 1,
  "subscription_id": "8d04ad8c-456a-4b1d-9abe-a42ae526f683",
  "total_count": 1,
  "total_pages": 1,
  "usage_summaries": [
    {
      "companyId": "ede334e7-d1c7-4e0a-822d-dee891f6ce9a",
      "currencyCode": "USD",
      "currentCharges": 100.56,
      "id": "52d8d4bc-59db-48fe-9aa7-95bed562ff95",
      "isTrial": false,
      "partnerTotal": 86.456,
      "productId": "b3bb9455-c454-4efa-9be8-15b86caf6933",
      "resourceGroup": "Company 1",
      "subscriptionId": "8d04ad8c-456a-4b1d-9abe-a42ae526f683",
      "vendorName": "Microsoft"
    }
  ]
}
```

### Place order

Buy a product for a company. This is a real purchase billed to your Pax8 account; turn on 'Check only' to have Pax8 check it without placing it.

**Inputs**

- Company (`company_id`, text, required): The customer company the order is for.
- Product (`product_id`, text, required): The product to buy.
- Quantity (`quantity`, number, required): How many licences or units to buy. From 1 to 100000.
- Billing term (`billing_term`, text, required): How often the company is billed. 'Get product pricing' lists the terms a product offers. One of: `Monthly`, `Annual`, `2-Year` (2 years), `3-Year` (3 years), `One-Time` (One time), `Trial`, `Activation`.
- Commitment term (`commitment_term_id`, text): Needed when the product requires a commitment. Pick one of the product's terms.
- Start (`provision_start_date`, date and time): When to provision it. Leave empty to start now.
- Provisioning details (`provisioning_details`, object): Answers the product needs, keyed as 'Get product provisioning details' lists them, for example {"msDomain": "acmedental"}.
- Parent subscription (`parent_subscription_id`, text): For an add-on: the company's subscription it depends on, as 'Get product dependencies' requires.
- Check only (`validate_only`, true/false): Have Pax8 check the order without placing it, so nothing is bought. Default: `false`.

**Outputs**

- `order` (object): The order, with the subscription it created
- `validated_only` (true/false): True when Pax8 only checked the order

**Example output**

```json
{
  "order": {
    "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
    "createdDate": "2020-12-01",
    "id": "8e42de97-6bfe-4db5-864b-d2e4b18c71e2",
    "isScheduled": false,
    "lineItems": [
      {
        "billingTerm": "Monthly",
        "commitmentTermId": "",
        "id": "4915142b-1b3f-4488-9e68-e979dc661130",
        "lineItemNumber": 1,
        "parentLineItemNumber": 0,
        "parentSubscriptionId": "",
        "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
        "provisionStartDate": "2021-01-01T08:30:00Z",
        "provisioningDetails": [],
        "quantity": 5,
        "subscriptionId": "efcf8cb8-63fc-4dc4-8caa-6d6810ee8a97"
      }
    ],
    "orderedBy": "",
    "orderedByUserEmail": "",
    "orderedByUserId": ""
  },
  "validated_only": false
}
```

### Update company

Change a company's name, address, phone, website, reference or billing settings. Fields left empty keep their value.

**Inputs**

- Company (`company_id`, text, required): The customer company. Pick one, or give its id from an earlier step.
- Company name (`name`, text): A new name. Leave empty to keep it.
- Street (`street`, text): A new street address. Leave empty to keep it.
- Street, line 2 (`street2`, text): A new second line. Leave empty to keep it.
- City (`city`, text): A new city. Leave empty to keep it.
- State or province (`state_or_province`, text): A new state or province. Leave empty to keep it.
- Postal code (`postal_code`, text): A new postal code. Leave empty to keep it.
- Country (`country`, text): A new country. Leave empty to keep it. One of: `AF` (Afghanistan), `AX` (Åland Islands), `AL` (Albania), `DZ` (Algeria), `AD` (Andorra), `AO` (Angola), `AI` (Anguilla), `AQ` (Antarctica), `AG` (Antigua & Barbuda), `AR` (Argentina), and 239 more.
- Phone (`phone`, text): A new main phone number. Leave empty to keep it.
- Website (`website`, text): A new website. Leave empty to keep it.
- External ID (`external_id`, text): A new reference of your own. Leave empty to keep it.
- Pax8 bills the company (`bill_on_behalf_of_enabled`, text): Yes if Pax8 bills the company directly on your behalf; no if you bill it. One of: `true` (Yes), `false` (No).
- Self-service (`self_service_allowed`, text): Whether the company can order for itself in Pax8. One of: `true` (Yes), `false` (No).
- Orders need approval (`order_approval_required`, text): Whether the company's own orders wait for your approval. One of: `true` (Yes), `false` (No).

**Outputs**

- `company` (object): The company

**Example output**

```json
{
  "company": {
    "address": {
      "city": "Denver",
      "country": "US",
      "postalCode": "80210",
      "stateOrProvince": "Colorado",
      "street": "48918 Liberty Lane Ave",
      "street2": ""
    },
    "billOnBehalfOfEnabled": false,
    "externalId": "A123",
    "id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
    "name": "VFC Network, Inc",
    "orderApprovalRequired": false,
    "phone": "123-456-5555",
    "phoneCountryCallingCode": "",
    "phoneCountryCode": "",
    "phoneNumber": "",
    "selfServiceAllowed": false,
    "status": "Active",
    "updatedDate": "2023-08-11T11:33:12.314-0600",
    "website": "vfc-network-inc-liberty.com"
  }
}
```

### Update contact

Change a contact's name, email, phone or what they are primary contact for. Fields left empty keep their value.

**Inputs**

- Company (`company_id`, text, required): The customer company. Pick one, or give its id from an earlier step.
- Contact (`contact_id`, text, required): The contact. Pick one, or give its id from an earlier step.
- First name (`first_name`, text): A new first name. Leave empty to keep it.
- Last name (`last_name`, text): A new last name. Leave empty to keep it.
- Email (`email`, text): A new email address. Leave empty to keep it.
- Phone (`phone`, text): A new phone number. Leave empty to keep it.
- Primary contact for (`primary_for`, list): Make this person the primary contact for exactly these, replacing what they were. Leave empty to keep it. One or more of: `Admin`, `Billing`, `Technical`.

**Outputs**

- `company_id` (text): The company the contact is in
- `contact` (object): The contact

**Example output**

```json
{
  "company_id": "a4dfc6bf-f02e-4a79-9844-66ba6c02ec3a",
  "contact": {
    "createdDate": "2020-05-12",
    "email": "john.doe@vfc-network-inc-liberty.com",
    "firstName": "John",
    "id": "18d6329e-93f9-46a5-9df7-37e4c29d2840",
    "lastName": "Doe",
    "phone": "555-555-5555",
    "types": [
      {
        "primary": true,
        "type": "Admin"
      },
      {
        "primary": true,
        "type": "Billing"
      },
      {
        "primary": true,
        "type": "Technical"
      }
    ]
  }
}
```

### Update subscription

Change a subscription's quantity, price, billing term or start. Adding licences is billed to your Pax8 account.

**Inputs**

- Subscription (`subscription_id`, text, required): The subscription. Pick one, or give its id from an earlier step.
- Quantity (`quantity`, number): The new number of licences. More are billed to you at once; fewer only if the commitment allows it. From 0 to 100000.
- Price (`price`, number): The new price you charge the company per unit, such as 15.39. At least 0.
- Billing term (`billing_term`, text): A new billing term. Leave empty to keep it. One of: `Monthly`, `Annual`, `2-Year` (2 years), `3-Year` (3 years), `One-Time` (One time), `Trial`, `Activation`.
- Start (`start_date`, date and time): A new start date and time. Leave empty to keep it.

**Outputs**

- `subscription` (object): The subscription

**Example output**

```json
{
  "subscription": {
    "billingStart": "2021-01-01",
    "billingTerm": "Monthly",
    "commitmentTerm": {
      "endDate": "",
      "id": "",
      "term": ""
    },
    "companyId": "fe7a2d5f-4a14-43ff-940e-a65cda66474a",
    "createdDate": "2020-12-01T08:30:00Z",
    "currencyCode": "USD",
    "currentSubscriptionId": "",
    "endDate": "",
    "id": "05c587df-9e7d-4ef9-8218-0262198e36c9",
    "parentSubscriptionId": "",
    "partnerCost": 28.5,
    "price": 32.01,
    "productId": "e91bba5e-a9a3-483f-b036-f80165d410e3",
    "productName": "Microsoft Office 365 E3",
    "provisioningDetails": [],
    "quantity": 6,
    "startDate": "2021-01-01T08:30:00Z",
    "status": "Active",
    "updatedDate": "2020-12-01T08:30:00Z",
    "usageEligible": false,
    "vendorSkuId": "",
    "vendorSubscriptionId": ""
  }
}
```
