API reference · Direct recharge
Request a direct recharge product
POST/v1/wallets/{walletId}/direct-recharges
Pay from this wallet for Anis staff to deliver the payout. Keep the same operation id if the answer is lost. Billing products (billing) are not available yet.
Permissiondirect_recharges:create
AuthenticationSigned purchase
Anis’s answerSigned
Staff-set limits it counts towardAll requests, Purchases (orders limit)
.NET SDKanis.DirectRecharges.CreateAsync(walletId, operationId, request)
- Every processing
202 contains exactly operationId, operationType and status: "processing"; operationType is directRecharge. Full operation reads use 200. - A missing operation read never proves absence. Retry the exact saved body with the same operation id and a fresh signature. A duplicate remains
202 during projection lag. Only a duplicate command on this retry, at or after 60 seconds since original admission, followed by an application-scoped read still not found, closes the operation with idempotency_conflict (409). A read miss or timeout alone never proves a conflict. That code does not prove nothing was charged: the first request may already have been accepted, so read the operation before any new attempt. - This purchase counts toward the existing
orders limit and the same daily application spending cap as card orders and other purchases.
Parameters
| Name | In | Type | Notes |
|---|
walletIdrequired | path | UUID | A UUID, lower-case with hyphens. |
Request
Signed with your key, with a one-time nonce, a digest of the body and your operation id as Idempotency-Key.
Headers: Signature-Input, Signature, Content-Digest, Nonce, Idempotency-Key, X-Anis-Date, Accept-Language (optional). The SDKs set all of them for you.
Body: CreateDirectRechargeRequest, as JSON.
| Field | Type | Notes |
|---|
productIdrequired | UUID | The selected direct recharge product id. |
payoutAmountrequired | string | The desired payout amount string from the quote. |
expectedTotalrequired | any | The total you confirmed from the package or quote, as LYD Money. The balance check is exact up to 999,999.999 LYD. |
recipientrequired | list of DirectRechargeRecipientInput | The keyed recipient values validated against this direct recharge product. |
note | string | Your optional note for this direct recharge. |
externalReference | string | Your reference, included when supplied. |
Responses
Every answer of this call is signed by Anis — success and every refusal. Require the signature and verify it before you act on the answer; an answer without one is a failure, never an answer (how).
Refusals
Every refusal of this call is a signed problem. Branch on its code; each links to what it means and what to do.
Types
CreateDirectRechargeRequest
| Field | Type | Notes |
|---|
productIdrequired | UUID | The selected direct recharge product id. |
payoutAmountrequired | string | The desired payout amount string from the quote. |
expectedTotalrequired | any | The total you confirmed from the package or quote, as LYD Money. The balance check is exact up to 999,999.999 LYD. |
recipientrequired | list of DirectRechargeRecipientInput | The keyed recipient values validated against this direct recharge product. |
note | string | Your optional note for this direct recharge. |
externalReference | string | Your reference, included when supplied. |
| Field | Type | Notes |
|---|
keyrequired | string | The exact field key supplied by the direct recharge product definition. |
valuerequired | string | The submitted field value; a location choice uses its id. |
DirectRecharge
| Field | Type | Notes |
|---|
operationIdalways present | UUID | The same UUID sent as Idempotency-Key for this purchase. |
statusalways present | DirectRechargeStatus | The merged customer-facing status; partial refunds add amounts rather than a new status. |
numberalways present | integer | The recorded direct recharge number. |
walletIdalways present | string | The wallet used for this purchase. |
productalways present | DirectRechargeProductReference | The purchased direct recharge product's id and title. |
payoutalways present | DirectRechargePayout | The payout string and named currency; not the LYD Money shape. |
exchangeRatealways present | string | The quoted exchange rate as a decimal string. |
pricealways present | Money | The LYD price including applicable location and holder adjustments. |
commissionalways present | Money | The LYD commission included in total. |
totalalways present | Money | The total wallet cost, as LYD Money. The balance check is exact up to 999,999.999 LYD. |
recipientalways present | list of DirectRechargeRecipientValue | The saved recipient values and display labels. |
note | string | Your optional note for this direct recharge. |
externalReference | string | Your reference, included when supplied. |
requestedAtalways present | string (date-time) | When the direct recharge was requested, in UTC. |
completedAt | string (date-time) | The completion time when supplied, in UTC. |
proofUrl | string | The recorded delivery proof URL when supplied; no access or expiry guarantee is stated. |
reason | string | The reason for suspension or either rejected state. |
partialRefund | DirectRechargePartialRefund | Settled partial-refund and remaining amounts; occurs only if partial refunds are enabled for the product. |
DirectRechargeProductReference
| Field | Type | Notes |
|---|
idalways present | UUID | The selected direct recharge product id. |
titlealways present | string | The direct recharge product's display text. |
DirectRechargePayout
| Field | Type | Notes |
|---|
amountalways present | string | The payout amount as a decimal string. |
currencyalways present | DirectRechargeCurrency | The payout currency display name object. |
DirectRechargeCurrency
| Field | Type | Notes |
|---|
namealways present | string | The display name supplied for this item. |
Money
| Field | Type | Notes |
|---|
amountalways present | string | A decimal string, never a JSON number. Wallet balances may be negative while allowed debt is used. Prices and totals follow each route's amount rules. |
currencyalways present | string | An uppercase three-letter currency code, such as LYD. Read a wallet’s currency from balance.currency. |
asOf | string (date-time) | When this price or balance was read. |
DirectRechargeRecipientValue
| Field | Type | Notes |
|---|
keyalways present | string | The exact field key supplied by the direct recharge product definition. |
name | LocalizedText | The Arabic and English display labels, omitting empty languages. |
valuealways present | string | The submitted field value; a location choice uses its id. |
valueName | string | The display name of a selected value, when supplied. |
LocalizedText
| Field | Type | Notes |
|---|
ar | string | The Arabic text; omitted when empty. |
en | string | The English text; omitted when empty. |
DirectRechargePartialRefund
| Field | Type | Notes |
|---|
refundedPayoutalways present | string | The refunded or remaining payout as a string in the product currency. |
refundedTotalalways present | Money | The refunded or remaining LYD wallet amount. |
remainingPayoutalways present | string | The refunded or remaining payout as a string in the product currency. |
remainingTotalalways present | Money | The refunded or remaining LYD wallet amount. |
DirectRechargeAccepted
| Field | Type | Notes |
|---|
operationIdalways present | UUID | The same UUID sent as Idempotency-Key for this purchase. |
operationTypealways present | string | Always directRecharge. Values: directRecharge |
statusalways present | string | Always processing; the outcome is not final. Values: processing |