Skip to documentation
FahiPay
Developers
Loading endpoint documentation…
FahiPay APIs / Merchant API

Merchant API

Accept payments and build customer-approved billing into your website, app, or business software.

Use one REST API to create hosted payment links, display PayMV QR codes, charge approved authorizations, and retrieve payment history.

Endpoints

Base URL

https://api.fahipay.mv/merchants

Your credentials identify your merchant account and its current live or sandbox mode. The base URL stays the same in both modes.

Money and amounts

All payments are in MVR. Send monetary amounts as integer laari: 100 laari = MVR 1.00. Use "amount": 2000 for MVR 20.00, and omit currency. The API explorer shows an MVR preview as you edit amounts and monetary limits.

Hosted payments, payment requests, and authorization charges accept amounts from 1 to 9,999,999,999 laari and references of 1–100 characters after trimming. Authorization creation has separate reference and limit rules, shown in the API explorer.

Payment amounts. Responses use amount, fee, and net_amount. The fee and net amount are null until the payment is paid. After payment, the fee is non-negative, and net amount equals amount minus fee.

Customer links use https://fahipay.mv/p/{uuid}: payment_url for hosted payments and approval_url for authorizations. Payment requests appear directly in the recipient's FahiPay app and do not have public links. Use each returned URL as-is; its UUID may differ from the API resource ID. Opening a link does not approve or pay anything.

Create your first payment

Send a reference unique across all your merchant payments and an amount. The response contains a hosted payment_url and a PayMV qr_url.

Response examples use FahiPay URLs with descriptive placeholders, such as https://fahipay.mv/p/YOUR_PUBLIC_LINK_ID. These placeholders are not working links. Use the exact payment, QR, and approval URLs returned by the API; do not construct them from resource IDs.

Send the customer to the payment link or display the returned QR image. Confirm status: "paid" through a verified webhook or a server-side lookup before fulfilling the order.

Handle checkout results

To return customers to your app, set return_url to a page on your own website, such as https://merchant.example/payment/complete. That page can redirect the customer to your app using your own app link. FahiPay accepts an HTTP or HTTPS return URL; do not supply a custom app scheme directly. Use HTTPS for your return page.

  1. Save the payment id returned by FahiPay against your order before opening payment_url.
  2. Use your own session or an opaque order token in the return URL to identify the order. Do not rely on FahiPay adding a payment ID or status to the URL.
  3. When the customer returns to your website or app, have your backend retrieve the saved payment using GET /payments/{id}. Keep merchant credentials on your server.
  4. Show success only for paid. Show pending as awaiting payment; handle rejected, expired, cancelled, and refunded using the returned status. A failed status lookup is not proof that payment failed.

A return-page visit or app redirect is not payment confirmation. Use verified webhooks to update orders even when the customer closes checkout without returning. If the app cannot open, keep a useful payment-status page available on your website.

Before you integrate

  • You need an active merchant account. Open the merchant portal.
  • Keep your secret key and authenticated API calls on your server.
  • New hosted payments expire after 24 hours unless you provide a different expiry.
  • Reuse the original reference and amount only when retrying that same payment.