Payments
Hosted Payments
Use hosted payments for simple server-side checkout integrations.
Checkout URLWebhooksRedirects
Create hosted payment
POST
/paymentsCreates a hosted checkout payment and returns a checkout URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | Unique reference in your system, for example order id. |
currency | string | Yes | Currency code. |
amount | decimal | Yes | Payment amount in major units. |
details | string | Yes | Description of products or service. |
ipn_url | url string | Yes | Webhook URL for server-to-server payment updates. |
success_url | url string | Yes | Customer redirect after successful payment. |
cancel_url | url string | Yes | Customer redirect after cancellation. |
customer_name | string | Yes | Customer full name. |
customer_email | email string | Yes | Customer email. |
customer_phone | string | Optional | Customer phone. |
connect_application_fee | decimal | Optional | NeroConnect platform fee where applicable. |
'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $secretKey,
'Accept: application/json',
'Content-Type: application/json',
'X-NeroPay-Timestamp: ' . $timestamp,
'X-NeroPay-Signature: ' . $signature,
'Idempotency-Key: ' . bin2hex(random_bytes(16)),
],
CURLOPT_POSTFIELDS => $rawBody,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $response;
{
"success": true,
"data": {
"id": "pay_nero_123",
"identifier": "ORDER-1001",
"status": "pending",
"checkout_url": "https://eu.neropay.app/checkout/pay_nero_123",
"transaction": {
"id": 6636598,
"status": "pending"
}
}
}
When to use hosted payments
Hosted payments are best when you want NeroPay to handle the checkout page. Your site creates the payment, redirects the customer and waits for webhook confirmation.
{
"success": false,
"error": {
"code": "validation_failed",
"message": "The success_url field must be a valid URL.",
"details": {
"amount": [
"The amount field is required."
]
}
}
}