Features Pricing Docs Login Get Started

Developer Docs

Embed payment forms on your website in 60 seconds.

Quick Start

Replace FORM_ID with your actual form ID from the FormPesa dashboard.

<!-- Paste anywhere in your <body> -->
<iframe
  src="https://formpesa.wasmer.app/f/FORM_ID/embed"
  style="width:100%;max-width:480px;height:600px;border:none;"
  scrolling="no"
  title="Payment Form"></iframe>

Zero dependencies. Works with any website, any stack. Auto-resizes to form height.

FormPesa.render() Options

Option Type Description
formId string Your form ID from the FormPesa dashboard (required)
onPaid function Fires when M-Pesa payment is confirmed
onSubmit function Fires when a free form is submitted
onError function Fires on payment or submission error

Pro Tips

  • Responsive by default. Forms look great on mobile, tablet, and desktop out of the box.
  • No backend needed. The iframe handles everything — form rendering, M-Pesa STK Push, and payment confirmation.
  • Custom styling. Wrap the iframe in your own container with max-width, shadows, or borders to match your brand.
  • Multiple forms. Add as many embeds as you want on the same page — each points to a different form ID.