Credit a subscriber wallet
POST
/api/v1/users/{id}/deposit
prm_users_deposit
Moves money into the subscriber's wallet and writes the matching ledger line. Idempotent on request_id through a unique constraint on the ledger itself, so the charge and the record of it cannot disagree.
replay true means this exact request already happened and nothing moved this time. It is a success, and the balance shown is the one from the original operation.
نظرة سريعة
- المصادقة
- رمز موظّف أو جلسة
- تتطلب صلاحية
-
prm_users_depositDeposit to user wallet - حد المعدل
t_mutate- مفتاح عدم التكرار
request_id
المعاملات
| المعامل | الوصف |
|---|---|
idمطلوب
path · integer
|
Subscriber id. |
amountمطلوب
body · number
|
Major units, a bare JSON number. 150.50, not "150.50" and not 15050. |
request_idمطلوب
body · string
|
Idempotency key. |
issue_invoice
body · boolean
|
Also record an invoice document. Skipped on a replay. |
الأخطاء
| الرمز | متى تُرجَع |
|---|---|
ERR_VALIDATION400
|
request_id missing, too long or reserved |
ERR_CONFLICT409
|
the request_id is already held by a different ledger line |