مرجع عام

Card Batches

كل نقاط النهاية في هذه المجموعة. افتح أي واحدة لعرض معاملاتها ومثال عملي عليها.

28 نقاط النهاية

اعرض الصفحة بصيغة Markdown

Card Batches

28
GET /api/v1/card-batches List card series prm_cards_list

One page of card series with their stock breakdown. A non-admin caller sees only series created within their own manager subtree.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_list View card batches & cards

Never derive stock by subtraction. used excludes both unused and revoked, so quantity minus used is not the unused count, and quantity itself grows when the point of sale mints into the series. available is the sellable stock. stuck_sale is a warning, not a bucket: it counts cards held by a till sale that never completed, and there is no reaper for it.

المعاملات

المعامل الوصف
filter[status] query · string Generation status — generating, ready, failed.
filter[card_mode] query · string The series mode.
filter[owner_manager_id] query · integer The reseller holding the series after any transfer.
filter[suspended] query · boolean Series whose unused cards have been revoked.
filter[template_id] query · integer Series cut from one saved card template.
q query · string Plan name, distribution note, or series id.
الاستجابة 200 OK
{
  "data": [
    {
      "id": 208,
      "plan_id": 7,
      "plan_name": "Home 20M",
      "card_mode": "voucher_account",
      "quantity": 500,
      "face_value": 150.00,
      "code_length": 10,
      "code_charset": "alnum_no_ambig",
      "status": "ready",
      "suspended": false,
      "processed": 500,
      "used": 312,
      "available": 171,
      "sold_online": 9,
      "sold_counter": 8,
      "stuck_sale": 0,
      "expiration": "2027-01-01 00:00:00",
      "printed_at": "2026-08-30 12:01:44",
      "print_count": 1,
      "pdf_ready": true,
      "has_cards": true,
      "owner_manager_id": 41,
      "sell_online": false,
      "auto_activate": false,
      "created_by": 41
    }
  ],
  "meta": { "page": 1, "page_size": 50, "total": 24, "has_next": false }
}
POST /api/v1/card-batches Generate a card series prm_cards_generate_user

Stages an asynchronous generation job and returns immediately. The cards and the printable artifact are produced in the background; poll the series until status is ready, then fetch the print job.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_generate_user Generate user cards
حد المعدل
t_mutate
مفتاح عدم التكرار
request_id

A fresh stage answers 202 Accepted; a replay of the same request_id answers 200 OK with the original batch_id and replay true. The status field says generating in both cases, because it describes the job, not the outcome of this call. Branch on the HTTP status or on replay, not on status.

المعاملات

المعامل الوصف
typeمطلوب body · enum refill or prepaid.
quantityمطلوب body · integer How many cards to mint.
face_valueمطلوب body · number Value per card, major units.
expirationمطلوب body · string yyyy-MM-dd HH:mm:ss or yyyy-MM-dd. Series-level card lifetime.
plan_profile_id body · integer Required for prepaid, and for a refill card that auto-activates.
code_length body · integer The redemption PIN length. A MINIMUM, not an exact value — a mint may exceed it when the tenant's live code pool needs more entropy.
code_charset body · enum numeric, alpha, alnum or alnum_no_ambig.
owner_manager_id body · integer The series owner. Defaults to the creator.
request_idمطلوب body · string Idempotency key.
الاستجابة 202 Accepted
{
  "data": {
    "batch_id": 209,
    "mode": "voucher_account",
    "status": "generating",
    "replay": false
  }
}
POST /api/v1/card-batches/bulk-delete Delete card batches prm_cards_delete
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_delete Delete card batches
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

POST /api/v1/card-batches/bulk-expiry Change card expiry prm_cards_change_expiry
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_change_expiry Change card expiry
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

POST /api/v1/card-batches/bulk-print-job Download / export cards prm_cards_download
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_download Download / export cards
حد المعدل
t_heavy

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

POST /api/v1/card-batches/bulk-printed Download / export cards prm_cards_download
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_download Download / export cards
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

POST /api/v1/card-batches/bulk-release Suspend / release cards prm_cards_suspend_release
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_suspend_release Suspend / release cards
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

POST /api/v1/card-batches/bulk-suspend Suspend / release cards prm_cards_suspend_release
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_suspend_release Suspend / release cards
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

GET /api/v1/card-batches/code-length Generate user cards prm_cards_generate_user
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_generate_user Generate user cards

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

DELETE /api/v1/card-batches/{id} Delete a card series prm_cards_delete

Deletes the series and its cards. Refuses outright once any card in it has been redeemed, transferred or sold at the till, because those are financial records.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_delete Delete card batches
حد المعدل
t_mutate

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
GET /api/v1/card-batches/{id} Fetch one card series prm_cards_list

The series header, its generation spec and its stock breakdown.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_list View card batches & cards

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
PATCH /api/v1/card-batches/{id} Manage card designs prm_cards_designer
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_designer Manage card designs
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

GET /api/v1/card-batches/{id}/cards List the cards in a series prm_cards_list

One row per card, carrying the plaintext code and, for prepaid series, the login username and password. Behind both the card-list permission and the per-series subtree gate for that reason.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_list View card batches & cards

state and effective_state are different questions and you almost always want the second. Nothing ever writes state 'expired', so a voucher past its expiry still reads as 'unused' in state and shows as available stock; effective_state applies the expiry at read time. Meanwhile disposition answers who holds the card — a voucher sold at the till but not yet redeemed is still 'unused' and is not stock you can sell again.

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
filter[state] query · string Stored state — unused, consumed, active, exhausted, revoked.
filter[disposition] query · string Who holds the card, which is orthogonal to state.
filter[has_customer] query · boolean Cards linked to a subscriber.
الاستجابة 200 OK
{
  "data": [
    {
      "id": 90211,
      "serial": "000312",
      "code": "K7P4M2Q9XD",
      "username": "v90211",
      "password": "8sk3ndq1",
      "state": "unused",
      "effective_state": "unused",
      "disposition": "available",
      "redemptions_left": 1,
      "expires_at": "2027-01-01 00:00:00",
      "used_bytes": 0,
      "used_seconds": 0
    }
  ],
  "meta": { "page": 1, "page_size": 50, "total": 500, "has_next": true }
}
POST /api/v1/card-batches/{id}/expiry Change card expiry prm_cards_change_expiry
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_change_expiry Change card expiry
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

GET /api/v1/card-batches/{id}/pdf Download / export cards prm_cards_download
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_download Download / export cards
حد المعدل
t_heavy

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

GET /api/v1/card-batches/{id}/pricing View card batches & cards prm_cards_list
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_list View card batches & cards

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

DELETE /api/v1/card-batches/{id}/pricing/{resellerId} Manage card designs prm_cards_designer
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_designer Manage card designs
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

PUT /api/v1/card-batches/{id}/pricing/{resellerId} Manage card designs prm_cards_designer
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_designer Manage card designs
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

GET /api/v1/card-batches/{id}/print-job Fetch a series' print job prm_cards_download

The data a client needs to render the printable sheet in the browser. Rendering happens client-side; the server ships no PDF engine.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_download Download / export cards

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
POST /api/v1/card-batches/{id}/printed Mark a series printed prm_cards_download

Records that the sheet was rendered, stamping printed_at and incrementing print_count.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_download Download / export cards
حد المعدل
t_mutate

Print tracking is observational only and deliberately does NOT move the series status. Nothing may set status to 'printed': the till refuses to mint into any series whose status is not 'ready', so auto-stamping would silently close every printed series to counter top-ups.

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
POST /api/v1/card-batches/{id}/regenerate Generate user cards prm_cards_generate_user
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_generate_user Generate user cards
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

POST /api/v1/card-batches/{id}/release Release a suspended card series prm_cards_suspend_release

Puts the revoked-but-unused cards of a suspended series back into stock.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_suspend_release Suspend / release cards
حد المعدل
t_mutate

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
POST /api/v1/card-batches/{id}/suspend Suspend a card series prm_cards_suspend_release

Revokes every still-unused card in the series. Cards already in flight are left alive. Re-running it is a harmless no-op.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_suspend_release Suspend / release cards
حد المعدل
t_mutate

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
الاستجابة 200 OK
{
  "data": { "message_key": "card_batch_suspended" }
}
POST /api/v1/card-batches/{id}/transfer-count Transfer N cards from a series prm_cards_change_owner

Like transfer-whole, but moves a count of cards off the top of the available stock rather than the entire series.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_change_owner Transfer / change card owner
حد المعدل
t_mutate
مفتاح عدم التكرار
request_id

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
countمطلوب body · integer How many cards to move.
from_manager_idمطلوب body · integer The current holder.
to_manager_idمطلوب body · integer The receiving reseller.
unit_priceمطلوب body · number Price per card. Required, never defaulted to zero.
request_idمطلوب body · string Idempotency key.
POST /api/v1/card-batches/{id}/transfer-range Transfer a card id range prm_cards_change_owner

Moves a contiguous range of card ids from the series, for the case where the physical cards handed over are a known block.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_change_owner Transfer / change card owner
حد المعدل
t_mutate
مفتاح عدم التكرار
request_id

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
card_id_rangeمطلوب body · object The inclusive id range to move.
unit_priceمطلوب body · number Price per card. Required.
request_idمطلوب body · string Idempotency key.
POST /api/v1/card-batches/{id}/transfer-whole Transfer a whole series to another reseller prm_cards_change_owner

Moves every card in the series from one manager to another at an agreed unit price, posting the matching ledger entries on both sides.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_change_owner Transfer / change card owner
حد المعدل
t_mutate
مفتاح عدم التكرار
request_id

unit_price is a required tri-state and omitting it is refused rather than read as zero. A bare 0 from a client that simply left the field out would mean "give the stock away", which is exactly the defect this check exists to stop. A negative price inverts the transfer.

المعاملات

المعامل الوصف
idمطلوب path · integer Series id.
from_manager_idمطلوب body · integer The current holder.
to_manager_idمطلوب body · integer The receiving reseller.
unit_priceمطلوب body · number Price per card, major units. Must be sent explicitly — omitting it is an error, not a zero.
request_idمطلوب body · string Idempotency key.
GET /api/v1/card-batches/{id}/transferable-cards View card batches & cards prm_cards_list
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_list View card batches & cards

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

GET /api/v1/card-batches/{id}/transfers View card batches & cards prm_cards_list
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_cards_list View card batches & cards

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

مكتوب لتقرأه الأدوات الآلية أيضًا

المرجع عام ولا يتطلب حسابًا، فتستطيع أداة لم تَرَ X-Radius من قبل أن تصل إلى أول استدعاء صحيح بنفسها.

/llms.txt
فهرس لكل صفحة، مع ملخّص من سطر واحد.
/llms-full.txt
المرجع كاملًا في ملف Markdown واحد، دون تنقّل يحتاج إلى زحف.
/openapi.json
‏OpenAPI 3.1، مُولَّد من الموجّه الذي يخدم هذه النسخة.
/skill.md
ملف مهارة جاهز لمساعد آلي: المصادقة وشكل الاستجابة ورموز الأخطاء في صفحة واحدة.
<page-url>.md
أضف ‎.md إلى رابط أي صفحة في المرجع لتحصل على الصفحة نفسها بصيغة Markdown.
Accept: text/markdown
أرسل هذه الترويسة على الرابط المعتاد فتصلك الإجابة بصيغة Markdown بدلًا من الصفحة.
سلّم هذا السطر إلى مساعدك الآلي
اقرأ https://x-radius.com/llms.txt، ثم اجلب نقطة النهاية التي تحتاجها بصيغة Markdown بإضافة ‎.md إلى رابطها.

جرّبه على شبكتك.

50 مشترك لمدة 7 أيام، من غير ما تدفع حاجة.