Guides
...
Usage metering
Backfill Meters and Customers

Java sample to backfill customers in Stripe and Amberflo from Postgres

2min

The following JAVA sample shows how to create customers from a Postgres database.

The sample performs the following tasks:

  1. Query customer Postgres customer table
  2. For each row,
    1. Check if customer does not already exist in Amberflo
    2. Create the customer in Stripe
    3. Create the customer in Amberflo and set the Stripe ID from previous step in the traits
    4. Assign the customer to a default rate plan.

Maven dependencies (check for latest versions):

pom.xml


Sample Java Code:

Java