Create a Campaign Session

Create a payment session using a pre-configured campaign for pricing, gateway, and branding.

curl -X POST "https://api.catalystpay.com/api/v1/payment-sessions/" \
  -H "Authorization: Bearer rk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "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={
        "campaign_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "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({
      campaign_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
      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.

The lead object also accepts optional fields: address, city, postal_code, and phone. If a lead with the same email already exists, the campaign's duplicate handling policy applies. See Session Fields Reference for all available fields.