lumnik. / scenarios All scenarios · Français

Stripe: every customer read without writing the pagination

Goal Read every customer of a Stripe account, page after page, without writing the paging.

Stripe pages by cursor: each page says has_more, the next is asked for with starting_after, the last customer's id. lumnik has a preset of the same name:

manifests/lab-docker-compose.yml
# Stripe's API, served by localstripe — an open-source, stateful stand-in used in test suites.name: lumnik-stripeservices:  localstripe:    image: python:3.12-slim    command: ["sh", "-c", "pip install --quiet localstripe==1.15.10 && exec localstripe --port 8420"]    ports: ["127.0.0.1:${STRIPE_PORT:-8420}:8420"]   # this machine only
manifests/10-customers.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata:  name: scenario-stripe-a  connector_type: rest-generic  scopes: [billing]spec:  base_url: http://host.docker.internal:8420  auth: { kind: bearer, token_env: SCENARIO_STRIPE_KEY }   # a Stripe secret key, test mode  endpoints:    - id: customers      path: /v1/customers?limit=10      method: GET      pagination: { kind: stripe }       # starting_after the last id, until has_more is false      target:        kind: hybrid        table: ext.scenario_stripe_a        unique_key: $.id        promote:          - { name: name, path: $.name, type: text }          - { name: email, path: $.email, type: text }          - { name: created, path: $.created, type: timestamptz, transform: from_epoch }
$ lm connector run scenario-stripe-a
run scheduled: 21a0f34b-1641-4247-8e32-d56d6ad8d798

$ lm run get 21a0f34b-1641-4247-8e32-d56d6ad8d798
ID        CONNECTOR          ENDPOINT   STATUS     IN  OUT  SKIPPED  DEAD-LETTERS  STARTED           ENDED             EVALUATED
21a0f34b  scenario-stripe-a  customers  Completed  30  30   0        0             2026-10-30 22:58  2026-10-30 22:58  yes

Limits

  • Replayed on localstripe, not Stripe: the real Stripe reads with the same manifest and the account's key.
  • Each night rereads the whole account.
  • Synthetic customers.

Billing · customers

The customers are in Stripe.

They must all be read, every night.

Stripe's API served by localstripe, in test

The problem

Stripe returns its customers in pages of 10.

  • Each page says whether more remain.
  • The next is asked for from the last customer read.

What is not changed

The account stays as it is.

  • A test key, stored with lm secret.
  • Stripe's standard API.

What had to be written

pagination: { kind: stripe }

Name the API.

One 24-line connector.

The result

25 customers, 3 pages.

  • Each customer under its Stripe id.
  • The creation date converted from epoch.

The next day

5 new customers: 30 rows.

  • One row per customer, no duplicate.
  • The night rereads the whole account.

The limit

Replayed on localstripe, not Stripe.

  • An open-source, stateful Stripe stand-in used in tests.
  • The real Stripe reads the same, with the account's key.

Try it

The scenario replays locally.

Every step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →