Morocco payroll API
Moroccan salary and labour-law maths as JSON: gross to net, IR, CNSS and AMO, employer cost, severance, leave and final settlement. One call, official 2026 rates, a source for every number.
Rates last verified 22 November 2026
Start free on RapidAPI
The free plan gives 100 calls a month to try every endpoint in the browser. RapidAPI handles keys, billing and usage; paid plans start at $9.99 a month.
One call, the whole payslip
Request: 10,000 MAD gross a month, 2 dependants.
curl "https://morocco-payroll-labour-law.p.rapidapi.com/v1/salary/gross-to-net?gross=10000&dependents=2" \
-H "X-RapidAPI-Key: YOUR_KEY" \
-H "X-RapidAPI-Host: morocco-payroll-labour-law.p.rapidapi.com"Response (real output on the 2026 rules):
{
"data": {
"gross": 10000,
"cnss": 268.8,
"amo": 226,
"cimr": 0,
"mutuelle": 0,
"fraisPro": 2500,
"netTaxable": 7005.2,
"irBeforeFamily": 601.56,
"familyDeduction": 100,
"ir": 501.56,
"nonTaxableAllowances": 0,
"net": 9003.64,
"employerCharges": 1749.8,
"employerCost": 11749.8
},
"meta": {
"rulesYear": 2026,
"lastVerified": "2026-11-22",
"currency": "MAD",
"apiVersion": "1.0.0",
"disclaimer": "Estimate for a private-sector employee in Morocco, ..."
}
}Every endpoint also accepts POST with the same fields in a JSON body. Amounts in MAD. Clear 400 errors, one per field.
Endpoints
| GET | What it returns |
|---|---|
/v1/salary/gross-to-net | Monthly gross to net: CNSS (6,000 MAD ceiling), AMO, optional CIMR and health insurance, professional expenses, IR by bracket, family deduction, employer cost |
/v1/salary/net-to-gross | The gross salary needed for a target net, to the cent |
/v1/salary/cost-to-gross | A total employer budget turned into gross and net |
/v1/employer-contributions | Employer contributions line by line: social benefits, family allowances, training tax, AMO |
/v1/income-tax | IR on an annual taxable salary: tax per bracket, family deduction, marginal and average rate |
/v1/severance | Legal severance by service band, notice and notice pay, damages for abusive dismissal, IR-exempt share |
/v1/paid-leave | Paid-leave entitlement in working days, with the seniority bonus and the 30-day cap |
/v1/paid-leave/pay | Pay for a number of leave days |
/v1/final-settlement | Final settlement (solde de tout compte) for resignation, dismissal, gross misconduct or end of a fixed-term contract |
/v1/seniority-bonus | Seniority bonus (prime d'ancienneté): legal rate, amount, next step |
/v1/overtime | Overtime pay with the legal premiums and the annual caps |
/v1/rates | Every rate, ceiling and bracket used, with its official source and last-verified date |
Plans
| Plan | Price per month | Calls per month |
|---|---|---|
| Basic | Free | 100 |
| Pro | $9.99 | 10,000 |
| Ultra | $29.99 | 100,000 |
| Mega | $79.99 | 500,000 |
Hard limits on every plan: no overage charges. Billed and managed by RapidAPI.
Quick answers
- Where do the rates come from?
- From the official texts: the 2026 General Tax Code and Finance Law (income-tax brackets, professional expenses, family deduction), the CNSS and AMO decrees (rates and the 6,000 MAD ceiling) and the Labour Code (severance, notice, leave, seniority bonus, overtime). GET /v1/rates returns every value with its source link.
- What happens when the law changes?
- The rates are updated and re-checked, and every response carries meta.lastVerified and meta.rulesYear so your app can show when the rules were checked. The next planned update is for the 2027 Finance Law in January 2027.
- Is it the same as the free calculators?
- Yes. The API runs the same engine as the free French calculators at salaire.devsupex.app, so you can check any answer by hand there before you integrate.
- Who is it for?
- Developers building HR, payroll, accounting, job-board or fintech products for Morocco who need correct salary maths without maintaining the rules themselves. It gives estimates for private-sector employees and is not legal or tax advice.
Build it into your product
Subscribe on RapidAPI, copy the code snippet for your language, and you have Moroccan payroll in your app today.