> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paylead.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Paylead exposes two environments: sandbox for integration work and production for live traffic. Each has its own URL, tokens, and data.

export const PRODUCTION_BASE_URL = "https://api-{programRef}.paylead.eu";

export const SANDBOX_BASE_URL = "https://api-{programRef}.sandbox.paylead.tech";

Paylead runs two fully isolated environments. Build and validate against the sandbox. Switch to production only after Paylead approves your integration.

**Why this matters.** Sandbox and production do not share data, tokens, or Consumers. A token from one will not work against the other. Treat them as two separate platforms.

## Comparison

Sandbox and production have **full feature parity**. The only differences are the URL, the data they hold, performance, and who is responsible for what. Each Program gets a dedicated subdomain keyed by its **`programRef`**, a unique identifier issued by Paylead at onboarding. Substitute it into the URLs below; the rest of the host is fixed per environment.

| Property         | Sandbox                                   | Production                                              |
| ---------------- | ----------------------------------------- | ------------------------------------------------------- |
| Base URL         | <code>{SANDBOX_BASE_URL}</code>           | <code>{PRODUCTION_BASE_URL}</code>                      |
| Data             | Test entities you create yourself, no PII | Real [Consumers](/glossary#consumer), real transactions |
| Persistence      | Permanent (you manage your own cleanup)   | Permanent                                               |
| Access           | Granted on signup                         | Granted after sandbox validation                        |
| Feature set      | 100% of production features               | Same                                                    |
| Webhook delivery | Sandbox signing secret                    | Production signing secret                               |
| Pricing          | Free                                      | Per contract                                            |

<Note>
  Sandbox and production hold separate datasets. IDs created in sandbox never appear in production and the reverse.
</Note>

## Pick the right environment

| You are...                                   | Use                            |
| -------------------------------------------- | ------------------------------ |
| Building the first integration               | Sandbox                        |
| Running automated tests in CI                | Sandbox                        |
| Demoing to internal stakeholders             | Sandbox                        |
| Validating PSD2 transaction ingestion        | Sandbox first, then Production |
| Serving real [Consumers](/glossary#consumer) | Production (staged, see below) |

### Production rollout phases

Going live in production is staged. Paylead validates your integration at each phase before opening the next:

| Phase                    | Audience                                                                         | Purpose                                                                   |
| ------------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| **Alpha**                | A restricted, controlled cohort (typically your own test users and Paylead team) | Paylead validates the end-to-end integration against production plumbing. |
| **Beta**                 | A limited group of real [Consumers](/glossary#consumer)                          | Pilot run at small scale before full availability.                        |
| **General availability** | All your Consumers                                                               | Full production rollout.                                                  |

Paylead gates the move from one phase to the next; coordinate the schedule with your account manager.

## Switching environments in code

The only differences between environments are the base URL and the token. Keep both behind environment variables.

<Note>
  **Code examples coming soon.** The Paylead API (v2) is still under construction. Request and response examples for this section will be published once the contract is finalized. In the meantime, contact your Paylead account manager for early-access details.
</Note>

<Warning>
  Never hardcode the base URL or token in source. A single misconfigured deploy can leak production data to a staging service.
</Warning>

## Get sandbox access

Paylead grants sandbox access when you sign up for an account in [Shift](/glossary#shift). If you are not yet a [Program Manager](/glossary#program-manager), contact your Paylead representative.

## Promote to production

<Steps>
  <Step title="Complete sandbox integration">
    Implement the [Paylead API](/program/user-journey/quickstart) endpoints you need against the sandbox. Cover every endpoint you will call in production.
  </Step>

  <Step title="Run the validation suite">
    Paylead provides an integration checklist. Execute end-to-end scenarios: Consumer enrollment, transaction ingestion, Reward attribution, Ventilation export.
  </Step>

  <Step title="Request production review">
    Open a ticket in Shift or contact your Paylead representative with your integration summary. Paylead reviews logs and edge cases.
  </Step>

  <Step title="Receive production credentials">
    Once validated, generate your production tokens in Shift's **Settings > API Keys**. Roll them through your secret manager.
  </Step>
</Steps>

<Check>
  Your services run against `api-{programRef}.paylead.eu` with production tokens. Sandbox tokens stay in CI and staging.
</Check>

## Sandbox limits

The sandbox is shaped for development, not load testing.

* Data is **not** reset automatically; you manage your own cleanup.
* Per-Program rate limits apply. See [Rate limits](/program/user-journey/rate-limits) and confirm your thresholds with your account manager.
* Feature parity with production is complete. Anything you can do in production, you can do in sandbox.

## What's next

<CardGroup cols={2}>
  <Card title="Consumer lifecycle" icon="user-cog" href="/program/user-journey/guides/manage-consumers">
    Enroll Consumers and manage their accounts.
  </Card>

  <Card title="Share transactions" icon="refresh-cw" href="/program/user-journey/concepts/transaction-lifecycle">
    How a transaction becomes an attributed Reward.
  </Card>

  <Card title="Rate limits" icon="gauge" href="/program/user-journey/rate-limits">
    Sandbox vs production throughput.
  </Card>
</CardGroup>
