Overview
Moyasar integration in Flexprice syncs invoices to Moyasar and generates a payment link (Moyasar invoice URL) for each synced invoice.Synchronization Flow
The sync process is one-way (Flexprice → Moyasar) and works as follows:How it Works
1
Trigger
An invoice sync is triggered (automatically).
2
Creation
Flexprice creates an invoice object in Moyasar using the
secret_key.3
Link Generation
Moyasar returns a
url (the payment page).4
Metadata Update
Flexprice saves the Moyasar invoice ID and payment URL in the invoice metadata.
Invoice Data Model
Flexprice Invoice Structure
Moyasar Invoice Structure
Sync Configuration
The following fields are mapped during sync:Payment Flow & Webhooks
Payment Journey
1
User pays
User clicks the
moyasar_invoice_url.2
Processing
Payment is processed on Moyasar’s hosted page.
3
Webhook
Moyasar sends a
payment_paid webhook.4
Reconciliation
Flexprice receives the webhook, finds the invoice via the metadata/mapping, and updates the invoice status to
PAID.Error Handling
Testing
1
Create invoice
Create a Flexprice invoice.
2
Trigger sync (Automatically)
Trigger the sync to Moyasar.
3
Check metadata
Check invoice metadata for
moyasar_invoice_url.4
Test payment
Open the URL and pay using a Test Card.

