> ## 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.

# Charge Payments

> Process immediate card payments through Orchestra.

<Info>
  This page is part of the **REST API Guides**. Using the JavaScript library instead? See [Payments Library Guides](/guides/library/setup).
</Info>

**Prerequisites:** [API key](/getting-started/generate-api-key) and [Payment Gateway Account](/getting-started/add-payment-provider) configured.

The charge operation captures funds from a card immediately. Use this for standard purchases where you're ready to fulfill the order.

<Note>
  Some payment processors require additional parameters. See the [Additional Guidance](/guides/rest-api/gateway-requirements) section for processor-specific requirements.
</Note>

## Basic Charge

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/charge', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Api-Key': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      amount: 25.00,
      currency: 'USD',
      paymentGatewayAccountName: 'stripeProduction',
      card: {
        cardNumber: '4111111111111111',
        cardHolderName: 'Jane Smith',
        expirationMonth: 12,
        expirationYear: 2027,
        cvv: '123'
      }
    })
  });

  const result = await response.json();
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.orchestrasolutions.com/PaymentGateway/charge \
    -H "Content-Type: application/json" \
    -H "X-Api-Key: YOUR_API_KEY" \
    -d '{
      "amount": 25.00,
      "currency": "USD",
      "paymentGatewayAccountName": "stripeProduction",
      "card": {
        "cardNumber": "4111111111111111",
        "cardHolderName": "Jane Smith",
        "expirationMonth": 12,
        "expirationYear": 2027,
        "cvv": "123"
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.orchestrasolutions.com/PaymentGateway/charge',
      headers={
          'Content-Type': 'application/json',
          'X-Api-Key': 'YOUR_API_KEY'
      },
      json={
          'amount': 25.00,
          'currency': 'USD',
          'paymentGatewayAccountName': 'stripeProduction',
          'card': {
              'cardNumber': '4111111111111111',
              'cardHolderName': 'Jane Smith',
              'expirationMonth': 12,
              'expirationYear': 2027,
              'cvv': '123'
          }
      }
  )
  ```
</CodeGroup>

<Card title="API Reference" icon="code" href="/api-reference/paymentgateway/perform-a-payment-gateway-charge-operation">
  Complete parameter reference, response fields, and validation rules
</Card>

<Note>
  To use a tokenized card number, prefix the token with `@` in the `cardNumber` field: `"cardNumber": "@your-token-id"`. See [Tokenization](/guides/rest-api/tokenization).
</Note>

## Using a Stored Token

If you've tokenized a card number with [StringTokens](/guides/rest-api/tokenization), reference it in the `cardNumber` field with an `@` prefix:

```javascript theme={null}
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/charge', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    amount: 25.00,
    currency: 'USD',
    paymentGatewayAccountName: 'stripeProduction',
    card: {
      cardNumber: '@nQGywsQE9gbURtrXEjTZwtWqeMdK9nsO',  // Token with @ prefix
      cardHolderName: 'Jane Smith',
      expirationMonth: 12,
      expirationYear: 2027,
      cvv: '123'
    }
  })
});
```

## Using Inline Credentials

Instead of a stored Payment Gateway Account, you can provide credentials inline:

```javascript theme={null}
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/charge', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    amount: 25.00,
    currency: 'USD',
    paymentGatewayAccount: {
      paymentGatewayName: 'Stripe',
      credentials: [
        { Key: 'SecretKey', Value: 'sk_live_...' }
      ]
    },
    card: {
      cardNumber: '4111111111111111',
      cardHolderName: 'Jane Smith',
      expirationMonth: 12,
      expirationYear: 2027,
      cvv: '123'
    }
  })
});
```

## Adding Failover

Orchestra's multi-gateway failover automatically retries a charge on a backup gateway if the primary fails. For charge requests, failover isn't a field you pass in the request body: it's configured on your Payment Gateway Account setup.

<Card title="Contact Support" icon="headset" href="mailto:support@orchestrasolutions.com">
  Email **[support@orchestrasolutions.com](mailto:support@orchestrasolutions.com)** to enable multi-gateway failover for your charge requests.
</Card>

See [Multi-Gateway Failover](/guides/rest-api/multi-gateway-failover) for how Orchestra's failover mechanism works, including a self-serve example on the eWallet checkout session endpoint.

## Charge vs Authorize

| Operation     | When to Use                                           |
| ------------- | ----------------------------------------------------- |
| **Charge**    | Immediate fulfillment, digital goods, services        |
| **Authorize** | Delayed fulfillment, physical goods, variable amounts |

If you need to hold funds without capturing immediately, use [Authorize & Capture](/guides/rest-api/authorize-capture) instead.

## Related

<CardGroup cols={2}>
  <Card title="Refunds & Voids" icon="rotate-left" href="/guides/rest-api/refunds-voids">
    Reverse or cancel this charge
  </Card>

  <Card title="Authorize & Capture" icon="hand-holding-dollar" href="/guides/rest-api/authorize-capture">
    Hold funds and capture later
  </Card>

  <Card title="Tokenization" icon="lock" href="/guides/rest-api/tokenization">
    Store card numbers securely
  </Card>
</CardGroup>
