انتقل إلى المحتوى
واجهة الإنتاج · المراجعة اليدوية

مرجع الخادم الفعلي

واجهة يمكنك فحصها.

المسارات التالية مستخرجة من المتحكمات الحالية. تتبع مخططات الطلبات أدوات التحقق الحالية وتصف الردود التطبيق الفعلي، دون اختلاق واجهات مقدمي خدمة.

المصادقة وقواعد الطلبات

تستخدم حسابات المتصفح ملف ruya_session من نوع HttpOnly لمدة ثماني ساعات. يستخدم عملاء الواجهة ترويسة Bearer بمفتاح اختبار مجزأ ومقيد. تتطلب الإدارة دور ADMIN. احفظ المفاتيح على الخادم ولا تضمنها في موقع عام أو حزمة موبايل.

أرسل JSON لطلبات التعديل. إنشاء الطلبات والروابط يتطلب Idempotency-Key بحد أقصى ١٠٠ حرف. تغيير المدخلات مع نفس المفتاح يعيد 409. تبدأ صفحات المعاملات من ١ وتضم ٥٠ سجلاً. المبالغ أعداد صحيحة بوحدات الجنيه الصغرى.

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "status": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array"
        }
      },
      "required": [
        "message"
      ]
    },
    "requestId": {
      "type": "string"
    }
  },
  "required": [
    "error"
  ]
}

تشمل الأخطاء 400 للتحقق و401 للمصادقة و403 للصلاحية و404 للسجل و409 للتعارض و429 لحد الطلبات. قد يعيد محدد الطلبات نصاً بدلاً من JSON. نجاح POST يستخدم 201. نجاح طلب الباقة لا يعني نجاح تحصيل.

مرجع المسارات

٥٧ مساراً

POST/auth/register

الوصول المطلوب: Public

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "maxLength": 254,
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    },
    "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128
    },
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120
    }
  },
  "required": [
    "email",
    "password",
    "name"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "verified": {
          "type": "boolean"
        },
        "merchantId": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "email",
        "role",
        "verified",
        "merchantId"
      ]
    }
  },
  "required": [
    "user"
  ]
}
POST/auth/login

الوصول المطلوب: Public

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "maxLength": 254,
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    },
    "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128
    }
  },
  "required": [
    "email",
    "password"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "verified": {
          "type": "boolean"
        },
        "merchantId": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "email",
        "role",
        "verified",
        "merchantId"
      ]
    }
  },
  "required": [
    "user"
  ]
}
POST/auth/logout

الوصول المطلوب: Public

المعاملات

[]

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
POST/auth/forgot

الوصول المطلوب: Public

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    }
  },
  "required": [
    "email"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "required": [
    "message"
  ]
}
POST/auth/verify

الوصول المطلوب: Public

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "token": {
      "type": "string"
    }
  },
  "required": [
    "token"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
POST/auth/reset

الوصول المطلوب: Public

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "token": {
      "type": "string"
    },
    "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128
    }
  },
  "required": [
    "token",
    "password"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
GET/v1/me

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "merchant": {
      "$ref": "#/schemas/Merchant"
    },
    "subscription": {
      "$ref": "#/schemas/Subscription"
    },
    "payments": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Payment"
      }
    },
    "metrics": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer"
        },
        "succeeded": {
          "type": "integer"
        },
        "pending": {
          "type": "integer"
        },
        "volume": {
          "type": "integer"
        }
      },
      "required": [
        "total",
        "succeeded",
        "pending",
        "volume"
      ]
    },
    "scope": {
      "type": "string"
    }
  },
  "required": [
    "merchant",
    "subscription",
    "payments",
    "metrics",
    "scope"
  ]
}
GET/v1/transactions

الوصول المطلوب: payments:read

المعاملات

[
  {
    "name": "page",
    "in": "query",
    "required": false,
    "schema": {
      "type": "integer",
      "minimum": 1,
      "default": 1
    }
  }
]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Payment"
      }
    },
    "page": {
      "type": "integer"
    },
    "pageSize": {
      "const": 50
    }
  },
  "required": [
    "data",
    "page",
    "pageSize"
  ]
}
GET/v1/transactions/:id

الوصول المطلوب: payments:read

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "allOf": [
    {
      "$ref": "#/schemas/Payment"
    },
    {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/PaymentEvent"
          }
        }
      },
      "required": [
        "events"
      ]
    }
  ]
}
POST/v1/payment-intents

الوصول المطلوب: payments:write

المعاملات

[
  {
    "name": "Idempotency-Key",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string",
      "maxLength": 100
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "amount": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "currency": {
      "default": "EGP",
      "type": "string",
      "enum": [
        "EGP"
      ]
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 240
    },
    "expiresInMinutes": {
      "default": 60,
      "type": "integer",
      "minimum": 1,
      "maximum": 10080
    }
  },
  "required": [
    "amount",
    "description"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Payment"
}
GET/v1/payment-intents/:id

الوصول المطلوب: payments:read

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "allOf": [
    {
      "$ref": "#/schemas/Payment"
    },
    {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/PaymentEvent"
          }
        }
      },
      "required": [
        "events"
      ]
    }
  ]
}
POST/v1/payment-links

الوصول المطلوب: payments:write

المعاملات

[
  {
    "name": "Idempotency-Key",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string",
      "maxLength": 100
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "amount": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "currency": {
      "default": "EGP",
      "type": "string",
      "enum": [
        "EGP"
      ]
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 240
    },
    "expiresInMinutes": {
      "default": 60,
      "type": "integer",
      "minimum": 1,
      "maximum": 10080
    }
  },
  "required": [
    "amount",
    "description"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Payment"
}
GET/v1/payment-links/:id

الوصول المطلوب: payments:read

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "allOf": [
    {
      "$ref": "#/schemas/Payment"
    },
    {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/schemas/PaymentEvent"
          }
        }
      },
      "required": [
        "events"
      ]
    }
  ]
}
POST/v1/sandbox/:reference/simulate

الوصول المطلوب: payments:write

المعاملات

[
  {
    "name": "reference",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "SUCCEEDED",
        "FAILED",
        "CANCELLED",
        "PROCESSING"
      ]
    }
  },
  "required": [
    "status"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "duplicate": {
      "type": "boolean"
    }
  },
  "required": [
    "status"
  ]
}
POST/v1/refunds

الوصول المطلوب: refunds:write

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "paymentId",
    "amount"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Payment"
}
GET/v1/payment-methods

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط الرد · 200

{
  "type": "array",
  "items": {
    "$ref": "#/schemas/Provider"
  }
}
POST/v1/onboarding

الوصول المطلوب: OWNER

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contactName": {
      "type": "string",
      "minLength": 2
    },
    "phone": {
      "type": "string",
      "minLength": 7,
      "maxLength": 30
    },
    "country": {
      "type": "string",
      "enum": [
        "EG"
      ]
    },
    "businessType": {
      "type": "string",
      "minLength": 2
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "string",
          "const": ""
        }
      ]
    },
    "description": {
      "type": "string",
      "minLength": 10,
      "maxLength": 2000
    },
    "volume": {
      "type": "string",
      "minLength": 1
    },
    "methods": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "contactName",
    "phone",
    "country",
    "businessType",
    "website",
    "description",
    "volume",
    "methods"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Merchant"
}
POST/v1/api-keys

الوصول المطلوب: OWNER or ADMIN

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "scopes": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "payments:read",
          "payments:write",
          "refunds:write",
          "webhooks:write"
        ]
      }
    }
  },
  "required": [
    "scopes"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "key",
    "scopes"
  ]
}
GET/v1/api-keys

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط الرد · 200

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "prefix": {
        "type": "string"
      },
      "scopes": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "revoked": {
        "type": "boolean"
      },
      "createdAt": {
        "type": "string",
        "format": "date-time"
      }
    },
    "required": [
      "id",
      "prefix",
      "scopes",
      "revoked",
      "createdAt"
    ]
  }
}
DELETE/v1/api-keys/:id

الوصول المطلوب: OWNER

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
POST/v1/webhooks/endpoints

الوصول المطلوب: webhooks:write

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2000,
      "format": "starts_with",
      "pattern": "^https:\\/\\/.*"
    },
    "events": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "payment.created",
          "payment.succeeded",
          "payment.failed",
          "payment.cancelled",
          "payment.refunded",
          "payment.expired"
        ]
      }
    }
  },
  "required": [
    "url",
    "events"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "secret": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "url",
    "secret",
    "events"
  ]
}
GET/v1/webhooks

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط الرد · 200

{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "url": {
        "type": "string"
      },
      "events": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "deliveries": {
        "type": "array",
        "items": {
          "$ref": "#/schemas/Delivery"
        }
      }
    },
    "required": [
      "id",
      "url",
      "events",
      "deliveries"
    ]
  }
}
POST/v1/webhooks/:id/retry

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
GET/v1/subscription

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "subscription": {
      "$ref": "#/schemas/Subscription"
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Plan"
      }
    },
    "invoices": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/BillingInvoice"
      }
    }
  },
  "required": [
    "subscription",
    "plans",
    "invoices"
  ]
}
PATCH/v1/subscription

الوصول المطلوب: OWNER

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "cancelAtPeriodEnd": {
      "type": "boolean"
    }
  },
  "required": [
    "cancelAtPeriodEnd"
  ]
}

مخطط الرد · 200

{
  "$ref": "#/schemas/Subscription"
}
POST/v1/subscription/request

الوصول المطلوب: OWNER

المعاملات

[
  {
    "name": "Idempotency-Key",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string",
      "maxLength": 100
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "planId": {
      "type": "string"
    },
    "interval": {
      "type": "string",
      "enum": [
        "MONTHLY",
        "ANNUAL"
      ]
    }
  },
  "required": [
    "planId",
    "interval"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/BillingInvoice"
}
GET/v1/resources/:kind

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[
  {
    "name": "kind",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "type": "array",
  "items": {
    "$ref": "#/schemas/Resource"
  }
}
POST/v1/resources/customers

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "email": {
      "type": "string",
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    }
  },
  "required": [
    "name",
    "email"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Resource"
}
POST/v1/resources/support

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subject": {
      "type": "string",
      "minLength": 3,
      "maxLength": 200
    },
    "message": {
      "type": "string",
      "minLength": 10,
      "maxLength": 5000
    }
  },
  "required": [
    "subject",
    "message"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Resource"
}
POST/v1/invoices

الوصول المطلوب: payments:write + payments:read

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string"
    },
    "customerName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "customerEmail": {
      "type": "string",
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    }
  },
  "required": [
    "paymentId",
    "customerName",
    "customerEmail"
  ]
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Resource"
}
GET/v1/invoices/:id/pdf

الوصول المطلوب: payments:read

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "type": "string",
  "contentMediaType": "application/pdf"
}
GET/v1/reports

الوصول المطلوب: payments:read

المعاملات

[]

مخطط الرد · 200

{
  "type": "string",
  "contentMediaType": "text/csv"
}
GET/v1/audit

الوصول المطلوب: Authenticated merchant; API access varies by operation

المعاملات

[]

مخطط الرد · 200

{
  "type": "array",
  "items": {
    "$ref": "#/schemas/Audit"
  }
}
GET/public/checkout/:ref

الوصول المطلوب: Public

المعاملات

[
  {
    "name": "ref",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "reference": {
      "type": "string"
    },
    "merchant": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "amount": {
      "type": "integer"
    },
    "currency": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "mode": {
      "type": "string"
    },
    "methods": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status"
        ]
      }
    }
  },
  "required": [
    "reference",
    "merchant",
    "description",
    "amount",
    "currency",
    "status",
    "expiresAt",
    "mode",
    "methods"
  ]
}
GET/public/plans

الوصول المطلوب: Public

المعاملات

[]

مخطط الرد · 200

{
  "type": "array",
  "items": {
    "$ref": "#/schemas/Plan"
  }
}
POST/public/sandbox/callback

الوصول المطلوب: HMAC-SHA256 with server sandbox secret

المعاملات

[
  {
    "name": "X-Ruya-Signature",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "eventId": {
      "type": "string",
      "minLength": 16,
      "maxLength": 100
    },
    "reference": {
      "type": "string"
    },
    "merchantId": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "currency": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "SUCCEEDED",
        "FAILED",
        "CANCELLED",
        "PROCESSING"
      ]
    },
    "timestamp": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "eventId",
    "reference",
    "merchantId",
    "amount",
    "currency",
    "status",
    "timestamp"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "duplicate": {
      "type": "boolean"
    }
  },
  "required": [
    "status"
  ]
}
GET/admin/overview

الوصول المطلوب: ADMIN

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "mode": {
      "const": "SANDBOX"
    },
    "liveEnabled": {
      "const": false
    },
    "periodStart": {
      "type": "string",
      "format": "date-time"
    },
    "metrics": {
      "type": "object",
      "properties": {
        "merchants": {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer"
            },
            "active": {
              "type": "integer"
            },
            "pendingApplications": {
              "type": "integer"
            },
            "suspended": {
              "type": "integer"
            }
          },
          "required": [
            "total",
            "active",
            "pendingApplications",
            "suspended"
          ]
        },
        "payments": {
          "type": "object",
          "properties": {
            "totalLast30Days": {
              "type": "integer"
            },
            "paidLast30Days": {
              "type": "integer"
            },
            "pendingLast30Days": {
              "type": "integer"
            },
            "failedLast30Days": {
              "type": "integer"
            },
            "underReviewLast30Days": {
              "type": "integer"
            },
            "expiredLast30Days": {
              "type": "integer"
            },
            "sandboxReportedPaidAmountMinor": {
              "type": "integer"
            },
            "sandboxReportedRefundedAmountMinor": {
              "type": "integer"
            }
          },
          "required": [
            "totalLast30Days",
            "paidLast30Days",
            "pendingLast30Days",
            "failedLast30Days",
            "underReviewLast30Days",
            "expiredLast30Days",
            "sandboxReportedPaidAmountMinor",
            "sandboxReportedRefundedAmountMinor"
          ]
        },
        "paymentsAwaitingVerification": {
          "type": "integer"
        },
        "providers": {
          "type": "object",
          "properties": {
            "sandboxAdapters": {
              "type": "integer"
            }
          },
          "required": [
            "sandboxAdapters"
          ]
        },
        "webhooks": {
          "type": "object",
          "properties": {
            "attemptsLast30Days": {
              "type": "integer"
            },
            "failedLast30Days": {
              "type": "integer"
            }
          },
          "required": [
            "attemptsLast30Days",
            "failedLast30Days"
          ]
        },
        "financialOperations": {
          "type": "object",
          "properties": {
            "providerFeesMinor": {
              "type": [
                "integer",
                "null"
              ]
            },
            "platformFeesMinor": {
              "type": [
                "integer",
                "null"
              ]
            },
            "settledAmountMinor": {
              "type": [
                "integer",
                "null"
              ]
            },
            "status": {
              "type": "string"
            }
          },
          "required": [
            "providerFeesMinor",
            "platformFeesMinor",
            "settledAmountMinor",
            "status"
          ]
        }
      },
      "required": [
        "merchants",
        "payments",
        "paymentsAwaitingVerification",
        "providers",
        "webhooks",
        "financialOperations"
      ]
    },
    "merchants": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Merchant"
      }
    },
    "payments": {
      "type": "integer"
    },
    "audit": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Audit"
      }
    },
    "providers": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Provider"
      }
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Plan"
      }
    }
  },
  "required": [
    "mode",
    "liveEnabled",
    "periodStart",
    "metrics",
    "merchants",
    "payments",
    "audit",
    "providers",
    "plans"
  ]
}
GET/admin/transactions

الوصول المطلوب: ADMIN

المعاملات

[
  {
    "name": "q",
    "in": "query",
    "required": false,
    "schema": {
      "type": "string",
      "maxLength": 160
    }
  },
  {
    "name": "status",
    "in": "query",
    "required": false,
    "schema": {
      "type": "string",
      "enum": [
        "CREATED",
        "PENDING",
        "REQUIRES_ACTION",
        "PROCESSING",
        "PAID",
        "FAILED",
        "CANCELLED",
        "EXPIRED",
        "UNDER_REVIEW",
        "PARTIALLY_REFUNDED",
        "REFUNDED"
      ]
    }
  },
  {
    "name": "provider",
    "in": "query",
    "required": false,
    "schema": {
      "type": "string",
      "enum": [
        "sandbox",
        "paymob",
        "payvo",
        "kashier",
        "fawry",
        "bank-api"
      ]
    }
  },
  {
    "name": "mode",
    "in": "query",
    "required": false,
    "schema": {
      "type": "string",
      "enum": [
        "SANDBOX",
        "LIVE"
      ]
    }
  },
  {
    "name": "page",
    "in": "query",
    "required": false,
    "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1
    }
  }
]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "merchantId": {
            "type": "string"
          },
          "merchant": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          },
          "amount": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "canonicalStatus": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "providerTransactionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "reference",
          "merchantId",
          "merchant",
          "amount",
          "currency",
          "status",
          "canonicalStatus",
          "provider",
          "providerTransactionId",
          "mode",
          "createdAt"
        ]
      }
    },
    "page": {
      "type": "integer"
    },
    "pageSize": {
      "type": "integer"
    },
    "total": {
      "type": "integer"
    },
    "hasMore": {
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "page",
    "pageSize",
    "total",
    "hasMore"
  ]
}
PATCH/admin/merchants/:id

الوصول المطلوب: ADMIN

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "UNDER_REVIEW",
        "ADDITIONAL_INFORMATION_REQUIRED",
        "APPROVED",
        "REJECTED",
        "SUSPENDED"
      ]
    },
    "reason": {
      "type": "string",
      "minLength": 10,
      "maxLength": 1000
    }
  },
  "required": [
    "status",
    "reason"
  ]
}

مخطط الرد · 200

{
  "$ref": "#/schemas/Merchant"
}
PATCH/admin/plans/:id

الوصول المطلوب: ADMIN

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "monthly": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000000
    },
    "annual": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000000
    },
    "paymentLimit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "apiLimit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "teamLimit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "enabled": {
      "type": "boolean"
    },
    "defaultTrial": {
      "default": false,
      "type": "boolean"
    },
    "trialDays": {
      "default": 14,
      "type": "integer",
      "minimum": 0,
      "maximum": 90
    },
    "graceDays": {
      "default": 7,
      "type": "integer",
      "minimum": 0,
      "maximum": 30
    },
    "entitlements": {
      "default": {
        "api": true,
        "webhooks": true,
        "reports": true
      },
      "type": "object",
      "properties": {
        "api": {
          "default": true,
          "type": "boolean"
        },
        "webhooks": {
          "default": true,
          "type": "boolean"
        },
        "reports": {
          "default": true,
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "name",
    "monthly",
    "annual",
    "paymentLimit",
    "apiLimit",
    "teamLimit",
    "enabled"
  ],
  "additionalProperties": false
}

مخطط الرد · 200

{
  "$ref": "#/schemas/Plan"
}
POST/admin/plans/:id

الوصول المطلوب: ADMIN

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "monthly": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000000
    },
    "annual": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000000
    },
    "paymentLimit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "apiLimit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "teamLimit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 100000000
    },
    "enabled": {
      "type": "boolean"
    },
    "defaultTrial": {
      "default": false,
      "type": "boolean"
    },
    "trialDays": {
      "default": 14,
      "type": "integer",
      "minimum": 0,
      "maximum": 90
    },
    "graceDays": {
      "default": 7,
      "type": "integer",
      "minimum": 0,
      "maximum": 30
    },
    "entitlements": {
      "default": {
        "api": true,
        "webhooks": true,
        "reports": true
      },
      "type": "object",
      "properties": {
        "api": {
          "default": true,
          "type": "boolean"
        },
        "webhooks": {
          "default": true,
          "type": "boolean"
        },
        "reports": {
          "default": true,
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "name",
    "monthly",
    "annual",
    "paymentLimit",
    "apiLimit",
    "teamLimit",
    "enabled"
  ],
  "additionalProperties": false
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Plan"
}
GET/admin/billing

الوصول المطلوب: ADMIN

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "invoices": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/schemas/BillingInvoice"
          },
          {
            "type": "object",
            "properties": {
              "merchant": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            },
            "required": [
              "merchant"
            ]
          }
        ]
      }
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Plan"
      }
    },
    "total": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "pageSize": {
      "type": "integer"
    }
  },
  "required": [
    "invoices",
    "plans",
    "total",
    "page",
    "pageSize"
  ]
}
POST/admin/billing/:id/confirm

الوصول المطلوب: ADMIN

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "reference": {
      "type": "string",
      "minLength": 8,
      "maxLength": 150
    },
    "reason": {
      "type": "string",
      "minLength": 10,
      "maxLength": 1000
    }
  },
  "required": [
    "reference",
    "reason"
  ],
  "additionalProperties": false
}

مخطط الرد · 201

{
  "$ref": "#/schemas/BillingInvoice"
}
POST/auth/mobile/login

الوصول المطلوب: Public

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "maxLength": 254,
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    },
    "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128
    }
  },
  "required": [
    "email",
    "password"
  ]
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "verified": {
          "type": "boolean"
        },
        "merchantId": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "email",
        "role",
        "verified",
        "merchantId"
      ]
    },
    "sessionToken": {
      "type": "string"
    },
    "expiresIn": {
      "const": 28800
    }
  },
  "required": [
    "user",
    "sessionToken",
    "expiresIn"
  ]
}
POST/auth/mobile/logout

الوصول المطلوب: User session bearer token

المعاملات

[]

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
GET/v1/provider-connections

الوصول المطلوب: User session

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "providers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "capabilities": {
            "type": "object"
          }
        },
        "required": [
          "id",
          "active",
          "status",
          "capabilities"
        ]
      }
    },
    "connections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "merchantId": {
            "type": "string"
          },
          "providerId": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "merchantId",
          "providerId",
          "label",
          "status",
          "createdAt"
        ]
      }
    },
    "liveEnabled": {
      "const": false
    }
  },
  "required": [
    "providers",
    "connections",
    "liveEnabled"
  ]
}
POST/v1/provider-connections

الوصول المطلوب: OWNER

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "providerId": {
      "type": "string",
      "enum": [
        "paymob",
        "payvo",
        "kashier",
        "fawry",
        "bank-api"
      ]
    },
    "label": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120
    }
  },
  "required": [
    "providerId",
    "label"
  ],
  "additionalProperties": false
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "merchantId": {
      "type": "string"
    },
    "providerId": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "merchantId",
    "providerId",
    "label",
    "status",
    "createdAt"
  ]
}
GET/v1/payment-method-catalog

الوصول المطلوب: payments:read

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "methods": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "providerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "providerId",
          "currencies"
        ]
      }
    },
    "liveEnabled": {
      "const": false
    }
  },
  "required": [
    "methods",
    "liveEnabled"
  ]
}
GET/v1/verification/:id

الوصول المطلوب: payments:read

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string"
    },
    "canonicalStatus": {
      "type": "string"
    },
    "legacyStatus": {
      "type": "string"
    },
    "verificationStatus": {
      "type": "string"
    },
    "verifiedAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "providerId": {
      "type": "string"
    },
    "providerTransactionId": {
      "type": [
        "string",
        "null"
      ]
    },
    "mode": {
      "type": "string"
    },
    "history": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/schemas/PaymentEvent"
          },
          {
            "type": "object",
            "properties": {
              "canonicalStatus": {
                "type": "string"
              },
              "source": {
                "const": "sandbox"
              }
            },
            "required": [
              "canonicalStatus",
              "source"
            ]
          }
        ]
      }
    }
  },
  "required": [
    "paymentId",
    "canonicalStatus",
    "legacyStatus",
    "verificationStatus",
    "verifiedAt",
    "providerId",
    "providerTransactionId",
    "mode",
    "history"
  ]
}
GET/v1/pending-transfers

الوصول المطلوب: User session

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "sourceStatus": {
      "const": "NOT_CONFIGURED"
    },
    "reason": {
      "type": "string"
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Resource"
      }
    }
  },
  "required": [
    "sourceStatus",
    "reason",
    "data"
  ]
}
GET/v1/reconciliation

الوصول المطلوب: User session

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "sourceStatus": {
      "const": "NOT_CONFIGURED"
    },
    "scope": {
      "const": "INTERNAL_SANDBOX_ONLY"
    },
    "records": {
      "type": "array",
      "items": {
        "$ref": "#/schemas/Resource"
      }
    }
  },
  "required": [
    "sourceStatus",
    "scope",
    "records"
  ]
}
POST/v1/reconciliation

الوصول المطلوب: User session

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string"
    }
  },
  "required": [
    "paymentId"
  ],
  "additionalProperties": false
}

مخطط الرد · 201

{
  "$ref": "#/schemas/Resource"
}
GET/v1/devices

الوصول المطلوب: User session

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "pushConfigured": {
      "type": "boolean"
    },
    "devices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "platform",
          "active",
          "createdAt"
        ]
      }
    }
  },
  "required": [
    "pushConfigured",
    "devices"
  ]
}
POST/v1/devices

الوصول المطلوب: User session

المعاملات

[]

مخطط طلب JSON

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "maxLength": 300,
      "pattern": "^(ExponentPushToken|ExpoPushToken)\\[[A-Za-z0-9_-]+\\]$"
    },
    "platform": {
      "type": "string",
      "enum": [
        "ios",
        "android"
      ]
    }
  },
  "required": [
    "token",
    "platform"
  ],
  "additionalProperties": false
}

مخطط الرد · 201

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "active": {
      "type": "boolean"
    },
    "pushConfigured": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "active",
    "pushConfigured"
  ]
}
DELETE/v1/devices/:id

الوصول المطلوب: User session

المعاملات

[
  {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
      "type": "string"
    }
  }
]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    }
  },
  "required": [
    "ok"
  ]
}
GET/v1/events

الوصول المطلوب: payments:read

المعاملات

[]

مخطط الرد · 200

{
  "type": "string",
  "contentMediaType": "text/event-stream",
  "description": "SSE data contains type=heartbeat or payment.updated and tenant-scoped events [{id,status,paymentId,createdAt}]. Reconnect opens a recent one-minute window; refresh transaction details from the API."
}
GET/health

الوصول المطلوب: Public

المعاملات

[]

مخطط الرد · 200

{
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "database": {
      "type": "string"
    },
    "redis": {
      "type": "string"
    },
    "queue": {
      "type": "string"
    },
    "mode": {
      "const": "SANDBOX"
    },
    "liveEnabled": {
      "const": false
    }
  },
  "required": [
    "status",
    "database",
    "redis",
    "queue",
    "mode",
    "liveEnabled"
  ]
}

نماذج الردود

تشير المراجع مثل #/schemas/Payment إلى النماذج التالية. لا يُعرض أي رد نموذجي كمعاملة حقيقية.

Payment
{
  "allOf": [
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "reference": {
          "type": "string"
        },
        "merchantId": {
          "type": "string"
        },
        "amount": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "mode": {
          "const": "SANDBOX"
        },
        "provider": {
          "const": "sandbox"
        },
        "idempotencyKey": {
          "type": "string"
        },
        "requestHash": {
          "type": "string"
        },
        "refunded": {
          "type": "integer"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "reference",
        "merchantId",
        "amount",
        "currency",
        "description",
        "status",
        "mode",
        "provider",
        "idempotencyKey",
        "requestHash",
        "refunded",
        "expiresAt",
        "createdAt",
        "updatedAt"
      ]
    },
    {
      "type": "object",
      "properties": {
        "canonicalStatus": {
          "type": "string"
        },
        "paymentMethod": {
          "type": "string"
        },
        "providerTransactionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "verificationStatus": {
          "type": "string"
        },
        "verifiedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "canonicalStatus",
        "paymentMethod",
        "providerTransactionId",
        "verificationStatus",
        "verifiedAt"
      ]
    }
  ]
}
PaymentEvent
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "providerEventId": {
      "type": "string"
    },
    "paymentId": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "providerEventId",
    "paymentId",
    "status",
    "createdAt"
  ]
}
Merchant
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "onboarding": {
      "type": "object"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "name",
    "status",
    "onboarding",
    "createdAt"
  ]
}
Plan
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "monthly": {
      "type": "integer"
    },
    "annual": {
      "type": "integer"
    },
    "paymentLimit": {
      "type": "integer"
    },
    "apiLimit": {
      "type": "integer"
    },
    "teamLimit": {
      "type": "integer"
    },
    "enabled": {
      "type": "boolean"
    },
    "defaultTrial": {
      "type": "boolean"
    },
    "trialDays": {
      "type": "integer"
    },
    "graceDays": {
      "type": "integer"
    },
    "entitlements": {
      "type": "object"
    }
  },
  "required": [
    "id",
    "name",
    "monthly",
    "annual",
    "paymentLimit",
    "apiLimit",
    "teamLimit",
    "enabled",
    "defaultTrial",
    "trialDays",
    "graceDays",
    "entitlements"
  ]
}
Subscription
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "merchantId": {
      "type": "string"
    },
    "planId": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "interval": {
      "type": "string"
    },
    "trialEndsAt": {
      "type": "string",
      "format": "date-time"
    },
    "cancelAtPeriodEnd": {
      "type": "boolean"
    },
    "periodStart": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "periodEnd": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "graceEndsAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "merchantId",
    "planId",
    "status",
    "interval",
    "trialEndsAt",
    "cancelAtPeriodEnd",
    "periodStart",
    "periodEnd",
    "graceEndsAt",
    "updatedAt"
  ]
}
Resource
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "merchantId": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "reference": {
      "type": "string"
    },
    "data": {
      "type": "object"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "merchantId",
    "kind",
    "reference",
    "data",
    "createdAt"
  ]
}
BillingInvoice
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "merchantId": {
      "type": "string"
    },
    "planId": {
      "type": "string"
    },
    "interval": {
      "type": "string"
    },
    "amount": {
      "type": "integer"
    },
    "currency": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "planSnapshot": {
      "type": "object"
    },
    "idempotencyKey": {
      "type": "string"
    },
    "requestHash": {
      "type": "string"
    },
    "dueAt": {
      "type": "string",
      "format": "date-time"
    },
    "confirmedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "confirmationReference": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "merchantId",
    "planId",
    "interval",
    "amount",
    "currency",
    "status",
    "planSnapshot",
    "idempotencyKey",
    "requestHash",
    "dueAt",
    "confirmedAt",
    "confirmationReference",
    "createdAt"
  ]
}
Audit
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "merchantId": {
      "type": [
        "string",
        "null"
      ]
    },
    "actorId": {
      "type": "string"
    },
    "action": {
      "type": "string"
    },
    "target": {
      "type": "string"
    },
    "data": {
      "type": "object"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "merchantId",
    "actorId",
    "action",
    "target",
    "data",
    "createdAt"
  ]
}
Delivery
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "endpointId": {
      "type": "string"
    },
    "eventId": {
      "type": "string"
    },
    "payload": {
      "type": "object"
    },
    "status": {
      "type": "string"
    },
    "attempts": {
      "type": "integer"
    },
    "responseCode": {
      "type": [
        "integer",
        "null"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "nextAttempt": {
      "type": "string",
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "endpointId",
    "eventId",
    "payload",
    "status",
    "attempts",
    "responseCode",
    "error",
    "nextAttempt",
    "createdAt"
  ]
}
Provider
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "reason": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "name",
    "status",
    "capabilities",
    "reason"
  ]
}
Error
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "status": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array"
        }
      },
      "required": [
        "message"
      ]
    },
    "requestId": {
      "type": "string"
    }
  },
  "required": [
    "error"
  ]
}

تحقق من إشعارات التاجر

سجل عنوان HTTPS على المنفذ 443 واحفظ السر مرة واحدة. يرسل العامل معرفاً وطابعاً زمنياً بالمللي ثانية وتوقيعاً. احسب HMAC-SHA256 للسر والطابع الزمني ونقطة والجسم الخام وقارن بأمان وطبق نافذة زمنية قصيرة وامنع تكرار المعرف.

{
  "id": "<event-id>",
  "event": "payment.succeeded",
  "createdAt": "<ISO timestamp>",
  "data": {
    "reference": "<sandbox-reference>",
    "amount": "<integer minor units>",
    "currency": "EGP",
    "status": "SUCCEEDED",
    "mode": "SANDBOX"
  }
}

مثال هيكل فقط؛ تختلف بيانات الحدث. يتضمن الإنشاء المعرف والمرجع والحالة والوضع؛ ويتضمن التأكيد المرجع والمبلغ والعملة والحالة والوضع؛ والاسترداد المرجع ومبلغ الاسترداد والوضع؛ والانتهاء المرجع والوضع.

  • payment.created
  • payment.succeeded
  • payment.failed
  • payment.cancelled
  • payment.refunded
  • payment.expired

تستخدم الإشعارات طابور قاعدة البيانات والتأخير التصاعدي حتى ثماني محاولات. يمكن إعادة محاولة الفاشل مع التدقيق. قد يصل الحدث أكثر من مرة؛ يجب منع التكرار. العناوين الخاصة ومنافذ مخصصة والتحويلات وعناوين IPv6 فقط غير مدعومة.

للإشعار التجريبي الوارد عقد مختلف: توقيع HMAC للجسم الخام بسر الخادم داخل الترويسة؛ الطابع الزمني داخل JSON ونافذته خمس دقائق. يقبل أحداث المحاكاة فقط. لا تعرض سر الخادم للعملاء.