# Why a Ramp charge happened

Source: https://immiscible.fly.dev/docs/api/get-api-w-wid-ramp-transactions-tid

`GET /api/w/:wid/ramp/transactions/:tid`

Owners, admins and analysts. Both sides of one charge: what Ramp saw, and the action, mandate, approval and receipt behind it, with a sentence that says why.

## Authentication

Session cookie. A signed-in person: the console's session cookie. Every state-changing request also carries the header `x-immiscible-csrf: 1`, and the member's role decides what it may do. Bearer tokens are ignored on these routes, so no machine credential can reach them.

## Path parameters

- `wid` (string, required): Workspace id
- `tid` (string, required): Team id, or for service tokens the token id

## Request

curl:

```bash
curl "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/ramp/transactions/team_platform" \
  -H "cookie: __Host-sid=$IMMISCIBLE_SESSION"
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/ramp/transactions/team_platform', {
  headers: {
    cookie: `__Host-sid=${process.env.IMMISCIBLE_SESSION}`,
  },
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.get(
    "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/ramp/transactions/team_platform",
    headers={
        "cookie": f"__Host-sid={os.environ['IMMISCIBLE_SESSION']}",
    },
)
print(res.status_code, res.json())
```

## Response

```json
{
  "ramp": { "id": "rtx_1", "amount": 4250, "currency": "GBP", "merchant": "TESCO STORES 3021", "status": "matched", "actionId": "act_5e2b" },
  "immiscible": { "actionId": "act_5e2b", "decision": "allow", "mandateTitle": "Weekly groceries", "approval": null, "receiptJti": "rcp_8f1d" },
  "agent": { "id": "agt_9c1e", "name": "Shopper", "status": "active" },
  "why": "Shopper asked to pay market.example £42.50 for \"Weekly shop\". Its mandate \"Weekly groceries\" allowed it without asking. Receipt act_5e2b was issued, and this charge is within it."
}
```
