Request and response you should expect
The canonical request is cent-based and Bearer-authenticated. The response gives you the buyer handoff URL plus the identifiers you should persist on your side.
curl -X POST "https://app.foxpay.it/api/payments/initialize" \
-H "Authorization: Bearer fp_live_example" \
-H "Content-Type: application/json" \
-d '{
"merchantId": "merchant_fxp_ABC12345",
"orderId": "order_1001",
"amountCents": 12345,
"currency": "EUR",
"customerEmail": "buyer@example.com",
"remittanceInfo": "ORDER-1001",
"returnUrl": "https://merchant.example/orders/order_1001/return"
}'
{
"success": true,
"paymentUrl": "https://app.foxpay.it/payment/order_1001?version=v2&transactionId=tx_123&source=custom_api",
"paymentId": "tx_123",
"orderId": "order_1001",
"merchantId": "merchant_fxp_ABC12345",
"amount": 12345,
"amountCents": 12345,
"currency": "EUR",
"customerEmail": "buyer@example.com",
"status": "pending",
"paymentMethod": "qr_pay",
"checkoutMode": "foxpay_checkout",
"remittanceInfo": "ORDER-1001",
"remittanceInfoSource": "merchant",
"testMode": false,
"returnUrl": "https://merchant.example/orders/order_1001/return"
}
How to read the init response
Initialization succeededHTTP 2xx with success: true, paymentId, and paymentUrl means Foxpay accepted the checkout handoff.
Payment is still pendingThe initial status is normally pending. That is expected and does not mean the buyer has paid.
Initialization failedHTTP 4xx or 5xx means no usable checkout handoff was created. Show a recoverable error and do not redirect the buyer.
Payment outcome arrives laterUse GET /payments/{paymentId}/status for checkout progress and signed webhooks for durable backend reconciliation.
Bank statement referenceSend remittanceInfo when you need a merchant-controlled SEPA remittance text. If omitted, Foxpay generates FP-{orderNumber}-{transactionSuffix}.