Skip to content

Get started

Testing in the sandbox

Stripe's test mode, the registration that approves instantly and knowing it was paid.

Updated

Sandbox is not a mock. The sale goes out as in production: BEINFI LTD sells, and the charge opens a Checkout session on its Stripe account, in test mode. Same form, same page, same states. What changes is the Stripe key, not the code. No real money moves.

Before selling: the registration

The account the quickstart hands you opens the checkout, but does not charge. Until the registration is submitted, the page answers unavailableReason: "supplier_country_required".

In sandbox the submission approves instantly and identity verification is skipped (kyc.status: "skipped"). It is five calls, all on the authenticated API:

# 1. who sells: company or person, country and document
curl -X PUT $API/account/mor/registration -H "Authorization: Bearer $K" \
  -H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" \
  -d '{"country":"GB","entityType":"company","legalName":"Acme Ltd","document":"GB123456789",
       "address":{"line1":"1 High Street","city":"London","postalCode":"EC1A 1BB"}}'
# the response carries agreement.id and policy.version, used below
 
# 2. the supplier agreement with BEINFI LTD
curl -X POST $API/account/mor/agreements/$AGREEMENT_ID/accept -H "Authorization: Bearer $K" -H "Idempotency-Key: $(uuidgen)"
 
# 3. what you sell
curl -X PUT $API/account/mor/eligibility -H "Authorization: Bearer $K" \
  -H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" \
  -d '{"sells":["digital_downloads"],"country":"GB","entityType":"company","currency":"BRL"}'
 
# 4. the product policy
curl -X POST $API/account/mor/policy/$POLICY_VERSION/accept -H "Authorization: Bearer $K" -H "Idempotency-Key: $(uuidgen)"
 
# 5. submit
curl -X POST $API/account/mor/application/submit -H "Authorization: Bearer $K" -H "Idempotency-Key: $(uuidgen)"
# -> { "admission": { "status": "approved", … }, "kyc": { "status": "skipped" } }

In the dashboard it is the same registration, in screens. A person in Brazil ("country":"BR", "entityType":"individual") also sends personal details and a bank account; the dashboard guides you.

What comes back on the charge

{
  "id": "pay_…",
  "invoiceId": "inv_…",
  "provider": "infi_stripe_uk",
  "method": "card",
  "status": "pending",
  "checkoutAction": {
    "kind": "stripe_checkout_elements",
    "clientSecret": "cs_test_…",
    "publishableKey": "pk_test_…",
    "mode": "payment"
  }
}
  • checkoutAction is the session Stripe's Payment Element mounts. Infi's page does that on its own; you only need it if you mount the form yourself.
  • method: "card" is the Stripe form, not the payment method. Inside it, on a BRL sale, the buyer chooses card or Pix.
  • There is no pixPayload, QR or boleto line. Pix is Stripe's and shows up in the form.

No CPF/CNPJ

The sale is BEINFI LTD's and Stripe does not ask for a document. The buyer gives an email, a country and, at payment time, the minimum address the tax needs.

Paying in test

Open the payment page (the url from checkout() or the link) and pay in the form with Stripe's test data:

  • Card: 4242 4242 4242 4242, any future expiry, any CVC. To test 3DS, 4000 0027 6000 3184.
  • Pix: choose Pix in the form. Stripe shows a test QR and the instructions page where you authorize the test payment.

Paying needs the browser: the form is Stripe's and confirms straight with it. There is no Infi route to "confirm as if I had paid" — no /sandbox/pix/{id}/pay, no sandboxConfirmUrl. Confirmation arrives through Stripe's webhook, as in production.

Knowing it was paid

The invoice becomes paid when Stripe says so. POST /billing/invoices/{id}/mark-paid records money received outside Infi and does not emit payment.confirmed; it is not a test payment.

sandboxproduction
Polling the invoice✅ works✅ works
Webhook payment.confirmed❌ 503 on register✅

Registering a webhook answers 503 secret_store_unavailable when the secret store is not configured. That is what the public sandbox does today: the process starts with a nil store. It is not a standing rule of every test tenant. Until the store is there, polling is the way:

const paid = await infi.pay.waitForPaid({ slug, invoiceId, timeoutMs: 15000 });
// or, server-side:
const inv = await infi.invoices.get(invoiceId);   // status: "open" | "paid"

The events, signature verification and what to do in production are in webhooks.

What does NOT exist in sandbox

Things that answer with an error and are not your bug:

  • providers.* → 404. There is no provider to connect: every sale goes through BEINFI LTD's Stripe account.
  • webhooks.create → 503, as above.
  • Payout to you. Sandbox moves no money: nothing is paid through Wise.