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

# How Orchestra Works

> Learn how Orchestra sits between your application and payment providers to route, retry, and process transactions.

Orchestra is a payment orchestration layer that sits between your application and your payment providers. It provides a unified API while routing transactions to the providers you choose.

## The Problem Orchestra Solves

Without Orchestra, integrating multiple payment providers means:

* Writing and maintaining separate integrations for each provider
* Handling different APIs, data formats, and authentication methods
* Building your own failover logic when a provider goes down
* Re-integrating when you want to add or switch providers

Orchestra handles all of this with a single integration.

## Where Orchestra Fits

<img src="https://mintcdn.com/orchestrasolutions/JxGWfuqQpaY3_0EL/images/where-orchestra-fits.svg?fit=max&auto=format&n=JxGWfuqQpaY3_0EL&q=85&s=39bcfff2da4ac51af6f56fd6faa5c818" alt="Where Orchestra fits in your payment stack" style={{maxWidth: '500px', display: 'block', margin: '0 auto'}} width="620" height="520" data-path="images/where-orchestra-fits.svg" />

Your application makes API calls to Orchestra. Orchestra translates those calls to the appropriate provider format and routes the transaction.

## What Orchestra Handles

| Orchestra Does           | You Handle                            |
| ------------------------ | ------------------------------------- |
| Provider API translation | Business logic (what to charge, when) |
| Credential management    | Customer data (accounts, orders)      |
| Transaction routing      | User interface                        |
| Token storage            | Compliance for your stored data       |
| Failover execution       | Provider account setup                |

## Transaction Flow

<Steps>
  <Step title="You make an API call">
    Your server sends a charge request to Orchestra with the amount, currency, and payment details.
  </Step>

  <Step title="Orchestra routes the transaction">
    Based on the `paymentGatewayAccountName` you specify, Orchestra sends the transaction to the appropriate provider.
  </Step>

  <Step title="Provider processes the payment">
    Stripe, Adyen, or whichever provider you specified processes the transaction with the card network and issuing bank.
  </Step>

  <Step title="Orchestra returns the result">
    You receive a standardized response with the transaction ID and status.
  </Step>
</Steps>

## Key Concepts

### Payment Gateway Accounts

A Payment Gateway Account is your connection to a specific provider. You create one for each provider account you want to use:

* "stripeProduction" → Your Stripe live account
* "stripeTest" → Your Stripe test account
* "adyenBackup" → Your Adyen account for failover

When making API calls, you specify which account to use by name.

### Tokens

Orchestra's tokenization stores card details securely and gives you a token reference. Tokens are provider-agnostic. A card tokenized while routing through Stripe can later be charged through Adyen.

### Routing

You control routing by specifying the `paymentGatewayAccountName` in each request. This lets you:

* Use different providers for different markets
* Route high-value transactions to preferred providers
* Implement A/B testing across providers

## Sandbox vs Production

Orchestra provides both environments:

| Environment | Use                  | Provider Mode                             |
| ----------- | -------------------- | ----------------------------------------- |
| Sandbox     | Development, testing | Connect to provider test/sandbox accounts |
| Production  | Live transactions    | Connect to provider live accounts         |

Sandbox transactions are simulated. No real money moves. The API behavior is identical to production.

<Note>
  Use separate API keys and Payment Gateway Accounts for sandbox and production. Don't mix test credentials with live ones.
</Note>

## Related Guides

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Make your first API call
  </Card>

  <Card title="Add Payment Provider" icon="building-columns" href="/getting-started/add-payment-provider">
    Connect your PSP accounts
  </Card>

  <Card title="Architecture" icon="sitemap" href="/concepts/architecture">
    Technical architecture details
  </Card>

  <Card title="Multi-Gateway Failover" icon="layer-group" href="/guides/rest-api/multi-gateway-failover">
    Set up automatic failover
  </Card>
</CardGroup>
