Payments
Keyed Payments
Use keyed payments for approved saved-payment-method flows without sending raw card data.
Server-sideTokenised methodNo raw card data
Create keyed payment
POST
/keyed-paymentsCreates a server-side payment using an existing neropay_payment_method_id.
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | decimal | Yes | Payment amount in major units. |
currency | string | Yes | Currency code. |
neropay_payment_method_id | string | Yes | Tokenised NeroPay payment method id. Raw card data is not accepted. |
description | string | Optional | Payment description. |
reference | string | Optional | Your order or invoice reference. |
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_keyed_123",
"status": "succeeded",
"amount": "10.00",
"currency": "GBP",
"transaction": {
"id": 6636600,
"status": "succeeded"
}
}
}
{
"success": false,
"error": {
"code": "resource_not_found",
"message": "The payment method was not found for this merchant.",
"details": null
}
}