POST
/
collect
/
payment_sessions
curl --request POST \
--url https://api.momentco.io/collect/payment_sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{
"amount": 200,
"currency": "ZAR"
}'
{
"id": "ps_kfAWZgfQIoeG0q",
"type": "one_time",
"amount": 50,
"currency": "ZAR",
"status": "active",
"payment_status": "unpaid",
"checkout_session_id": "ckt802zEb2P2uS4Ql",
"session_url": "https://moment.dev.momentpay.io/checkout/ckt802zEb2P2uS4Ql",
"return_url": null,
"mode": "live",
"created_at": "2025-03-18T14:06:51.149Z",
"updated_at": "2025-03-18T14:06:51.149Z"
}

Authorizations

Authorization
string
header
required

Authentication using Bearer tokens. Include your API key in the Authorization header.

Key Types:

  • Test Keys: sk_test_* for development and testing
  • Live Keys: sk_* for production environments
  • Public Keys: pk_test_* or pk_* for client-side operations

📩 Need access? Contact Support to request your API keys.

Usage:

Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc

Headers

Idempotency-Key
string<uuid>
required

A unique key to prevent duplicate operations. Use the same key for retries to ensure idempotent behavior.

Best Practices:

  • Use UUIDs or other cryptographically unique identifiers
  • Maintain keys for at least 24 hours for retry scenarios
  • Use different keys for different operations
  • Monitor Idempotent-Replayed header for cache hits
Required string length: 1 - 255

Body

application/json

Response

201
application/json

Payment session created

The response is of type object.