Skip to main content

Code Examples

Common integration patterns for the PayConnect API in multiple languages.

Authentication​

Create a Session Token​

curl -X POST https://dev.payconnect.us/api/auth/session \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json"

Create a Transaction​

curl -X POST https://dev.payconnect.us/api/trx/payment \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "x-correlation-id: YOUR_CORRELATION_ID" \
-H "Content-Type: application/json" \
-d '{
"contact_api_id": "ct_abc123",
"transaction_amount": 50,
"order_id": "ORD-2026-001",
"account_vault_id": "av_abc123",
"type": "av",
"description": "Order #1234"
}'

Create an Invoice​

curl -X POST https://dev.payconnect.us/api/invoices \
-H "x-session-token: YOUR_SESSION_TOKEN" \
-H "x-correlation-id: YOUR_CORRELATION_ID" \
-H "Content-Type: application/json" \
-d '{
"customerId": "cust_abc123",
"amount": 150,
"description": "Consulting services - January 2025",
"dueDate": "2025-02-01"
}'

Create a Subscription​

curl -X POST https://dev.payconnect.us/api/subscriptions/v2 \
-H "x-session-token: YOUR_SESSION_TOKEN" \
-H "x-correlation-id: YOUR_CORRELATION_ID" \
-H "Content-Type: application/json" \
-d '{
"customerId": "cust_abc123",
"planId": "plan_xyz789",
"billingMode": "recurring",
"startDate": "2026-02-01"
}'
tip

All monetary amounts are in dollars. For example, 50 = $50.00.