# RevCent MCP Guide: `GetTransaction`

Brief AI/MCP-focused guide for retrieving one RevCent credit card Transaction.

---

## Operation Summary

Operation:

```text
GetTransaction
```

Purpose:

```text
Retrieve the details of a specific Transaction.
```

In RevCent, a `Transaction` is specifically a **credit card transaction**.

Use `GetTransaction` when the exact 20-character Transaction ID is known and the user needs to inspect one credit card payment/refund record.

---

## Related Links

| Guide | Link |
|---|---|
| Transactions Overview | `https://revcent.com/documentation/markdown/mcp/operation/OverviewTransaction.md` |
| RefundTransaction | `https://revcent.com/documentation/markdown/mcp/operation/RefundTransaction.md` |
| BigQueryRunQuery | `https://revcent.com/documentation/markdown/mcp/operation/BigQueryRunQuery.md` |

---

## When to Use

Use `GetTransaction` for one known Transaction.

Good uses:

- review one credit card charge,
- review one credit card decline,
- review one credit card refund transaction,
- inspect gateway response details,
- check amount/refund/captured/settled fields,
- verify customer/card/gateway context,
- inspect related Sales, Product Sales, Tax, Shipping, Subscriptions, Renewals, Salvage Transactions, Pending Refunds, Chargebacks, or Fraud Detections.

---

## Input Schema

Required:

| Field | Type | Description |
|---|---:|---|
| `transaction_id` | string | 20-character Transaction ID. |

Example:

```json
{
  "transaction_id": "TTTTTTTTTTTTTTTTTTTT"
}
```

---

## Useful Output Areas

`GetTransaction` can return detailed credit-card transaction context, including:

| Area | Examples |
|---|---|
| Amounts | `amount`, `amount_total`, `amount_gross`, `amount_net`, `amount_fees`, `amount_refunded`, `amount_remaining`. |
| Status | `approved`, `declined`, `held`, `error`, `captured`, `settled`, `void`, `result`, `code`. |
| Gateway | `gateway_id`, `gateway_name`, `gateway_transaction_id`, `gateway_auth_code`, AVS/CVV/CAVV result codes, gateway result phrase. |
| Card | customer card ID, card type, first 6/BIN, last 4, expiration. |
| Customer | customer ID, name, email, phone, address, metadata. |
| Context | whether it is an initial Sale, Payment Profile attempt, subscription, subscription renewal, salvage, or refund. |
| Related records | Sales, Product Sales, Shipping, Tax, Trials, Subscriptions, Subscription Renewals, Salvage Transactions, Pending Refunds, Chargebacks, Fraud Detections, AI Threads, API Calls. |

Do not expose sensitive gateway details or internal risk logic to customers unless the business explicitly allows it.
---

## Customer-Facing AI Verification Warning

This operation may expose sensitive customer/payment/order context.

If `GetTransaction` is used inside a customer-facing AI flow, such as:

- AI Voice Agent,
- public chatbot,
- support chatbot,
- customer portal assistant,
- SMS assistant,
- any visitor-facing AI workflow,

the AI/MCP client should verify the visitor is actually related to the Transaction before providing details or taking action.

Recommended rule:

```text
Do not provide Transaction details to a public-facing visitor based only on the Transaction ID or a value the visitor supplied.
```

Use a secondary value from the retrieved Transaction response to verify identity.

Recommended verification examples:

| Visitor-Provided Input | Secondary Verification Value |
|---|---|
| Transaction ID | Customer email from `GetTransaction.customer.email`. |
| Gateway transaction ID | Customer email or phone from the retrieved Transaction. |
| Last 4 / card hint | Customer email from the retrieved Transaction. |
| Name | Email, phone, or another value already on the retrieved customer record. |

Example safe flow:

```text
Visitor provides transaction/search input
    ↓
AI uses SearchTransactions and/or GetTransaction
    ↓
AI retrieves the Transaction
    ↓
AI asks the visitor to verify a secondary value from the retrieved record, such as customer email
    ↓
Only after verification:
        provide limited appropriate details
        or take an allowed action
```

Important:

```text
The secondary verification value should come from the retrieved RevCent record, not only from the visitor's original search input.
```

For example, if the visitor searches by last 4 or transaction ID, verify against the customer email returned by `GetTransaction` before discussing the Transaction.

Do not disclose sensitive details such as:

- full gateway responses,
- fraud/risk logic,
- full card data,
- unrelated customer details,
- internal notes not meant for customers,
- other related records unless the visitor is verified and authorized.

For consequential actions, such as refunds, cancellations, payment recovery, or subscription changes, require stronger confirmation and follow the relevant operation-specific safety guidance.


---

## Critical Reporting Rule

These Transaction lookup/search operations are **not** reporting tools.

Do not use this operation for:

- counting,
- aggregations,
- metrics,
- reporting,
- data mining,
- bulk retrieval,
- broad analysis,
- document property searches,
- revenue summaries,
- approval/decline rate reports,
- refund reports,
- gateway performance reports.

Use:

```text
BigQueryRunQuery
```

for those purposes.

Important AI/MCP behavior:

```text
If the AI/MCP client planned to use this operation for reporting, metrics, aggregation, or data-mining and then realizes BigQueryRunQuery is the correct operation, it does not need to tell the user about the correction.

It should simply use BigQueryRunQuery instead.
```

The user does not need an explanation that the AI almost used the wrong operation. The correct behavior is to quietly choose the correct operation.


---

## Correct Use vs Incorrect Use

| User Intent | Correct Action |
|---|---|
| “Show me this transaction ID.” | Use `GetTransaction`. |
| “Why did this specific card transaction fail?” | Use `GetTransaction`. |
| “Can I refund this transaction?” | Use `GetTransaction` first, then confirm and use `RefundTransaction` if appropriate. |
| “How many transactions declined last month?” | Use `BigQueryRunQuery`, not `GetTransaction`. |
| “Show approval rate by gateway.” | Use `BigQueryRunQuery`, not `GetTransaction`. |

---

## Best Practices

1. Use this only for one known Transaction ID.
2. Treat Transactions as credit card records, not PayPal or Offline Payment records.
3. Retrieve before refunding.
4. Use related IDs to retrieve Sale/Product Sale/Tax/Shipping/Subscription context when needed.
5. Use `SearchTransactions` when the Transaction ID is unknown.
6. Use `BigQueryRunQuery` for all reporting and analytics.

---

## Final AI/MCP Instruction

Use `GetTransaction` to retrieve one specific credit card Transaction by ID.

In customer-facing AI flows, verify the visitor is related to the Transaction using a secondary value from the retrieved record, such as `customer.email`, before providing details or taking action.

Do not use this operation for reporting, metrics, counting, aggregation, data-mining, or broad analysis. If the task is reporting-related, silently use `BigQueryRunQuery` instead.


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.