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

Mass Payroll

Pay hundreds of workers, vendors, or partners in a single batch. Upload a CSV or call the API, and track each disbursement in real time.

Use cases

Payroll batches are ideal for any scenario where you need to distribute funds to multiple recipients at once.

Employee Salaries

Pay your entire workforce with a single API call. Each employee receives funds directly in their Mazad wallet.

Gig Worker Payouts

Settle earnings for delivery drivers, freelancers, or contractors after each work period.

Marketplace Settlements

Distribute collected funds to multiple sellers after order completion or on a regular schedule.

Affiliate Commissions

Pay affiliate partners their earned commissions in bulk at the end of each month.

Prize Distributions

Distribute prizes or rewards to multiple auction winners or contest participants simultaneously.

Refund Batches

Process multiple refunds at once when a batch of orders needs to be reversed.

Batch lifecycle

Every payroll batch moves through a predictable sequence of states.

draft
--submit-->
processing
--all succeed-->
completed
If any fail:
--partial failure-->
partially_completed
draftBatch created but not yet submitted. Recipients can still be modified.
processingFunds reserved from merchant wallet. Individual transfers are being processed.
completedAll recipients received their funds successfully.
partially_completedSome transfers failed. Failed amounts are refunded to merchant wallet.
failedEntire batch failed (e.g., insufficient merchant balance). All funds refunded.

Atomic fund reservation

When a batch is submitted, Mazad atomically reserves the total amount from your merchant wallet before processing any individual transfers. This guarantees that all recipients can be paid or the entire batch is rejected.

How it works

1

Mazad calculates the total payout: sum of all recipient amounts.

2

The total is reserved (held) from your merchant wallet in one atomic operation.

3

Individual transfers are processed one by one from the reserved pool.

4

If a transfer fails, that amount is returned to your available balance.

Insufficient balance

If your merchant wallet does not have enough available balance to cover the total batch amount, the entire batch will fail with a 402 error. No partial reservations are made.

Quick example

Create a payroll batch with three recipients in a single API call.

curl -X POST https://wallet.e-mazad.store/api/v1/payroll/batches \
  -H "Authorization: Bearer sk_sandbox_..." \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "IQD",
    "description": "March 2025 Salaries",
    "recipients": [
      { "customer_id": "cust_emp001", "amount": 500000, "note": "March salary" },
      { "customer_id": "cust_emp002", "amount": 750000, "note": "March salary" },
      { "customer_id": "cust_emp003", "amount": 600000, "note": "March salary" }
    ]
  }'