canonical: https://jentic.com/apis/managetradex.my/managetradex-document

# Managetradex My ManageTradeX - Document API

The ManageTradeX Document API submits e-invoicing documents to the ManageTradeX platform for validation and processing against Malaysia's MyInvois system. It accepts invoices, credit notes, debit notes, refund notes, and their self-billed variants in JSON or XML, reports the validation result through a callback, and returns document details by transactionId with optional artefacts such as the PDF. It also cancels a validated document by docNo with a reason, validates a supplier or buyer Tax Identification Number against an identity type such as BRN or NRIC, and looks up a Peppol participant and the document types it supports.

## For AI agents

Submit Malaysian e-invoices and credit or debit notes for MyInvois validation, fetch or cancel submitted documents, validate a TIN, and look up a Peppol participant.

## Scope

Does not handle tax calculation, payment collection, bookkeeping, or sending invoices over the Peppol network. Use for submitting, retrieving, and cancelling MyInvois e-invoicing documents and validating TINs only.

## Capabilities

- Submit an invoice, credit note, debit note, refund note, or self-billed document with POST `/documents/{docType}` for MyInvois validation
- Retrieve a submitted document's details by transactionId, adding artefacts such as the PDF with includeArtefacts
- Cancel a validated document with PUT `/documents/{docType}/cancel` by passing its docNo and a reason
- Validate a supplier or buyer TIN with GET `/validateTin/{tin}` using an idType of BRN, NRIC, ARMY, or PASSPORT and its idValue
- Look up a Peppol participant by peppolId and see the document types it supports

## Use cases

### Agent-run e-invoice submission through Jentic

An accounting agent validates the buyer's TIN, submits the invoice for MyInvois validation, and later fetches the document details with its PDF once the callback reports success. Through Jentic the agent finds each operation by intent, the OAuth2 client credentials stay in the developer's own Jentic One instance, and a rule can let the agent submit and read documents while cancellation stays out.

Example prompt: Call GET `/validateTin/{tin}` with idType 'BRN' and the buyer's registration number as idValue, then POST `/documents/IN` with the invoice payload

### Credit notes and cancellations

When an invoice is wrong, the document type in the path selects the correction: CN for a credit note, DN for a debit note, or RN for a refund note, each submitted through POST `/documents/{docType}.` A validated document can instead be cancelled outright with PUT `/documents/{docType}/cancel`, which requires the docNo and a reason as query parameters.

Example prompt: Call PUT `/documents/IN/cancel` with docNo 'INV-1001' and reason 'Incorrect amount'

### Buyer and supplier identity checks

Before issuing an e-invoice, the counterparty's Tax Identification Number can be confirmed with GET `/validateTin/{tin}`, which needs both an idType such as BRN, NRIC, ARMY, or PASSPORT and the matching idValue. GET `/lookup/participants/{peppolId}` shows whether a buyer can receive documents over Peppol and which document types it supports.

Example prompt: Call GET `/validateTin/C1234567890` with idType 'BRN' and idValue '201901234567', then GET `/lookup/participants/{peppolId}` for the buyer

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/documents/{docType}` | Submit a document |
| GET | `/documents/{docType}` | Get document details |
| PUT | `/documents/{docType}/cancel` | Cancel a document |
| GET | `/validateTin/{tin}` | Validate a TIN |
| GET | `/lookup/participants/{peppolId}` | Look up a Peppol participant |

## Key resources

- **Documents** — E-invoicing documents typed by docType: IN, CN, DN, RN, and self-billed SIN, SCN, SDN, and SRN
- **TIN validation** — Tax Identification Number checks against an identity type and value
- **Peppol participants** — Participant lookup by peppolId with supported document types

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 58 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 99 / 100
  - Developer Experience & Jentic Compatibility: 67 / 100
  - AI-Readiness & Agent Experience: 31 / 100
  - Agent Usability: 94 / 100
  - Security: 85 / 100
  - AI Discoverability: 63 / 100
- **View full report:** https://jentic.com/apis/managetradex.my/managetradex-document/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the ManageTradeX Document API by hand means running the OAuth 2.0 client credentials exchange, building MyInvois-shaped invoice payloads, and handling the validation callback yourself. Through Jentic you install once, import the API from the API Directory, store the client credentials once, and your agent calls it.
- **Permission scoping:** ManageTradeX puts the document type in the URL path, so a rule can pin your agent to one docType such as credit notes and the operations you pick. You choose the operations it may call, so the cancel operation is not included unless you add it.
- **Credential handling:** Your ManageTradeX client credentials are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'submit an e-invoice' or 'validate a TIN', and Jentic returns the matching ManageTradeX operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **ManageTradeX - Peppol API** — Send and receive Peppol transactions and manage Peppol participants
- **Storecove API** — E-invoicing network access for Peppol and national compliance
- **Avalara API** — Sales tax calculation and compliance

## FAQ

### Is there a ManageTradeX MCP server?

You don't need an MCP server to give your agent the ManageTradeX Document API. Jentic connects it directly from the API Directory: import it, store your OAuth2 client credentials once, and your agent calls it. Operations are discovered on demand, so no extra tool definitions sit in the agent's context.

### What authentication does the ManageTradeX Document API use?

Per its OpenAPI spec, the ManageTradeX Document API uses OAuth 2.0 with the client credentials grant, requesting tokens from the `/oauth2/token` path. Through Jentic the client credentials are stored encrypted by your own Jentic One instance and the token exchange happens at execution time, so the credentials never enter the agent's context.

### Can I limit what my agent is allowed to do with the ManageTradeX Document API?

Yes. For example, write a rule that allows POST `/documents/CN` and GET `/documents/CN`, so the agent can submit and check credit notes only, while invoices and the cancel operation stay out of reach. Every call it makes is logged on your own machine.

### Which document types can I submit?

The docType path value covers IN for invoices, CN for credit notes, DN for debit notes, and RN for refund notes, plus the self-billed SIN, SCN, SDN, and SRN variants. Documents are submitted in JSON or XML and the validation result is delivered to your callback.

### How do I submit an e-invoice through Jentic?

Install Jentic One, import the ManageTradeX Document API from the directory, and search for 'submit a Malaysian e-invoice'. Jentic returns the submit document operation with its input schema; your agent sets docType to IN and sends the invoice with fields such as senderId, docNo, docDate, currency, supplier, and buyer. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### What are the rate limits for the ManageTradeX Document API?

The OpenAPI spec does not specify rate limits. Check the ManageTradeX documentation at https://managetradex.my for current limits. Note that the spec's server is the sandbox host api-sbox.managetradex.my.
