# Matchmaking - Porutham, dosha cancellation, D9, dasha, bulk

Ten endpoints on top of [Guna Milan](/en/vedic/compatibility/): the South Indian Porutham, the cancellation of the three doshas a match is usually refused for, the navamsa and dasha view of a couple, one report with all of it, and one profile ranked against a list.

Every judgement comes back with the rule that produced it, the source of that rule and a `basis`: `classical` when a named text states it, `manual` when it comes from a published Tamil matching manual and no verse-numbered text could be found. Where manuals disagree, the rule says which variant is applied and what the other one says.

**Note:**
`chart1` is the groom and `chart2` the bride, on these routes as on every `/vedic/compatibility/*` route. Porutham counts from the bride's star to the groom's, so swapping them changes the answer.

## Endpoints

| Endpoint | Credits | What it returns |
|---|---|---|
| `/v1/vedic/compatibility/porutham` | 50 | All ten factors, score out of 10, verdict |
| `/v1/vedic/compatibility/porutham/rajju` | 50 | Rajju alone |
| `/v1/vedic/compatibility/porutham/vedha` | 50 | Vedhai alone |
| `/v1/vedic/compatibility/porutham/mahendra` | 50 | Mahendram alone |
| `/v1/vedic/compatibility/porutham/stree-deergha` | 50 | Stree Deergham alone |
| `/v1/vedic/compatibility/dosha-cancellation` | 50 | Mangal, Nadi and Bhakoot, each with the rules that cancel it |
| `/v1/vedic/compatibility/navamsa` | 50 | D9 Lagna, Moon, Venus and 7th of both, navamsa lords of the Moons |
| `/v1/vedic/compatibility/dasha` | 50 | Concurrent Vimshottari maha and antar for up to 30 years |
| `/v1/vedic/compatibility/couple-report` | 50 | All of the above plus Ashtakoot and Dashakoota |
| `/v1/vedic/compatibility/bulk` | 50 + 20 per further candidate | One profile against up to 100 candidates, ranked |

## Porutham

Ten factors: Dinam, Ganam, Mahendram, Stree Deergham, Yoni, Rasi, Rasi Adhipathi, Vasiyam, Rajju, Vedhai. Each one is `uttamam` (agrees, 1), `madhyamam` (agrees in part, 0.5) or `adhamam` (does not agree, 0). The match is `agreeable` when Rajju and Vedhai both agree and the score is at least 5. That threshold is the manuals' guideline, not a verse, and `verdictRule` says so.

`school` is `tamil` (default) or `kerala`. The ten tables are the same in both, because no Kerala table for them could be sourced; `kerala` adds Papasamyam: Sun, Mars, Saturn and Rahu in houses 1, 2, 4, 7, 8, 12 count 1 from the Lagna, 0.5 from the Moon and 0.25 from Venus, and the bride's total should not exceed the groom's.

| Factor | Rule applied | Source |
|---|---|---|
| Dinam | Count 2, 4, 6, 8, 9, 11, 13, 15, 18, 20, 24, 26 agrees; same star by a star list | findyourfate; other manuals use the remainder by 9 |
| Ganam | Same Deva or Manushya agrees, Deva bride with Manushya groom in part | findyourfate |
| Mahendram | Count 4, 7, 10, 13, 16, 19, 22, 25 | hindutone, tuningmymelody |
| Stree Deergham | Above 13 agrees, above 7 in part | findyourfate, tuningmymelody |
| Yoni | Same animal agrees, the seven enemy pairs fail | Muhurta Chintamani 6.25-26 |
| Rasi | Groom's sign 1, 7, 9, 10, 11, 12 from the bride's agrees | tuningmymelody; findyourfate fails 2, 4, 6, 8, 12 |
| Rasi Adhipathi | Mutual friends agree, enemies fail, the rest in part | BPHS ch. 3 friendship |
| Vasiyam | Groom's sign vasya to the bride's agrees, the reverse in part | one transcribed manual table; manuals disagree on six rows |
| Rajju | Same rajju of five fails, with its named consequence | findyourfate, hindutone |
| Vedhai | 12 pairs plus the Mrigashira-Chitra-Dhanishta triad fail | findyourfate, hindutone |

The Vasiyam table, sign by the signs vasya to it: Aries: Leo, Scorpio. Taurus: Cancer, Libra. Gemini: Virgo. Cancer: Scorpio, Sagittarius. Leo: Capricorn. Virgo: Taurus, Pisces. Libra: Capricorn. Scorpio: Cancer, Virgo. Sagittarius: Pisces. Capricorn: Aquarius. Aquarius: Pisces. Pisces: Capricorn.

## Dosha cancellation

Kuja (Mangal) dosha is found from Mars's houses by `mangalSchool`: `south` (default) 1, 2, 4, 7, 8, 12 from the Lagna, Moon and Venus; `north` the same from the Lagna and Moon; `strict` 1, 4, 7, 8, 12 from the Lagna, the houses of BPHS 80.47. Each position is then checked against these exceptions:

| Rule | Source |
|---|---|
| No dosha when Jupiter or Venus joins or aspects Mars | BPHS 80.47 |
| Mars in the 4th or 7th in Aries, Scorpio, Cancer or Capricorn | Muhurta Chintamani |
| Mars in a movable sign in the 2nd, 4th, 8th or 12th | Jataka Chandrika |
| Mars joined or aspected by Jupiter or Mercury | Jataka Parijata |
| Mars exalted or debilitated | attributed to Garga |
| Leo or Cancer lagna | a verse whose text is not named |
| Both partners have the dosha (samya) | a verse whose text is not named |

Exceptions that appear only in modern lists (a sign table per house, Aquarius lagna, age 28) are not applied. This is why the Mangal answer here can differ from `/vedic/doshas/parashara/mangal`.

Nadi is cancelled by Jyotirnibandha (same star in different signs, or same sign with different stars), Muhurta Ganapati (same or friendly Moon-sign lords, or friendly navamsa lords) and the exempt-star lists of Narada Samhita and Piyushdhara. Bhakoot is cancelled by Muhurta Pradipa for six 6/8 pairs, by Kalaprakasika for a 2/12 pair with friendly lords or a vasya sign, and Jyotih Prakasam counts a 5/9 pair good when the groom is 5th from the bride. `uncancelled` lists what remains.

## Navamsa and dasha

`/navamsa` gives each partner's D9 Lagna, Moon, Venus and 7th with lords and vargottama flags, and the relation of the two Moons' navamsa lords, the one navamsa rule of matching that could be sourced (Muhurta Ganapati, Nadi cancellation). It returns no score, because no text defines one.

`/dasha` cuts the window (`fromDate`, `years` 1 to 30, default 10) into segments where both partners' mahadasha and antardasha lords stay the same, and gives the natural relation (BPHS ch. 3) of the lords running side by side. Rahu and Ketu have no place in that table, so their `relation` is `null`. It also lists every mahadasha change in the window. No verdict.

## Bulk matching

One `profile` with `profileRole` (`groom` or `bride`) against up to 100 `candidates`, each `{ id, chart }`. Every candidate takes the other role. Results are ranked by Ashtakoot points, ties by Porutham, or the other way with `sortBy: "porutham"`; `minAshtakoot` drops those below a line. A candidate whose chart fails comes back in `errors` and does not stop the rest.

The call is synchronous. `/v1/vedic/compatibility/bulk` costs 50 credits for the first candidate and 20 for each further one, so 100 candidates cost 2 030; `X-Credits-Used` and `credits` in the body carry the figure.

  **cURL**
    ```bash frame="terminal"
    curl -X POST https://api.astroway.info/v1/vedic/compatibility/porutham/rajju \
      -H "X-Api-Key: aw_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "chart1": { "date": "1990-05-15", "time": "15:30:00", "timezone": "Europe/Kyiv", "latitude": 50.45, "longitude": 30.52 },
        "chart2": { "date": "1985-11-03", "time": "09:15:00", "timezone": "Europe/Kyiv", "latitude": 48.46, "longitude": 35.04 }
      }'
    ```

  **Node.js**
    ```ts
    const r = await fetch('https://api.astroway.info/v1/vedic/compatibility/bulk', {
      method: 'POST',
      headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY!, 'Content-Type': 'application/json' },
      body: JSON.stringify({
        profile: { date: '1990-05-15', time: '15:30:00', timezone: 'Europe/Kyiv', latitude: 50.45, longitude: 30.52 },
        profileRole: 'groom',
        candidates: [
          { id: 'c-101', chart: { date: '1985-11-03', time: '09:15:00', timezone: 'Europe/Kyiv', latitude: 48.46, longitude: 35.04 } },
          { id: 'c-102', chart: { date: '1992-03-22', time: '08:15:00', timezone: 'Europe/Kyiv', latitude: 49.84, longitude: 24.03 } },
        ],
      }),
    });
    const { data } = await r.json();
    for (const c of data.results) console.log(c.rank, c.id, c.ashtakoot.total, c.porutham.passed);
    ```

The Rajju answer for that pair:

```json
{
  "ok": true,
  "data": {
    "method": "porutham-rajju",
    "school": "tamil",
    "groom": { "star": 21, "starName": "Uttara Ashadha" },
    "bride": { "star": 6, "starName": "Ardra" },
    "factor": "rajju",
    "verdict": "uttamam",
    "pass": true,
    "score": 1,
    "rule": "The two stars are in different rajju.",
    "source": "findyourfate.com, 10 Porutham (Tamil manual tables); hindutone.com, The 10 Poruthams of South Indian marriage matching",
    "basis": "manual",
    "detail": { "brideRajju": "kanta", "groomRajju": "udara" }
  }
}
```

## Checked against

Prokerala's published sample couple (bride Ashwini, groom Magha): our Porutham agrees on six factors of ten, and differs on four where Prokerala uses another table (Dinam by Tara, Yoni by the sex of the animal, Rajju in three groups, and a Rasi Adhipathi verdict its own Guna Milan contradicts). The test suite pins both the agreements and the differences.

  - [Guna Milan](/en/vedic/compatibility/): Ashtakoot, Dashakoota, Manglik
  - [Doshas](/en/vedic/doshas/): Mangal and the other single-chart doshas
  - [Dashas](/en/vedic/dashas/): Vimshottari and nine other systems
  - [Credits](/en/credits/): Per-endpoint credit cost
