Create a Direct Session

Create a payment session without a campaign by providing pricing and gateway inline.

curl -X POST "https://api.catalystpay.com/api/v1/payment-sessions/" \
  -H "Authorization: Bearer rk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "gateway_id": "f7e8d9c0-b1a2-3456-cdef-890123456789",
    "amount": "29.99",
    "currency": "EUR",
    "billing_type": "ONE_OFF",
    "customer_ip": "203.0.113.50",
    "lead": {
      "first_name": "Max",
      "last_name": "Mustermann",
      "email": "[email protected]",
      "country": "DE"
    }
  }'
import requests

response = requests.post(
    "https://api.catalystpay.com/api/v1/payment-sessions/",
    headers={"Authorization": "Bearer rk_your_api_key"},
    json={
        "gateway_id": "f7e8d9c0-b1a2-3456-cdef-890123456789",
        "amount": "29.99",
        "currency": "EUR",
        "billing_type": "ONE_OFF",
        "customer_ip": "203.0.113.50",
        "lead": {
            "first_name": "Max",
            "last_name": "Mustermann",
            "email": "[email protected]",
            "country": "DE",
        },
    },
)

session = response.json()
print(session["payment_url"])
const response = await fetch(
  'https://api.catalystpay.com/api/v1/payment-sessions/',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer rk_your_api_key',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      gateway_id: 'f7e8d9c0-b1a2-3456-cdef-890123456789',
      amount: '29.99',
      currency: 'EUR',
      billing_type: 'ONE_OFF',
      customer_ip: '203.0.113.50',
      lead: {
        first_name: 'Max',
        last_name: 'Mustermann',
        email: '[email protected]',
        country: 'DE',
      },
    }),
  }
);

const session = await response.json();
console.log(session.payment_url);

Response:

{
  "session_token": "ps_abc123def456...",
  "status": "PENDING",
  "payment_url": "https://pay.catalystpay.com/s/ps_abc123def456..."
}

When your backend creates sessions on behalf of customers, pass customer_ip with the customer's real IP address. This ensures accurate fraud screening by the payment gateway.

In direct mode, gateway_id, amount, currency, and billing_type are required. You can also pass webhook_profile_id for webhook routing, hosted_page_id for branding, and max_payment_attempts (1-10, default 3). See How to Use Direct Mode for the full guide.