Skip to Content
SandboxUse Stripe test keys

Use Stripe test keys

Only Stripe test keys can be used in Preternatural sandbox environment.

Do not add Stripe live-mode credentials to a sandbox project. Keys beginning with pk_live_, sk_live_, or rk_live_ belong only in a production project.

Get the keys from Stripe

In the Stripe Dashboard:

  1. Turn on Test mode.
  2. Open Developers.
  3. Open API keys.
  4. Copy the test publishable key.
  5. Reveal and copy the test secret key.

Connect Stripe to the sandbox project

Switch to sandbox

In the Preternatural dashboard, use the environment toggle to select Sandbox.

Open the project

Open the sandbox project that you want to connect to Stripe.

Open the general tab

Select General and find Provider connections.

Enable Stripe

Enable the Stripe connection.

Enter the test credentials

Enter the Stripe test secret key and test publishable key. You can paste the credentials directly or select saved credentials from a connected secrets manager.

Both credentials must use Stripe test mode. Do not mix a test publishable key with a live secret key, or a live publishable key with a test secret key.

Wait for connection verification

The Stripe connection status changes while Preternatural checks the credentials.

Continue when the status shows Connected.

Save the project

Select Save changes.

Preternatural saves the Stripe connection and configures the webhook used for Stripe events.

Configure Stripe products

WARNING

WIP: Need to check whether it is being used or not in the Stripe - Preternatural integration flow MODEM-914

If the project uses paid Preternatural products, add the corresponding Stripe Product IDs to the Stripe connection.

Stripe Product IDs begin with prod_. Make sure the products exist in the same Stripe test-mode account as the API keys.

Test-mode products and prices are separate from live-mode products and prices. A live Price ID or Product ID cannot be used for a test-mode Checkout Session.

Verify the connection

After saving the project, confirm that:

  • The Stripe connection shows Connected.
  • Stripe shows the Preternatural webhook endpoint in the test environment.

Troubleshooting

The key modes do not match

The publishable and secret credentials must both come from test mode. A test key and a live key cannot form one connection.

A product is not available during Checkout

Confirm that the Stripe Product ID and Price ID exist in test mode and belong to the Stripe account connected to the sandbox project.

Stripe authentication fails

Create or reveal a new test secret key in Stripe, replace the saved credential, wait for the connection check, and save the project again.

Before configuring production

Create a separate production project and connect it with live-mode Stripe credentials. Do not replace a sandbox project’s test keys with live keys.

See Sandbox mode for the resources that remain separate between environments.