العودة للمرجع
POST/webhooks/{provider}
Provider webhooks

استقبال Webhook من مزود

Webhook وارد للمزود؛ يجب توقيع الحمولة وإرسال الوقت ومعرف حدث ثابت.

مستوى الوصولprovider_onlyالحدpay_apiمنع التكرارprovider event idالمصادقةWebhookSignature + WebhookTimestamp
المصدرLuxApi/Modules/PayWebhooks/Controllers/WebhookController.php::handleLuxPayProjects @ 146e98baa44e

المعاملات

X-Request-IDheader
stringاختياري

Client correlation identifier. LuxPay may generate one when omitted.

Example: req_01J...
providerpath
stringإلزامي

Provider code registered by LuxPay.

Example: wallet
X-Signatureheader
stringإلزامي

Provider signature.

X-Timestampheader
integerإلزامي

Unix timestamp used for replay protection.

X-Provider-Event-Idheader
stringاختياري

Stable event identifier for deduplication.

جسم الطلب

ProviderWebhookPayloadإلزامي
{
  "type": "object",
  "description": "Provider-specific event payload. LuxPay verifies the signature before queueing the event.",
  "additionalProperties": true,
  "example": {
    "event_id": "evt_01JABC",
    "type": "payment.completed",
    "data": {
      "id": "provider_tx_123",
      "status": "completed"
    }
  }
}

JSON example

{
  "event_id": "evt_01JABC",
  "type": "payment.completed",
  "data": {
    "id": "provider_tx_123",
    "status": "completed"
  }
}

أمثلة الكود

العنوان المعروض Sandbox Placeholder حتى يتم تزويد النطاق الرسمي. لا تلصق رمز Production في متصفح عام.
curl --request POST \
  --url 'https://sandbox-api.luxpay.example/v1/webhooks/wallet' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "event_id": "evt_01JABC",
  "type": "payment.completed",
  "data": {
    "id": "provider_tx_123",
    "status": "completed"
  }
}'

الاستجابات

200Successful response.
status
string
Allowed: accepted, rejected
duplicate
boolean
{
  "status": "accepted",
  "duplicate": false
}
400
401
403Signature or timestamp verification failed.
status
string
Allowed: accepted, rejected
duplicate
boolean
{
  "status": "accepted",
  "duplicate": false
}
404
409
422
429
500
OpenAPI JSONOpenAPI YAMLPostman collection