Simulators
Partial seeds
A scenario built from what your app read may know a record but not its id. Started with RYSTIC_SEED_GATE=partial, the simulator takes a seeded record that lists id under _rystic_partial.mint and gives it an id. Here a customer seeded without one gets cus_ and 14 letters and digits, as on Stripe:
export RYSTIC_URL=$(rystic run stripe-twin -d --port 0 --name partial --env RYSTIC_SEED_GATE=partial --json | jq -r .data.url)
curl -s -X POST "$RYSTIC_URL/_rystic/seed" -o /dev/null -w '%{http_code}\n' -d '{"state_customer": {"new": {"_rystic_partial": {"mint": ["id"], "unknown": []}, "object": "customer", "email": "a@example.com"}}}'
# -> 204
curl -s "$RYSTIC_URL/v1/customers?email=a@example.com" -u sk_test_123: | jq -c '[.data[] | {id, email}]'
# -> [{"id":"cus_4k42PdogaEjSNO","email":"a@example.com"}]
These records take an id this way, behind Stripe’s prefix:
| Record | Prefix |
|---|---|
| Customer | cus_ |
| Product | prod_ |
| Price | price_ |
| Subscription | sub_ |
| Subscription item | si_ |
| Invoice | in_ |
| Checkout Session | cs_test_ |
| Billing portal session | bps_ |
Last updated on