Staging
split.pay

مرجع واجهة البرمجة

كل ما تحتاجه خوادمك لإنشاء مدفوعات مقسّمة وقراءة نتائجها واستقبال webhooks.

split.pay API · v0.1.0 · OpenAPI 3.1

تنزيل OpenAPI (JSON)

البدء

مفاتيح API والأوضاع

أنشئ المفاتيح من لوحة التاجر ضمن «المطورون». المفاتيح التي تبدأ بـ sp_test_ ترى بيانات الاختبار فقط ولا تحرّك أموالًا حقيقية، ومفاتيح sp_live_ تعمل على البيانات الفعلية. المفتاح هو من يحدد الوضع، فلا يوجد معامل للوضع في الطلبات. يظهر المفتاح مرة واحدة: احتفظ به على خادمك فقط.

المصادقة

أرسل المفتاح كرمز Bearer: Authorization: Bearer sp_test_… لكل مفتاح صلاحيات، وكل نقطة نهاية أدناه تذكر الصلاحية التي تحتاجها؛ والمفتاح الذي يفتقدها يحصل على 403 insufficient_scope.

عدم التكرار (Idempotency)

نقاط النهاية المعلَّمة بـ Idempotency-Key تتطلب هذا الترويس (من 8 إلى 255 محرفًا من الحروف والأرقام و . _ : -). تكرار الطلب بالمفتاح نفسه يعيد الاستجابة الأولى مع الترويس Idempotent-Replayed: true، أما المفتاح نفسه مع طلب مختلف فيُرفض بـ 409 idempotency_key_reused.

تقسيم الصفحات

تعيد القوائم data وnext_cursor. مرّر next_cursor في cursor للحصول على الصفحة التالية؛ وقيمة limit من 1 إلى 100.

رسوم المشتري ومن يتحملها

الحصة الأولى (position 1) لا تدفع رسوم معالجة، وكل حصة أخرى تضيف الرسم الثابت لكل عملة من GET /v1/processing-fees. مثال: 100.00 دولار مقسمة على 4 تعني أن الحصة 1 تدفع 25.00 وكل من الحصص 2 إلى 4 تدفع 25.30، فيدفع الدافعون 100.90 إجمالًا. الإجمالي الذي يدفعه الدافعون = amount + fee × (عدد المشاركين − 1). ضع المشتري (من يُنهي الدفع) أولًا ليحصل على الحصة المجانية. إذا كان الرسم الثابت الفعلي لمعالج الدفع أعلى فأنت تتحمل الفرق.

الأخطاء

الأخطاء بصيغة JSON: { "error": { "type", "code", "message", "request_id", "details" } }. اعتمد في شيفرتك على حالة HTTP وعلى code، لا على message. اذكر request_id عند التواصل مع الدعم.

حدود الطلبات

600 طلب في الدقيقة لكل مفتاح API، و3000 في الدقيقة لكل عنوان IP. عند تجاوز الحد تحصل على 429 rate_limited؛ انتظر عدد الثواني الموجود في الترويس Retry-After.

Webhooks والتوقيعات

أنشئ نقطة نهاية عبر POST /v1/webhook-endpoints واحتفظ بسرّ التوقيع الخاص بها. يحمل كل تسليم الترويس Splitpay-Signature: t=<ثوانٍ يونكس>,v1=<HMAC-SHA256 بصيغة hex لـ "t.body" بالسرّ>، محسوبًا على جسم الطلب الخام. ارفض الطلب إذا لم يطابق أي v1 أو إذا اختلف t عن ساعتك بأكثر من 5 دقائق. التسليم مرة واحدة على الأقل: تخلّص من التكرار بمعرّف الحدث.

اللحاق بعد التوقف

يعيد GET /v1/events الأظرف نفسها التي استقبلتها نقطة نهايتك. بعد التوقف اعرض الأحداث المنشأة منذ انقطاعك (created_from) وتجاهل المعرّفات التي عالجتها. تُحفظ الأحداث لمدة 90 يومًا.

Checkout SDK

يفتح Checkout SDK صفحة الدفع في نافذة منبثقة فوق موقعك، فلا يغادر العميل موقعك. حمّل السكربت من أصل صفحة الدفع في split.pay ومرّر payment_url لجلسة جديدة إلى SplitPay.open. السكربت بلا تبعيات ولا يضع ملفات تعريف ارتباط ولا يتتبع شيئًا.

<script src="https://pay.example.com/sdk/v1/splitpay.js"></script>
<script>
  // payment_url comes from POST /v1/split-sessions, created on your server.
  const checkout = SplitPay.open(paymentUrl, {
    onEvent: ({ type, state }) => {
      if (type === 'session_paid') showOrderStatus(); // a hint: your server confirms
    },
    onClose: ({ reason }) => showOrderStatus(), // reason: 'closed' | 'blocked'
    fallback: 'redirect', // or 'none'
  });
  // checkout.close(), checkout.focus(), checkout.closed
</script>

يستقبل onEvent القيمة { type, state } (state هي الحالة العامة للجلسة). الأنواع:

  • share_authorized — أذن العميل بحصته.
  • session_authorized — أُذن بجميع الحصص.
  • session_paid — تم دفع الجلسة.
  • session_cancelled — أُلغيت الجلسة.
  • session_expired — انتهت صلاحية الجلسة.
  • return — ضغط العميل زر العودة إلى التاجر، قبيل المغادرة.
  • cancel — ضغط العميل على إلغاء، قبيل المغادرة.

إذا حجب المتصفح النافذة المنبثقة يُعاد توجيه التبويب إلى صفحة الدفع (fallback "redirect"، وهو الافتراضي). مع fallback "none" يُستدعى onClose بالسبب "blocked" لتعرض زرًا بدلًا من ذلك. ويُستدعى onClose مرة واحدة أيضًا عند إغلاق النافذة. يرمي SplitPay.open خطأ TypeError إذا لم يكن الرابط على أصل السكربت. لا تُرسل الرسائل إلا إذا كان للجلسة return_url أو cancel_url، وإلى أصل ذلك الرابط فقط.

هذه الأحداث تلميحات لصفحتك فقط. تأكد دائمًا من النتيجة على خادمك: اقرأ الجلسة عبر GET /v1/split-sessions/{id}، أو اعتمد على webhooks وسجل الأحداث.

نقاط النهاية

Split sessions

One bill paid by several people.

POST/v1/split-sessions

Create a split session

Creates a split session and its payment link. Share payment_url with the people who pay.

الصلاحية: split_sessions:write

المعاملات
الاسمالموضعالنوعمطلوبالوصف
Idempotency-KeyheaderstringنعمMakes the request safe to repeat: the same key returns the first response (header Idempotent-Replayed: true). The same key with a different request is refused with 409 idempotency_key_reused.
جسم الطلب
الاسمالنوعمطلوبالوصف
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
participantsinteger | array<object>لا
الحقول
الاسمالنوعمطلوبالوصف
#1array<object>لا
الحقول
الاسمالنوعمطلوبالوصف
amountintegerنعمmin > 0, max 999999999999
labelstringلاmin length 1, max length 60
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
referencestringنعمmin length 1, max length 100
descriptionstringلاmin length 1, max length 200
return_urlstringلاmax length 2048
cancel_urlstringلاmax length 2048
expires_inintegerلاmin 600, max 518400
الاستجابة 201
الاسمالنوعمطلوبالوصف
split_sessionobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991
total_chargedintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
participantsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
positionintegerنعمmin 1, max 9007199254740991
labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
amount_chargedintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
feesobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
policy_versionstringنعم
application_fee_totalintegerنعمmin 0, max 9007199254740991
payment_urlstringنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
amount_refundedintegerنعمmin 0, max 9007199254740991

GET/v1/split-sessions

List split sessions

Newest first. The key decides the mode.

الصلاحية: split_sessions:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
limitqueryintegerلاmin 1, max 100, default 25
cursorquerystring (uuid)لا
statequeryenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedلا
referencequerystringلاmin length 1, max length 100
created_fromquerystring (date-time)لا
created_toquerystring (date-time)لا
الاستجابة 200
الاسمالنوعمطلوبالوصف
dataarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
participant_countintegerنعمmin 0, max 9007199254740991
participants_summaryobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
countsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
countintegerنعمmin 1, max 9007199254740991
itemsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
labelstring | nullنعم
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
sourceenum: merchant_api | merchant_dashboardنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
next_cursorstring | nullنعم

GET/v1/split-sessions/{split_session_id}

Retrieve a split session

الصلاحية: split_sessions:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
split_session_idpathstring (uuid)نعم
الاستجابة 200
الاسمالنوعمطلوبالوصف
split_sessionobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991
total_chargedintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
participantsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
positionintegerنعمmin 1, max 9007199254740991
labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
amount_chargedintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
feesobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
policy_versionstringنعم
application_fee_totalintegerنعمmin 0, max 9007199254740991
payment_urlstringنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
amount_refundedintegerنعمmin 0, max 9007199254740991

POST/v1/split-sessions/{split_session_id}/cancel

Cancel a split session

Releases the card holds of a session that is not yet paid.

الصلاحية: split_sessions:write

المعاملات
الاسمالموضعالنوعمطلوبالوصف
split_session_idpathstring (uuid)نعم
Idempotency-KeyheaderstringنعمMakes the request safe to repeat: the same key returns the first response (header Idempotent-Replayed: true). The same key with a different request is refused with 409 idempotency_key_reused.
الاستجابة 200
الاسمالنوعمطلوبالوصف
split_sessionobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991
total_chargedintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
participantsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
positionintegerنعمmin 1, max 9007199254740991
labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
amount_chargedintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
feesobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
policy_versionstringنعم
application_fee_totalintegerنعمmin 0, max 9007199254740991
payment_urlstringنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
amount_refundedintegerنعمmin 0, max 9007199254740991

Refunds

Return money to the participants of a paid order.

POST/v1/orders/{order_id}/refunds

Refund an order

Without an amount, the whole remaining refundable amount is refunded.

الصلاحية: refunds:write

المعاملات
الاسمالموضعالنوعمطلوبالوصف
order_idpathstring (uuid)نعم
Idempotency-KeyheaderstringنعمMakes the request safe to repeat: the same key returns the first response (header Idempotent-Replayed: true). The same key with a different request is refused with 409 idempotency_key_reused.
جسم الطلب
الاسمالنوعمطلوبالوصف
amountintegerلاmin > 0, max 999999999999
reasonenum: requested_by_customer | duplicate | fraudulent | otherلا
الاستجابة 201
الاسمالنوعمطلوبالوصف
refundobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"refund"نعم
order_idstring (uuid)نعم
split_session_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
reasonenum: requested_by_customer | duplicate | fraudulent | other | nullنعم
statusenum: pending | processing | succeeded | partially_succeeded | failedنعم
allocationsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
participant_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
statusenum: pending | processing | succeeded | failedنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم

GET/v1/refunds/{refund_id}

Retrieve a refund

الصلاحية: refunds:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
refund_idpathstring (uuid)نعم
الاستجابة 200
الاسمالنوعمطلوبالوصف
refundobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"refund"نعم
order_idstring (uuid)نعم
split_session_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
reasonenum: requested_by_customer | duplicate | fraudulent | other | nullنعم
statusenum: pending | processing | succeeded | partially_succeeded | failedنعم
allocationsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
participant_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
statusenum: pending | processing | succeeded | failedنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم

GET/v1/refunds

List refunds

Newest first. The key decides the mode.

الصلاحية: refunds:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
limitqueryintegerلاmin 1, max 100, default 25
cursorquerystring (uuid)لا
statusqueryenum: pending | processing | succeeded | partially_succeeded | failedلا
referencequerystringلاmin length 1, max length 100
created_fromquerystring (date-time)لا
created_toquerystring (date-time)لا
الاستجابة 200
الاسمالنوعمطلوبالوصف
dataarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"refund"نعم
order_idstring (uuid)نعم
split_session_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
reasonenum: requested_by_customer | duplicate | fraudulent | other | nullنعم
statusenum: pending | processing | succeeded | partially_succeeded | failedنعم
allocationsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
participant_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
statusenum: pending | processing | succeeded | failedنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
settled_amountinteger | nullنعم
settled_currencystring | nullنعم
next_cursorstring | nullنعم

Payments

The individual payments of your split sessions.

GET/v1/payments

List payments

Newest first. The key decides the mode.

الصلاحية: payments:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
limitqueryintegerلاmin 1, max 100, default 25
cursorquerystring (uuid)لا
statequeryenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedلا
referencequerystringلاmin length 1, max length 100
created_fromquerystring (date-time)لا
created_toquerystring (date-time)لا
الاستجابة 200
الاسمالنوعمطلوبالوصف
dataarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"payment"نعم
split_session_idstring (uuid)نعم
order_idstring (uuid)نعم
order_referencestringنعم
participant_idstring (uuid)نعم
participant_labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
presentment_amountinteger | nullنعم
presentment_currencystring | nullنعم
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
settled_amountinteger | nullنعم
settled_currencystring | nullنعم
refunded_settledinteger | nullنعم
fees_totalinteger | nullنعم
netinteger | nullنعم
fees_currencystring | nullنعم
gateway_feeinteger | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
next_cursorstring | nullنعم

GET/v1/payments/{payment_id}

Retrieve a payment

الصلاحية: payments:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
payment_idpathstring (uuid)نعم
الاستجابة 200
الاسمالنوعمطلوبالوصف
paymentobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"payment"نعم
split_session_idstring (uuid)نعم
order_idstring (uuid)نعم
order_referencestringنعم
participant_idstring (uuid)نعم
participant_labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
presentment_amountinteger | nullنعم
presentment_currencystring | nullنعم
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
settled_amountinteger | nullنعم
settled_currencystring | nullنعم
refunded_settledinteger | nullنعم
fees_totalinteger | nullنعم
netinteger | nullنعم
fees_currencystring | nullنعم
gateway_feeinteger | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم

Events

The events behind your webhooks, to catch up after downtime.

GET/v1/events

List events

Each event is the envelope a webhook endpoint received. Use it to catch up after downtime.

الصلاحية: events:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
limitqueryintegerلاmin 1, max 100, default 25
cursorquerystring (uuid)لا
typequeryenum: split_session.paid | split_session.failed | split_session.cancelled | split_session.expired | refund.succeeded | refund.partially_succeeded | refund.failed | dispute.created | dispute.updated | dispute.closedلا
created_fromquerystring (date-time)لا
created_toquerystring (date-time)لا
الاستجابة 200
الاسمالنوعمطلوبالوصف
dataarray<object | object | object>نعم
الحقول
الاسمالنوعمطلوبالوصف
#1objectلا
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: split_session.paid | split_session.failed | split_session.cancelled | split_session.expiredنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991
total_chargedintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
participantsarray<object>نعم
feesobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
policy_versionstringنعم
application_fee_totalintegerنعمmin 0, max 9007199254740991
payment_urlstringنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
amount_refundedintegerنعمmin 0, max 9007199254740991
#2objectلا
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: refund.succeeded | refund.partially_succeeded | refund.failedنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"refund"نعم
order_idstring (uuid)نعم
split_session_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
reasonenum: requested_by_customer | duplicate | fraudulent | other | nullنعم
statusenum: pending | processing | succeeded | partially_succeeded | failedنعم
allocationsarray<object>نعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
#3objectلا
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: dispute.created | dispute.updated | dispute.closedنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"dispute"نعم
payment_idstring (uuid) | nullنعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
statusenum: needs_response | under_review | won | lost | closedنعم
reasonenum: fraudulent | duplicate | product_not_received | product_unacceptable | credit_not_processed | subscription_canceled | unrecognized | processing_error | generalنعم
evidence_due_bystring (date-time) | nullنعم
created_atstring (date-time)نعم
next_cursorstring | nullنعم

GET/v1/events/{event_id}

Retrieve an event

الصلاحية: events:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
event_idpathstring (uuid)نعم
الاستجابة 200
الاسمالنوعمطلوبالوصف
#1objectلا
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: split_session.paid | split_session.failed | split_session.cancelled | split_session.expiredنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991
total_chargedintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
participantsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
positionintegerنعمmin 1, max 9007199254740991
labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
amount_chargedintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
feesobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
policy_versionstringنعم
application_fee_totalintegerنعمmin 0, max 9007199254740991
payment_urlstringنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
amount_refundedintegerنعمmin 0, max 9007199254740991
#2objectلا
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: refund.succeeded | refund.partially_succeeded | refund.failedنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"refund"نعم
order_idstring (uuid)نعم
split_session_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
reasonenum: requested_by_customer | duplicate | fraudulent | other | nullنعم
statusenum: pending | processing | succeeded | partially_succeeded | failedنعم
allocationsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
participant_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
statusenum: pending | processing | succeeded | failedنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
#3objectلا
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: dispute.created | dispute.updated | dispute.closedنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"dispute"نعم
payment_idstring (uuid) | nullنعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
statusenum: needs_response | under_review | won | lost | closedنعم
reasonenum: fraudulent | duplicate | product_not_received | product_unacceptable | credit_not_processed | subscription_canceled | unrecognized | processing_error | generalنعم
evidence_due_bystring (date-time) | nullنعم
created_atstring (date-time)نعم

Reports

CSV downloads.

GET/v1/reports/payments.csv

Download the payments report

UTF-8 CSV with a header row; at most 25 months per download.

الصلاحية: reports:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
fromquerystring (date-time)نعم
toquerystring (date-time)نعم
tzquerystringنعمmin length 1, max length 64
الاستجابة 200

ملف CSV بترميز UTF-8.

GET/v1/reports/refunds.csv

Download the refunds report

UTF-8 CSV with a header row; at most 25 months per download.

الصلاحية: reports:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
fromquerystring (date-time)نعم
toquerystring (date-time)نعم
tzquerystringنعمmin length 1, max length 64
الاستجابة 200

ملف CSV بترميز UTF-8.

GET/v1/reports/split-sessions.csv

Download the split sessions report

UTF-8 CSV with a header row; at most 25 months per download.

الصلاحية: reports:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
fromquerystring (date-time)نعم
toquerystring (date-time)نعم
tzquerystringنعمmin length 1, max length 64
الاستجابة 200

ملف CSV بترميز UTF-8.

Webhook endpoints

Where split.pay delivers your events.

POST/v1/webhook-endpoints

Create a webhook endpoint

The signing secret is returned only here and when it is rotated.

الصلاحية: webhook_endpoints:write

جسم الطلب
الاسمالنوعمطلوبالوصف
urlstringنعمmax length 2048
enabled_eventsarray<any> | array<enum: split_session.paid | split_session.failed | split_session.cancelled | split_session.expired | refund.succeeded | refund.partially_succeeded | refund.failed | dispute.created | dispute.updated | dispute.closed>نعم
descriptionstringلاmin length 1, max length 200
الاستجابة 201
الاسمالنوعمطلوبالوصف
webhook_endpointobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"webhook_endpoint"نعم
urlstringنعم
enabled_eventsarray<string>نعم
statusenum: enabled | disabledنعم
descriptionstring | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
secretstringنعم

GET/v1/webhook-endpoints

List webhook endpoints

الصلاحية: webhook_endpoints:read

الاستجابة 200
الاسمالنوعمطلوبالوصف
dataarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"webhook_endpoint"نعم
urlstringنعم
enabled_eventsarray<string>نعم
statusenum: enabled | disabledنعم
descriptionstring | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
next_cursorstring | nullنعم

GET/v1/webhook-endpoints/{webhook_endpoint_id}

Retrieve a webhook endpoint

الصلاحية: webhook_endpoints:read

المعاملات
الاسمالموضعالنوعمطلوبالوصف
webhook_endpoint_idpathstring (uuid)نعم
الاستجابة 200
الاسمالنوعمطلوبالوصف
webhook_endpointobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"webhook_endpoint"نعم
urlstringنعم
enabled_eventsarray<string>نعم
statusenum: enabled | disabledنعم
descriptionstring | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم

PATCH/v1/webhook-endpoints/{webhook_endpoint_id}

Update a webhook endpoint

الصلاحية: webhook_endpoints:write

المعاملات
الاسمالموضعالنوعمطلوبالوصف
webhook_endpoint_idpathstring (uuid)نعم
جسم الطلب
الاسمالنوعمطلوبالوصف
urlstringلاmax length 2048
enabled_eventsarray<any> | array<enum: split_session.paid | split_session.failed | split_session.cancelled | split_session.expired | refund.succeeded | refund.partially_succeeded | refund.failed | dispute.created | dispute.updated | dispute.closed>لا
statusenum: enabled | disabledلا
descriptionstring | nullلا
الاستجابة 200
الاسمالنوعمطلوبالوصف
webhook_endpointobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"webhook_endpoint"نعم
urlstringنعم
enabled_eventsarray<string>نعم
statusenum: enabled | disabledنعم
descriptionstring | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم

DELETE/v1/webhook-endpoints/{webhook_endpoint_id}

Delete a webhook endpoint

Past deliveries stay available for history.

الصلاحية: webhook_endpoints:write

المعاملات
الاسمالموضعالنوعمطلوبالوصف
webhook_endpoint_idpathstring (uuid)نعم
الاستجابة 204

بلا جسم.

POST/v1/webhook-endpoints/{webhook_endpoint_id}/rotate-secret

Rotate the signing secret

Returns the new secret once. The previous secret keeps signing for 24 hours, so deliveries made in that window carry two signatures.

الصلاحية: webhook_endpoints:write

المعاملات
الاسمالموضعالنوعمطلوبالوصف
webhook_endpoint_idpathstring (uuid)نعم
الاستجابة 200
الاسمالنوعمطلوبالوصف
webhook_endpointobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"webhook_endpoint"نعم
urlstringنعم
enabled_eventsarray<string>نعم
statusenum: enabled | disabledنعم
descriptionstring | nullنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
secretstringنعم

Reference data

Currencies and split.pay fees.

GET/v1/processing-fees

List the split.pay fee per share

The fixed fee per share, for each currency. Share #1 pays no fee; every other share adds it, so the total the payers pay is amount + fee × (participants − 1).

الصلاحية: split_sessions:read

الاستجابة 200
الاسمالنوعمطلوبالوصف
processing_feesarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
currencystringنعمpattern ^[A-Z]{3}$
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991

GET/v1/currencies

List supported currencies

Public: no API key needed.

لا يلزم مفتاح API

الاستجابة 200
الاسمالنوعمطلوبالوصف
currenciesarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
codestringنعمpattern ^[A-Z]{3}$
exponentintegerنعمmin 0, max 3
processing_fee_per_shareinteger | nullنعم

أحداث webhook

  • split_session.paid — The session was paid in full.
  • split_session.failed — The session failed after authorisation and its payments were reversed.
  • split_session.cancelled — The session was cancelled.
  • split_session.expired — The session expired before everyone paid.
المحتوى
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: split_session.paid | split_session.failed | split_session.cancelled | split_session.expiredنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
stateenum: created | collecting | all_authorized | capturing | paid | expiring | expired | cancelling | cancelled | capture_partial_failure | compensating | failed_reversedنعم
split_modeenum: merchant_defined | payer_definedنعم
amountintegerنعمmin > 0, max 999999999999
processing_fee_per_shareintegerنعمmin 0, max 9007199254740991
total_chargedintegerنعمmin 0, max 9007199254740991
currencystringنعمpattern ^[A-Z]{3}$
orderobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
referencestringنعم
descriptionstring | nullنعم
participantsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
positionintegerنعمmin 1, max 9007199254740991
labelstring | nullنعم
amountintegerنعمmin > 0, max 999999999999
amount_chargedintegerنعمmin > 0, max 999999999999
application_fee_amountintegerنعمmin 0, max 9007199254740991
stateenum: created | waiting_for_payment_method | confirming | requires_action | authorized | capturing | captured | cancelling | cancelled | failed | refunding | partially_refunded | refundedنعم
amount_refundedintegerنعمmin 0, max 9007199254740991
feesobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
policy_versionstringنعم
application_fee_totalintegerنعمmin 0, max 9007199254740991
payment_urlstringنعم
expires_atstring (date-time)نعم
created_atstring (date-time)نعم
amount_refundedintegerنعمmin 0, max 9007199254740991
  • refund.succeeded — A refund completed.
  • refund.partially_succeeded — A refund completed for some participants only.
  • refund.failed — A refund failed.
المحتوى
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: refund.succeeded | refund.partially_succeeded | refund.failedنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"refund"نعم
order_idstring (uuid)نعم
split_session_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
reasonenum: requested_by_customer | duplicate | fraudulent | other | nullنعم
statusenum: pending | processing | succeeded | partially_succeeded | failedنعم
allocationsarray<object>نعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
participant_idstring (uuid)نعم
amountintegerنعمmin > 0, max 999999999999
statusenum: pending | processing | succeeded | failedنعم
created_atstring (date-time)نعم
updated_atstring (date-time)نعم
  • dispute.created — A customer opened a dispute.
  • dispute.updated — A dispute changed.
  • dispute.closed — A dispute was closed.
المحتوى
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"event"نعم
created_atstring (date-time)نعم
livemodebooleanنعم
typeenum: dispute.created | dispute.updated | dispute.closedنعم
dataobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
objectobjectنعم
الحقول
الاسمالنوعمطلوبالوصف
idstring (uuid)نعم
object"dispute"نعم
payment_idstring (uuid) | nullنعم
amountintegerنعمmin > 0, max 999999999999
currencystringنعمpattern ^[A-Z]{3}$
statusenum: needs_response | under_review | won | lost | closedنعم
reasonenum: fraudulent | duplicate | product_not_received | product_unacceptable | credit_not_processed | subscription_canceled | unrecognized | processing_error | generalنعم
evidence_due_bystring (date-time) | nullنعم
created_atstring (date-time)نعم