Skip to content

Monobank

Monobank Acquiring (api.monobank.ua), gateway name monobank. Driver Gateways\Monobank\MonobankGateway.

KeyEnvDefaultMeaning
tokenMONOBANK_TOKEN—X-Token from the merchant cabinet (web.monobank.ua), or a test token from api.monobank.ua
link_ttl_minutesMONOBANK_LINK_TTL_MINUTES60Checkout lifetime, sent as validity

Currencies: UAH, USD, EUR. Webhooks need no setup — webHookUrl goes with every invoice.

charge() creates an invoice (POST /api/merchant/invoice/create):

FieldFrom
amount, ccyMinor units; ISO numeric currency code
merchantPaymInfo.referenceThe payment id — how the webhook finds the row
merchantPaymInfo.destinationChargeOptions::$description
merchantPaymInfo.customerEmailscustomerEmail
merchantPaymInfo.basketOrderReceipt items (name, qty, sum, code)
redirectUrlThe success return URL — Monobank has one return URL for every outcome; failUrl is ignored
validitylink_ttl_minutes × 60
saveCardDataWith saveCard: saveCard: true and a walletId derived from the billable

raw is merged into the request (e.g. agentFeePercent); the driver’s fields win. external_id = invoiceId.

Signed with ECDSA by the bank (X-Sign over the raw body). The validator fetches Monobank’s public key with the merchant token, caches it for a week per token, and on a failed check refetches once (throttled to once per 5 minutes) in case the key rotated. If the key can’t be fetched, the webhook answers 403 and Monobank re-delivers.

statusResult
successpaid (amount and currency checked), fee from paymentInfo.fee
failurefailed
reversedA refund, recorded from cancelList
created, processing, holdIgnored (not terminal)

Status polling (GET /invoice/status) also maps expired → canceled.

saveCard: true → the token arrives in a later delivery of the same invoice webhook, with walletData.status = created; the driver saves it as a side effect. Off-session charges go to POST /wallet/payment with initiationKind: merchant, including the basket. attachPaymentMethod($billable, ['card_token' => ...]) verifies the token is in the billable’s wallet (GET /wallet). detachPaymentMethod() calls DELETE /wallet/card.

POST /invoice/cancel with an optional amount (partial refunds supported). status: failure → BillingException; processing is accepted. Dashboard reversals arrive as reversed and are recorded from the sum of successful cancelList entries.

GET /api/merchant/details — returns the merchant name.