Products and prices
Get Started with Products and Prices

Get started with products and prices

Model your business and accept HSA/FSA payments on Flex with products and prices.

Products and Prices are core resources for determining HSA/FSA eligibility and integrating with Flex.

First, make sure you understand the overall goals of your integration project-make your design decisions before you start building it. Ensure you have worked with the Flex team to understand which of your products are HSA/FSA eligible and which ones are not.

For example, if you’re building a Subscription integration, read designing an integration to learn more about design decisions and pricing models to understand how to translate your business model with Flex.

Next, create your products and prices in Flex. Create new products and prices in the dashboard or with the Products API.

Multiple products and prices

You can create as many products as you need to represent your product catalog. You can also create multiple prices for each product. Whether you should create multiple products as opposed to multiple prices depends on several factors. Generally, however, you want to:

  • Create multiple prices for a single product if you’re selling the same item at different price points.

  • Create multiple products if the items require different provisioning or fulfillment in your application.

Create products and prices

Create a product

Create a non eligible product

curl --request POST \
--url https://api.withflex.com/v1/products \
--header 'authorization: Bearer fsk_test_YzNiYjdhNWItN2FkOS00ZTMyLWE5MmQtZTdhNzMzYzE2NTIy' \
--header 'content-type: application/json' \
--data '{"product": {"name": "Test Product","description": "Test Product Description"}}'

Create a product that needs to be auto substantiated by specifying the GTIN that corresponds to your product

curl --request POST \
  --url https://api.withflex.com/v1/products \
  --header 'authorization: Bearer fsk_test_YzNiYjdhNWItN2FkOS00ZTMyLWE5MmQtZTdhNzMzYzE2NTIy' \
  --header 'content-type: application/json' \
  --data '{"product": {"name": "Test Product","description": "Test Product Description","gtin": "123456789", "hsa_fsa_eligibility": "auto_substantiation"}}'

Create a product that may be eligible via a Letter of Medical Necessity by specifying the visit_type

curl --request POST \
  --url https://api.withflex.com/v1/products \
  --header 'authorization: Bearer fsk_test_YzNiYjdhNWItN2FkOS00ZTMyLWE5MmQtZTdhNzMzYzE2NTIy' \
  --header 'content-type: application/json' \
  --data '{"product": {"name": "Test Product","description": "Test Product Description","visit_type": "gym","hsa_fsa_eligibility": "letter_of_medical_necessity"}}'
Edit a product

To modify a product through the API:

curl --request PATCH \
  --url https://api.withflex.com/v1/products/<product_id> \
  --header 'authorization: Bearer fsk_test_YzNiYjdhNWItN2FkOS00ZTMyLWE5MmQtZTdhNzMzYzE2NTIy' \
  --header 'content-type: application/json' \
  --data '{"product": {"gtin": "12234566"}}'
Create a price

Prices use integer cents as the unit_amount. Therefore, if you'd like to specify a price of $10.99 you would pass in the value 1099 as the unit_amount.

Create a one time price

curl --request POST \
  --url https://api.withflex.com/v1/prices \
  --header 'authorization: Bearer fsk_test_YzNiYjdhNWItN2FkOS00ZTMyLWE5MmQtZTdhNzMzYzE2NTIy' \
  --header 'content-type: application/json' \
  --data '{"price": {"product": "fprod_01HW5KTQQAAQ66WV19MFW4DTT4","type": "one_time","description": "6 month membership","unit_amount": 124800}}'

Create a recurring price with a monthly cadence

curl --request POST \
  --url https://api.withflex.com/v1/prices \
  --header 'authorization: Bearer fsk_test_YzNiYjdhNWItN2FkOS00ZTMyLWE5MmQtZTdhNzMzYzE2NTIy' \
  --header 'content-type: application/json' \
  --data '{"price": {"product": "fprod_01HW5KTQQAAQ66WV19MFW4DTT4","description": "6 month 2x/week membership with 6 month commitment","unit_amount": 124800,"recurring": {"interval": "monthly"}}}'