Create a hosted session
response.json() parsing and return a fast success response after deduplication.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Call the merchant API from a reliable Python server.
import os
import requests
API_URL = os.environ.get("ZAHLO_API_URL", "https://merchant-demo.zahlo.eu")
API_KEY = os.environ["ZAHLO_API_KEY"]
response = requests.post(
f"{API_URL}/api/v1/checkout-sessions",
headers={
"x-api-key": API_KEY,
"Idempotency-Key": "checkout-order-1001",
},
json={
"mode": "hosted",
"amountMinor": 4990,
"currency": "EUR",
"paymentMethodTypes": ["card", "bank"],
"orderId": "order-1001",
"successUrl": "https://store.example/checkout/success",
"cancelUrl": "https://store.example/checkout/cancelled",
},
timeout=10,
)
response.raise_for_status()
checkout = response.json()
response.json() parsing and return a fast success response after deduplication.