Sandbox testing

Test keys (cp_test_…) create sandbox link tokens (lt_test_…). Payments go through Stripe's test mode: no real money moves. Everything below works on the live sandbox.

Provider payments

Pick Klarna, Affirm, Afterpay or Zip in Link. You'll land on the provider's test page:

ProviderTest pageTo approveTo fail
Affirm, Afterpay, ZipStripe's test payment pageAuthorize test paymentFail test payment
KlarnaKlarna's playgroundFollow the test loginCancel

Approving returns onSuccess with a public token; failing returns onExit withPAYMENT_FAILED. Smart routing ranks the offers per order; each provider shows only for amounts in its range.

CoverPay's own planSandbox only

CoverPay fills in when no provider approves: pay in 4, every 2 weeks, 0% APR, up to $500 per shopper (minus what they still owe), from $10. To see it, make every provider decline with a sandbox-only flag on the link token:

POST /v1/link/token/create
{ "amount": 12000, "currency": "USD", "merchantName": "My Store", "orderId": "order_1",
  "customerId": "user_1", "metadata": { "coverpay_test": "providers_decline" } }

Pick CoverPay, then pay the first payment on Stripe's page with a test card:

CardWhat happens
4242 4242 4242 4242Succeeds now and later.
4000 0000 0000 0341Saves, then every later charge fails (fails at checkout too).

Any future expiry, any CVC, ZIP 94103. Untick "Save my information" (Stripe Link) so it doesn't ask for a phone.

Collecting the rest without waiting

Payments 2 to 4 are charged automatically when due. In sandbox, make the next one due now and the collector picks it up within minutes:

POST /v1/credit/loans/{payment_id}/make-due      # next payment due now; the collector charges it
POST /v1/credit/loans/{payment_id}/collect-next  # or charge it immediately
GET  /v1/credit/loans/{payment_id}               # plan, schedule and your payout

A failed payment marks the plan behind and is retried after 24 hours, up to 3 times.

Your payout

When payment 1 succeeds, CoverPay pays you the plan amount minus your CoverPay fee (0% in sandbox) through Stripe Connect. Set up payouts once with POST /v1/payouts/onboarding (Stripe-hosted, test values accepted) and check them with GET /v1/payouts.

Things that should be refused

TryExpect
Change the amount in the browser before payingThe payment is for the link token amount anyway
Open Link with an API key instead of a link tokenThrows before opening
Exchange a public token with another business’s key404
Reuse a finished link token410 USED_LINK_TOKEN
Send a webhook without a valid signature401
Test data
Use test cards, test bank 110000000 / 000123456789, and Stripe's test identity values (000000000, address_full_match, DOB 01/01/1901). Never real personal or bank details.