Sandbox mode — Use https://wallet.e-mazad.store/api/v1 as your base URL
Payment Gateway

Payment Gateway

The Payment Gateway manages the lifecycle of every payment: creation, authorization, capture, void, and refund. Understand the state machine to build robust integrations.

Payment state machine

pending
User confirms in popup
capture_mode: automatic
completed
capture_mode: manual
authorized
POST /capture
completed
POST /void
voided
From completed: POST /refund
refunded

Payment statuses

StatusDescription
pendingSession created, user has not yet confirmed.
authorizedFunds held in escrow. Awaiting capture (manual mode only).
completedFunds captured and settled to merchant.
voidedAuthorization released. No funds moved.
refundedFunds returned to user (full or partial).
failedPayment failed (insufficient funds, expired, error).

Escrow (manual capture)

When you set capture_mode: "manual" on a checkout session, funds are held in escrow after the user confirms.

Use cases

Marketplace escrow (hold until delivery confirmed), service bookings (hold until service rendered), auction payments (hold until auction closes).

Hold duration

Authorized holds expire after 7 days by default. If not captured within this window, the hold is automatically voided and funds are released back to the user.

Partial capture

You can capture less than the authorized amount. The remaining held funds are automatically released.

7-day expiry

Authorized payments expire after 7 days. Set up a cron job or webhook handler to capture or void payments before expiry. Expired holds do not count as failures and are automatically voided.

Typical timeline

EventTiming
Session createdT+0
Session expires (if unused)T+30 min
User confirms paymentT+0 to T+30 min
Funds debited / heldInstant (< 500ms)
Webhook delivered< 5 seconds
Manual capture windowUp to 7 days
Auto-void (if not captured)T+7 days
Refund windowUp to 90 days

Gateway endpoints

Ready to integrate Mazad into your platform?

Our team will review your business and issue your production API keys within 2 business days.