Testing & sandbox
Environments
Sandbox is public. Production is internal since November 2026: it answers only from Snappy's Twingate egress addresses, so anything run against prod has to come from that network. See Operations.
| Sandbox | Production | |
|---|---|---|
| Base URL | https://sandbox.agents.snappy.com |
https://agents.snappy.com |
| Snappy API | Fixture catalog until a Snappy key is entered in the admin portal (Integrations); then the key you entered (testing company recommended) | Production partner key, entered in the admin portal |
| Payments | Fake pay page until Stripe test keys are entered in Integrations; then Stripe test mode | Stripe live keys, entered in Integrations |
| Messaging | Sink mode until SendGrid/Twilio are configured: messages are recorded, not sent; OTP codes are shown on the sign-in page | SendGrid + Twilio (10DLC Messaging Service) |
How to test checkout without real charges
- Connect to the sandbox base URL. Register your client, complete OAuth (the sign-in page shows the email code inline in sink mode).
- Create a quote and a checkout as in the Quickstart.
- Open
paymentUrl:- With Stripe test mode: use card
4242 4242 4242 4242, any future expiry, any CVC. - With the fake pay page (
/pay/fake/…): click Pay (sandbox).
- With Stripe test mode: use card
- Within seconds
GET /v1/checkouts/{id}returnsconfirmedand anorderId. The Snappy order exists in the testing company and is never shipped. - Cancel it with
POST /v1/orders/{id}/cancelto exercise the refund path.
Reviewer test account
For the Meta review, Snappy provides a dedicated sandbox sign-in email and keeps sink mode on, so the OTP appears on the page and no real email is required. Credentials are shared in the submission form, never in this repository.
Failure paths you can trigger in sandbox
| Scenario | How |
|---|---|
| Country not supported | countryCode: "CA" on a quote (US only) |
| Variant unavailable in country | A variant with available: false for the country in availability |
| Address unverified | postalCode: "00000" |
| Payment link expired | Wait past expiresAt or expire the Stripe session in the dashboard |
| Snappy rejection after payment → automatic (partial) refund | Ask Snappy ops to set the sandbox billing method to zero balance; with the fixture catalog, see the component test "refunds the failed ones" |
| SMS consent | Pass notify.sms without smsConsent → sms_consent_required with the consent text |
| Support request | Mark an order shipped (webhook or fixture) and call POST /v1/orders/{id}/support-requests |
| Protocol checkout declined | ACP or UCP complete with token fake_declined → 200 with a payment_declined message, session stays open |
| Protocol checkout needs authentication | token fake_3ds → 200 with a requires_3ds message, session stays open (delegated tokens are never challenged here) |
| Idempotency conflict | Repeat a protocol POST with the same Idempotency-Key and a different body → ACP 422 idempotency_conflict, UCP 409 |
| UCP signature rejected | Sign a request with a key that is not in the platform's profile → 401 signature_invalid |
| AP2 mandate rejected | Send a forged ap2.checkout_mandate → mandate_invalid_signature in the UCP envelope |
How to test the open protocols without real charges
ACP and UCP checkouts need no shopper sign-in and no Stripe page. Register a platform in admin → Protocols on the sandbox, take the one-time key, and run the worked example on Agentic commerce → Sandbox: create the session, add the address, complete with the fake token fake_ok. The session shows under Protocols with the checkout it became; the order is placed in the testing company like any other. With Stripe test keys entered in Integrations the ACP handler expects real Shared Payment Tokens minted with Stripe's test helper, and the UCP handler Google Pay TEST tokens. The feeds answer 503 feeds_not_configured until a feed token is set in Integrations → Product feeds.
Local development
cp .env.example .env # defaults: fixtures, fake payments, sink messaging, in-memory Postgres
pnpm install
pnpm --filter @snappy-agents/db build && pnpm --filter @snappy-agents/snappy-client build && pnpm --filter @snappy-agents/core build
pnpm dev # http://localhost:8080 (docs at /docs, admin at /admin after `pnpm --filter @snappy-agents/admin build`)
pnpm test
In APP_ENV=local the admin portal offers a dev sign-in for emails listed in ADMIN_EMAILS.