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

# Gateway Accounts

> Manage stored payment gateway credentials via API.

<Info>
  This page is part of the **REST API Guides**. [View all REST API guides →](/guides/rest-api/charge)
</Info>

<Tip>
  Automate gateway credential management: create, update, and delete payment gateway accounts programmatically instead of using the Portal UI. Ideal for CI/CD pipelines and multi-environment deployments.
</Tip>

Payment Gateway Accounts store your processor credentials securely in Orchestra. While most users configure these through the [Portal](/getting-started/add-payment-provider), you can also manage them programmatically.

<Note>
  Account names must be 3-64 alphanumeric characters (no spaces or special characters).
</Note>

## Create or Update an Account

**Endpoint**: `PUT /PaymentGatewayAccounts/{name}`

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.orchestrasolutions.com/PaymentGatewayAccounts/stripeProduction', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
      'X-Api-Key': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      paymentGatewayName: 'Stripe',
      credentials: [
        { Key: 'SecretKey', Value: 'sk_live_...' }
      ]
    })
  });
  ```

  ```bash cURL theme={null}
  curl -X PUT https://api.orchestrasolutions.com/PaymentGatewayAccounts/stripeProduction \
    -H "Content-Type: application/json" \
    -H "X-Api-Key: YOUR_API_KEY" \
    -d '{
      "paymentGatewayName": "Stripe",
      "credentials": [
        { "Key": "SecretKey", "Value": "sk_live_..." }
      ]
    }'
  ```

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

  response = requests.put(
      'https://api.orchestrasolutions.com/PaymentGatewayAccounts/stripeProduction',
      headers={
          'Content-Type': 'application/json',
          'X-Api-Key': 'YOUR_API_KEY'
      },
      json={
          'paymentGatewayName': 'Stripe',
          'credentials': [
              {'Key': 'SecretKey', 'Value': 'sk_live_...'}
          ]
      }
  )
  ```
</CodeGroup>

<Card title="API Reference" icon="code" href="/api-reference/paymentgatewayaccounts/overview">
  Complete parameter reference, response fields, and status codes for all operations
</Card>

### Finding Required Credentials

Each gateway requires different credentials. Use [List Gateways](/guides/rest-api/utilities/list-gateways) to find the `credentialsNames` for your gateway:

```javascript theme={null}
// GET /PaymentGateway returns:
// { "name": "Adyen", "credentialsNames": ["ApiKey", "MerchantAccount"] }

// So your credentials array should include:
{
  "paymentGatewayName": "Adyen",
  "credentials": [
    { "Key": "ApiKey", "Value": "your-api-key" },
    { "Key": "MerchantAccount", "Value": "your-merchant-account" }
  ]
}
```

***

## Retrieve an Account

**Endpoint**: `GET /PaymentGatewayAccounts/{name}`

```javascript theme={null}
const response = await fetch('https://api.orchestrasolutions.com/PaymentGatewayAccounts/stripeProduction', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
  }
});

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

***

## List All Accounts

**Endpoint**: `GET /PaymentGatewayAccounts`

```javascript theme={null}
const response = await fetch('https://api.orchestrasolutions.com/PaymentGatewayAccounts', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
  }
});

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

<Note>
  The list endpoint returns brief information without credentials. Use the retrieve endpoint to get full details.
</Note>

***

## Delete an Account

**Endpoint**: `DELETE /PaymentGatewayAccounts/{name}`

```javascript theme={null}
const response = await fetch('https://api.orchestrasolutions.com/PaymentGatewayAccounts/oldAccount', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
  }
});
```

<Warning>
  Deletion is permanent. Ensure no active integrations reference the account before deleting.
</Warning>

***

## Naming Conventions

Suggested naming patterns for gateway accounts:

| Pattern                  | Example                     | Use Case                       |
| ------------------------ | --------------------------- | ------------------------------ |
| `{gateway}{Environment}` | `stripeProduction`          | Single gateway per environment |
| `{gateway}{Region}`      | `adyenEu`                   | Regional gateway routing       |
| `{gateway}{Channel}`     | `stripeWeb`, `stripeMobile` | Channel-specific accounts      |

## Related

<CardGroup cols={2}>
  <Card title="List Gateways" icon="list" href="/guides/rest-api/utilities/list-gateways">
    Find required credentials
  </Card>

  <Card title="Portal Setup" icon="browser" href="/getting-started/add-payment-provider">
    UI-based configuration
  </Card>
</CardGroup>
