NeroPay Docs
API & Integrations

Hosted Payments

Payments

Hosted Payments

Use hosted payments for simple server-side checkout integrations.

Checkout URLWebhooksRedirects

Create hosted payment

POST/payments

Creates a hosted checkout payment and returns a checkout URL.

ParameterTypeRequiredDescription
identifierstringYesUnique reference in your system, for example order id.
currencystringYesCurrency code.
amountdecimalYesPayment amount in major units.
detailsstringYesDescription of products or service.
ipn_urlurl stringYesWebhook URL for server-to-server payment updates.
success_urlurl stringYesCustomer redirect after successful payment.
cancel_urlurl stringYesCustomer redirect after cancellation.
customer_namestringYesCustomer full name.
customer_emailemail stringYesCustomer email.
customer_phonestringOptionalCustomer phone.
connect_application_feedecimalOptionalNeroConnect 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."
      ]
    }
  }
}