Install and initialize
Payment links
For a product with a published version:Checkout for a known customer
Use a stable key for the purchase intent, such as an order ID:taxId in
customer when required. Never send raw card details to the Infi API.
Inspect a payment
Idempotency
The SDK generates an idempotency key per mutating call. That protects transport retries of the same call, not a second invocation caused by a double-click. Pass the same explicit key for the same purchase intent. Reusing a key with a different request body returns409 idempotency_key_reused.
Resource methods take the key as a trailing argument. Shortcuts such as
checkout accept idempotencyKey in the options object.
Record usage
First configure a product, a published version and the named meter. Enroll your customer in that product:customerId here is the enrollment ID, not your application’s user ID. Always
include productId. For replayed usage, keep both eventId and
timestamp stable: they participate in deduplication.
Recording usage does not by itself create a billing period or a subscription.
See the company-as-code guide
before enabling usage-based charging.