The OnePay Online vendor flow lets a merchant load supported customer institutions, initiate a payment, confirm it using OTP, check the status when the payment hub (DPH) needs more time, and list vendor transactions for history and reporting.
SmartPay is the payment service of the SmartBank platform by Sarab Tech. Merchants with a Mediterranean Bank (Meditbank) corporate account can receive payments from customers of all OnePay member banks through this API.
Item
Value
Base URL
{{BaseUrl}} — provided with your merchant onboarding
Base route
/smartpay/api/online/vendor/onepay
Authentication
X-Api-Key header on every request
Request tracing
X-Request-Id where shown
Currency
LYD (Libyan Dinar), code 434
Format
JSON over HTTPS
Authentication & common headers
All endpoints are authenticated with a vendor API key sent in the X-Api-Key header. The backend uses it to identify and authorize your vendor/POS.
Header
Required
Used by
Description
X-Api-Key
Yes
All endpoints
Vendor API key identifying and authorizing the vendor/POS.
X-Request-Id
Recommended / required where shown
Initiate, confirm, status check
Unique id per request, used for tracing and safe retries. Never reuse an id for a different request.
Content-Type
Yes for POST
Initiate, confirm
application/json for request bodies.
Keep your API key on the server. Never embed X-Api-Key in browser or mobile code. All calls to this API should come from your backend.
Recommended integration flow
Step
Call
Developer action
1
Get institutions
Load once for the UI, or refresh when the institution list may change.
2
Initiate payment
Send customer identifier, institution id, and amount. Save transactionId.
3
Confirm payment
Send transactionId and OTP. If the response status is pending, check status.
4
Check status
Use when the confirmation result is pending or DPH still needs time.
5
Get transactions
Use for vendor history/reporting. Always use paging.
Want to see it live? Jump to the payment flow simulator — it walks the full init → OTP → confirm → status cycle with mock responses.
Returns the institutions/banks the merchant can show to the customer. The selected institution id is later sent as CustomerInstitutionId. No body or query parameters.
Important: use confirm only after a successful initiation. If isError is false but status is 0, call Check Payment Status after a short delay — DPH may need time to finalize the payment.
Poll carefully: use a short delay and a retry limit, not an infinite loop. When status becomes 1 Completed, update the merchant UI and stop polling. If it becomes Failed/Cancelled, show the returned API message if available.
Use paging in production. Do not request huge date ranges from the UI. confirmedAt can be null — show "Pending" or "Not confirmed yet", not a rendering error.
Transaction status values
Value
Name
Meaning
0
Pending
Payment started but not completed yet.
1
Completed
Payment completed successfully.
2
Failed
Payment failed.
3
Refunded
Payment was refunded.
5
Cancelled
Payment was cancelled.
Error handling
Errors are returned as JSON problem details. Exact messages may be localized, so rely on HTTP status and field names first, then display the message returned by the API.
Status
When it usually happens
Developer action
400
Business rule issue, duplicate request id, invalid state, or invalid OTP.
Show the returned message. Do not silently retry confirmation.
401 / 403
Missing or invalid X-Api-Key.
Check vendor API key configuration.
404
Transaction or endpoint not available/found.
Check path, transaction id, and feature availability.
422
Validation failed for request fields.
Highlight invalid fields in the UI.
429
Too many requests.
Retry later and reduce repeated calls.
500
Unexpected backend/upstream issue.
Show a friendly error and keep request/transaction ids for support.
Example error body
{
"type": "",
"title": "Amount must be greater than 0",
"detail": "Amount must be greater than 0",
"status": 422,
"instance": "/smartpay/api/online/vendor/onepay/init-transfer",
"traceId": "<trace-id>",
"errors": { "Amount": "Amount must be greater than 0" }
}
⚡ Payment flow simulator
Walk the full OnePay Online payment lifecycle with mock responses — no API key needed. Everything runs in your browser; no real calls are made.
Institutions
Initiate
Confirm (OTP)
Status
Done
API LOG
// Simulator ready. Click "Load institutions" to begin.
🛠 Request builder
Fill in your values and copy a ready-to-run request. The snippet updates live as you type.
Configure
Confidential — Sarab Tech LLC · OnePay Online via SmartPay · SmartBank by Meditbank · Last updated 2026-07-05