# Flex

> Manage your Flex customer and product records and look up HSA and FSA payments.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/flex

## Actions

### Get a checkout session

Read details for one Flex checkout session.

**Inputs**

- Expand customer (`expand_customer`, true/false): If true, expands the customer object in the response.
- Expand payment intent (`expand_payment_intent`, true/false): If true, expands the payment intent object in the response.
- Expand subscription (`expand_subscription`, true/false): If true, expands the subscription object in the response.
- Expand (`expand`, text): Comma-separated list of related objects to expand in the response.
- Checkout session ID (`checkout_session_id`, text, required): Checkout session id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "checkout_session": {
      "allow_promotion_codes": true,
      "amount_disputed": 1,
      "amount_received": 1,
      "amount_refunded": 1,
      "amount_subtotal": 1,
      "amount_total": 1,
      "cancel_url": "example",
      "capture_method": "automatic",
      "captures": [
        {}
      ],
      "checkout_session_id": "example",
      "client_reference_id": "example",
      "created_at": 1,
      "custom_text": {},
      "customer": {},
      "defaults": {},
      "disputes": [
        {}
      ],
      "expires_at": 1,
      "fees": [
        {}
      ],
      "hsa_fsa_eligible": true,
      "invoice": "example",
      "letter_of_medical_necessity_required": true,
      "metadata": {},
      "mode": "payment",
      "next_action": {},
      "origin": {},
      "partner": {},
      "payment_intent": {},
      "payment_intents": [
        {}
      ],
      "payment_method_options": {},
      "platform_fees": {},
      "redirect_url": "example",
      "refunds": [
        {}
      ],
      "renewal_as_of": 1,
      "selling_plans": [
        {}
      ],
      "setup_future_use": "on_session",
      "setup_intent": "example",
      "shipping_address_collection": true,
      "shipping_details": {},
      "shipping_options": {},
      "shopify_payment_details": {},
      "split_cart": {},
      "status": "open",
      "subscription": {},
      "subscription_data": {},
      "success_url": "example",
      "tax_calculation_mode": {},
      "tax_rate": {},
      "test_mode": true,
      "total_details": {},
      "visit_type": {}
    }
  }
}
```

### Get a coupon

Read details for one Flex coupon.

**Inputs**

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

**Outputs**

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

**Example output**

```json
{
  "data": {
    "coupon": {
      "amount_off": 1,
      "applies_to": {},
      "coupon_id": "example",
      "created_at": "example",
      "duration": "once",
      "duration_in_months": 1,
      "max_redemptions": 1,
      "metadata": {},
      "name": "example",
      "percent_off": 1,
      "test_mode": true,
      "times_redeemed": 1,
      "valid": true
    }
  }
}
```

### Get a customer

Read details for one Flex customer.

**Inputs**

- Customer ID (`customer_id`, text, required): Customer id.
- Include org (`include_org`, true/false): Include org.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "customer": {
      "created_at": "example",
      "customer_id": "example",
      "email": "example",
      "employer": "example",
      "first_name": "example",
      "last_name": "example",
      "metadata": {},
      "owner_partner_id": "example",
      "phone": "example",
      "shipping": {},
      "test_mode": true
    }
  }
}
```

### Get a dispute

Read details for one Flex dispute.

**Inputs**

- Dispute ID (`dispute_id`, text, required): Dispute id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "dispute": {
      "amount": 1,
      "balance_transactions": [
        {}
      ],
      "charge_id": "example",
      "checkout_session_id": "example",
      "client_reference_id": "example",
      "created_at": "example",
      "currency": "example",
      "dispute_id": "example",
      "evidence": {},
      "evidence_details": {},
      "is_charge_refundable": true,
      "metadata": {},
      "payment_intent_id": "example",
      "payment_method_details": {},
      "reason": "bank_cannot_process",
      "status": {},
      "test_mode": true
    }
  }
}
```

### Get a payment intent

Read details for one Flex payment intent.

**Inputs**

- Expand (`expand`, text): Comma-separated list of related objects to expand in the response.
- Expand customer (`expand_customer`, true/false): If true, expands the customer object in the response.
- Payment intent ID (`payment_intent_id`, text, required): Payment intent id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "payment_intent": {
      "amount": 1,
      "amount_capturable": 1,
      "amount_received": 1,
      "application_fee_amount": 1,
      "capture_method": "automatic",
      "client_secret": "example",
      "created_at": "example",
      "customer": {},
      "invoice": {},
      "last_payment_error": {},
      "latest_charge": {},
      "letter_fee_amount": 1,
      "metadata": {},
      "payment_card_type": {},
      "payment_intent_id": "example",
      "payment_method": {},
      "status": "canceled",
      "test_mode": true,
      "transaction_fee": 1,
      "transfer_data": {},
      "transfer_group": "example"
    }
  }
}
```

### Get a price

Read details for one Flex price.

**Inputs**

- Expand product (`expand_product`, true/false): If true, expands the product object in the response.
- Price ID (`price_id`, text, required): Price id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "price": {
      "active": true,
      "created_at": "example",
      "description": "example",
      "hsa_fsa_eligibility": {},
      "lookup_key": "example",
      "metadata": {},
      "owner_partner_id": "example",
      "price_id": "example",
      "product": {},
      "recurring": {},
      "test_mode": true,
      "trial_period_days": 1,
      "type": "one_time",
      "unit_amount": 1
    }
  }
}
```

### Get a product

Read details for one Flex product.

**Inputs**

- Product ID (`product_id`, text, required): Product id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "product": {
      "active": true,
      "client_reference_id": "example",
      "created_at": "example",
      "description": "example",
      "document_description": "example",
      "gtin": "example",
      "hsa_fsa_eligibility": "not_eligible",
      "metadata": {},
      "name": "example",
      "owner_partner_id": "example",
      "product_id": "example",
      "receipt_description": "example",
      "reference_gtin": "example",
      "test_mode": true,
      "upc_code": "example",
      "url": "example",
      "visit_type": {}
    }
  }
}
```

### Get a refund

Read details for one Flex refund.

**Inputs**

- Refund ID (`refund_id`, text, required): Refund id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "refund": {
      "amount": 1,
      "balance_transaction": {},
      "created_at": "example",
      "failure_balance_transaction": {},
      "invoice_id": "example",
      "items": [
        {}
      ],
      "metadata": {},
      "payment_intent_id": "example",
      "reason": {},
      "reference_id": "example",
      "reference_status": {},
      "reference_type": {},
      "refund_id": "example",
      "status": "pending",
      "subscription_id": "example",
      "test_mode": true
    }
  }
}
```

### Get a shipping rate

Read details for one Flex shipping rate.

**Inputs**

- Shipping rate ID (`shipping_rate_id`, text, required): Shipping rate id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "shipping_rate": {
      "active": true,
      "amount": 1,
      "created_at": "example",
      "display_name": "example",
      "metadata": {},
      "shipping_rate_id": "example"
    }
  }
}
```

### Get a subscription

Read details for one Flex subscription.

**Inputs**

- Expand customer (`expand_customer`, true/false): If true, expands the customer object in the response.
- Expand (`expand`, text): Comma-separated list of related objects to expand in the response.
- Subscription ID (`subscription_id`, text, required): Subscription id.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "subscription": {
      "backup_payment_method": {},
      "cancel_at": {},
      "cancel_at_period_end": true,
      "canceled_at": {},
      "client_secret": {},
      "created_at": "example",
      "current_period_end": {},
      "current_period_start": {},
      "customer": {},
      "default_payment_method": {},
      "discounts": [
        {}
      ],
      "items": [
        {}
      ],
      "latest_invoice": {},
      "metadata": {},
      "pause": {},
      "proration_behavior": {},
      "status": "incomplete",
      "subscription_id": "example",
      "test_mode": true,
      "trial_end": {},
      "trial_start": {}
    }
  }
}
```

### List checkout sessions

Browse checkout sessions in your Flex account.

**Inputs**

- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From 1.0 to 9007199254740991.0.
- Interval (`interval`, number): Filter by time interval in days (e.g., 30 for last 30 days). From -2147483648.0 to 2147483647.0.
- Payment intent ID (`payment_intent_id`, text): Filter by payment intent ID.
- Status (`status`, text): Filter by checkout session status. One of: `open`, `paid`, `complete`, `canceled`, `expired`.
- Customer ID (`customer_id`, text): Filter by customer ID.
- Email (`email`, text): Filter results by customer email address.
- Subscription ID (`subscription_id`, text): Filter by subscription ID.
- Client reference ID (`client_reference_id`, text): Filter by the client reference ID you provided when creating the checkout session.
- Expand customer (`expand_customer`, true/false): If true, expands the customer object in the response.
- Expand payment intent (`expand_payment_intent`, true/false): If true, expands the payment intent object in the response.
- Expand (`expand`, text): Comma-separated list of related objects to expand in the response.
- Created at or after (`created_at_or_after`, date and time): Return sessions created at or after this timestamp (inclusive). ISO 8601 format.
- Created at or before (`created_at_or_before`, date and time): Return sessions created at or before this timestamp (inclusive). ISO 8601 format.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Has disputes (`has_disputes`, true/false): Return only checkout sessions with any associated dispute.
- Mode (`mode`, text): Filter by checkout session mode. One of: `payment`, `subscription`, `off_session` (Off session), `setup`, `reimbursement`.
- Selling plan (`selling_plan`, text): Filter by the Shopify selling plan the originating order was placed under, e.g. `gid://shopify/SellingPlan/123`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "checkout_sessions": [
      {
        "allow_promotion_codes": true,
        "amount_disputed": 1,
        "amount_received": 1,
        "amount_refunded": 1,
        "amount_subtotal": 1,
        "amount_total": 1,
        "cancel_url": "example",
        "capture_method": {},
        "captures": [
          {}
        ],
        "checkout_session_id": "example",
        "client_reference_id": "example",
        "created_at": 1,
        "custom_text": {},
        "customer": {},
        "defaults": {},
        "disputes": [
          {}
        ],
        "expires_at": 1,
        "fees": [
          {}
        ],
        "hsa_fsa_eligible": true,
        "invoice": "example",
        "letter_of_medical_necessity_required": true,
        "metadata": {},
        "mode": {},
        "next_action": {},
        "origin": {},
        "partner": {},
        "payment_intent": {},
        "payment_intents": [
          {}
        ],
        "payment_method_options": {},
        "platform_fees": {},
        "redirect_url": "example",
        "refunds": [
          {}
        ],
        "renewal_as_of": 1,
        "selling_plans": [
          {}
        ],
        "setup_future_use": {},
        "setup_intent": "example",
        "shipping_address_collection": true,
        "shipping_details": {},
        "shipping_options": {},
        "shopify_payment_details": {},
        "split_cart": {},
        "status": {},
        "subscription": {},
        "subscription_data": {},
        "success_url": "example",
        "tax_calculation_mode": {},
        "tax_rate": {},
        "test_mode": true,
        "total_details": {},
        "visit_type": {}
      }
    ]
  }
}
```

### List coupons

Browse coupons in your Flex account.

**Inputs**

- Name (`name`, text): Filter coupons by name.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "coupons": [
      {
        "amount_off": 1,
        "applies_to": {},
        "coupon_id": "example",
        "created_at": {},
        "duration": {},
        "duration_in_months": 1,
        "max_redemptions": 1,
        "metadata": {},
        "name": "example",
        "percent_off": 1,
        "test_mode": true,
        "times_redeemed": 1,
        "valid": true
      }
    ]
  }
}
```

### List customers

Browse customers in your Flex account.

**Inputs**

- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From 1.0 to 100.0.
- Email (`email`, text): Filter results by customer email address.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "customers": [
      {
        "created_at": {},
        "customer_id": "example",
        "email": "example",
        "employer": "example",
        "first_name": "example",
        "last_name": "example",
        "metadata": {},
        "owner_partner_id": "example",
        "phone": "example",
        "shipping": {},
        "test_mode": true
      }
    ]
  }
}
```

### List disputes

Browse disputes in your Flex account.

**Inputs**

- Limit (`limit`, number): Maximum number of disputes to return (default 20, max 100). From -9007199254740991.0 to 9007199254740991.0.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Charge (`charge`, text): Filter by charge ID.
- Payment intent ID (`payment_intent_id`, text): Filter by payment intent ID.
- Statuses (`statuses`, list): Filter by dispute statuses (comma-separated, e.g. `?statuses=needs_response,under_review`).
- Expand (`expand`, text): Comma-separated list of fields to expand (e.g., `?expand=evidence`).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "disputes": [
      {
        "amount": 1,
        "balance_transactions": [
          {}
        ],
        "charge_id": "example",
        "checkout_session_id": "example",
        "client_reference_id": "example",
        "created_at": {},
        "currency": "example",
        "dispute_id": "example",
        "evidence": {},
        "evidence_details": {},
        "is_charge_refundable": true,
        "metadata": {},
        "payment_intent_id": "example",
        "payment_method_details": {},
        "reason": {},
        "status": {},
        "test_mode": true
      }
    ]
  }
}
```

### List payment intents

Browse payment intents in your Flex account.

**Inputs**

- Expand (`expand`, text): Comma-separated list of related objects to expand in the response.
- Expand customer (`expand_customer`, true/false): If true, expands the customer object in the response.
- Customer ID (`customer_id`, text): Filter by customer ID.
- Checkout session ID (`checkout_session_id`, text): Filter by checkout session ID.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From -2147483648.0 to 2147483647.0.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "payment_intents": [
      {
        "amount": 1,
        "amount_capturable": 1,
        "amount_received": 1,
        "application_fee_amount": 1,
        "capture_method": {},
        "client_secret": "example",
        "created_at": {},
        "customer": {},
        "invoice": {},
        "last_payment_error": {},
        "latest_charge": {},
        "letter_fee_amount": 1,
        "metadata": {},
        "payment_card_type": {},
        "payment_intent_id": "example",
        "payment_method": {},
        "status": {},
        "test_mode": true,
        "transaction_fee": 1,
        "transfer_data": {},
        "transfer_group": "example"
      }
    ]
  }
}
```

### List prices

Browse prices in your Flex account.

**Inputs**

- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From -2147483648.0 to 2147483647.0.
- Active (`active`, true/false): Only return prices where `active` matches this value.
- Product ID (`product_id`, text): Filter by product ID to return prices for a specific product.
- Expand product (`expand_product`, true/false): If true, expands the product object in the response.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Lookup keys (`lookup_keys`, list): Lookup keys.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "prices": [
      {
        "active": true,
        "created_at": {},
        "description": "example",
        "hsa_fsa_eligibility": {},
        "lookup_key": "example",
        "metadata": {},
        "owner_partner_id": "example",
        "price_id": "example",
        "product": {},
        "recurring": {},
        "test_mode": true,
        "trial_period_days": 1,
        "type": {},
        "unit_amount": 1
      }
    ]
  }
}
```

### List products

Browse products in your Flex account.

**Inputs**

- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From 1.0 to 2147483647.0.
- Starting after (`starting_after`, text): A cursor for use in pagination. `starting_after` is a product ID that defines your place in the list.
- Ending before (`ending_before`, text): A cursor for use in pagination. `ending_before` is a product ID that defines your place in the list.
- Active (`active`, true/false): Only return products where `active` matches this value.
- Client reference ID (`client_reference_id`, text): Filter products by their client-provided product identifier.
- Category (`category`, text): Only return products carrying this category. Matching is case-insensitive.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "products": [
      {
        "active": true,
        "client_reference_id": "example",
        "created_at": {},
        "description": "example",
        "document_description": "example",
        "gtin": "example",
        "hsa_fsa_eligibility": {},
        "metadata": {},
        "name": "example",
        "owner_partner_id": "example",
        "product_id": "example",
        "receipt_description": "example",
        "reference_gtin": "example",
        "test_mode": true,
        "upc_code": "example",
        "url": "example",
        "visit_type": {}
      }
    ]
  }
}
```

### List refunds

Browse refunds in your Flex account.

**Inputs**

- Status (`status`, text): Filter by refund status. One of: `pending`, `requires_action` (Requires action), `succeeded`, `failed`, `canceled`.
- Payment intent ID (`payment_intent_id`, text): Filter by payment intent ID.
- Checkout session ID (`checkout_session_id`, text): Filter by checkout session ID.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. From 1.0 to 100.0.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "refunds": [
      {
        "amount": 1,
        "balance_transaction": {},
        "created_at": {},
        "failure_balance_transaction": {},
        "invoice_id": "example",
        "items": [
          {}
        ],
        "metadata": {},
        "payment_intent_id": "example",
        "reason": {},
        "reference_id": "example",
        "reference_status": {},
        "reference_type": {},
        "refund_id": "example",
        "status": {},
        "subscription_id": "example",
        "test_mode": true
      }
    ]
  }
}
```

### List shipping rates

Browse shipping rates in your Flex account.

**Inputs**

- Active (`active`, true/false): Only return shipping rates where `active` matches this value.
- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From -9007199254740991.0 to 9007199254740991.0.
- Starting after (`starting_after`, text): A cursor for use in pagination. `starting_after` is a shipping rate ID that defines your place in the list.
- Ending before (`ending_before`, text): A cursor for use in pagination. `ending_before` is a shipping rate ID that defines your place in the list.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "shipping_rates": [
      {
        "active": true,
        "amount": 1,
        "created_at": {},
        "display_name": "example",
        "metadata": {},
        "shipping_rate_id": "example"
      }
    ]
  }
}
```

### List subscriptions

Browse subscriptions in your Flex account.

**Inputs**

- Customer ID (`customer_id`, text): Filter by customer ID.
- Expand customer (`expand_customer`, true/false): If true, expands the customer object in the response.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.
- Status (`status`, text): Filter by subscription status. One of: `incomplete`, `incomplete_expired` (Incomplete expired), `trialing`, `active`, `past_due` (Past due), `canceled`, `unpaid`, `paused`.
- Limit (`limit`, number): A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. From 0.0 to 2147483647.0.
- Expand (`expand`, text): Comma-separated list of related objects to expand in the response.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "subscriptions": [
      {
        "backup_payment_method": {},
        "cancel_at": {},
        "cancel_at_period_end": true,
        "canceled_at": {},
        "client_secret": {},
        "created_at": {},
        "current_period_end": {},
        "current_period_start": {},
        "customer": {},
        "default_payment_method": {},
        "discounts": [
          {}
        ],
        "items": [
          {}
        ],
        "latest_invoice": {},
        "metadata": {},
        "pause": {},
        "proration_behavior": {},
        "status": {},
        "subscription_id": "example",
        "test_mode": true,
        "trial_end": {},
        "trial_start": {}
      }
    ]
  }
}
```
