Skip to content

Sandbox and Prod

Friendly Payroll has two separate modes:

Sandbox Prod
Money None moves. Payroll runs are simulated. Real payroll, taxes and deposits.
Secret keys sk_sandbox_… sk_prod_…
Client secrets fpcs_sandbox_… fpcs_prod_…
API base URL https://api.sandbox.friendlypayroll.com https://api.friendlypayroll.com

The modes share nothing but your dashboard login. Employers, Workers, keys, Allowed Origins and webhook settings are all separate, so testing can never touch real payroll.

Send Sandbox keys to api.sandbox.friendlypayroll.com and Prod keys to api.friendlypayroll.com. A key sent to the wrong one is rejected with a 401 that says which key it expected.

A simple approach is to pick the base URL from the key:

const key = process.env.FRIENDLY_PAYROLL_SECRET_KEY!;
const baseUrl = key.startsWith('sk_prod_')
? 'https://api.friendlypayroll.com'
: 'https://api.sandbox.friendlypayroll.com';

The frontend components need no configuration. They read the mode from the client secret.

In Prod, Screens only render on websites you’ve listed as Allowed Origins in the dashboard, such as https://app.yourproduct.com. This stops anyone else from framing your customers’ payroll. Sandbox accepts any origin, so localhost works while you build.

  1. Add your production origins under Allowed Origins in Prod.
  2. Create a Prod secret key and deploy it to your production server.
  3. Point your server at https://api.friendlypayroll.com.

Employers you created in Sandbox don’t carry over. Each customer is created in Prod the first time your production server creates a Session for them.