x12port exposes two sets of API endpoints. Programmatic API key endpoints (/api/v1/*)
are authenticated with a Bearer token and designed for server-to-server integrations.
Session endpoints (/api/*) are used internally by the x12port web app
and require an active browser session.
/api/v1/* routes) — Generate a key from your
Developer Dashboard. Include it as a Bearer token on every request:
Authorization: Bearer xp_test_YOUR_KEY
Sandbox keys start with xp_test_. Production keys start with xp_live_.
The environment is determined by which key you use — the base URL is the same for both.
/api/* routes) — Used by the Visual Mapping GUI and
other browser-based tools. These routes require a logged-in session cookie and are not intended
for server-to-server use. Use the /api/v1/* routes for all programmatic integrations.
All /api/v1 endpoints are relative to https://x12port.com. There is no separate API subdomain — do not use api.x12port.com.
| Environment | Key prefix | Behavior |
|---|---|---|
| Sandbox | xp_test_ | Safe for development and testing. Sandbox keys filter partners and transactions to test-mode records only. |
| Production | xp_live_ | Live data. Available on paid Developer Pro and Enterprise plans. Production keys access all records. |
All endpoints return JSON. Every response includes an ok boolean. Check ok before reading other fields.
// Success
{ "ok": true, ... }
// Error
{ "ok": false, "error": "Human-readable description of the problem" }
Confirms that your API key is valid and shows which environment it belongs to. Good first call when setting up an integration.
Response:
{
"ok": true,
"message": "API key is valid.",
"environment": "sandbox",
"account": "Acme Corp",
"account_type": "developer"
}
Parses an EDI or structured document and returns all extracted fields. Supports X12 EDI, JSON, XML, and CSV.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | string | Yes | Raw document content — X12 EDI string, JSON, CSV, or XML |
format | string | No | Document format: x12 (default), json, csv, xml |
elem_sep | string | No | Override element separator (X12 only). Detected automatically if omitted. |
seg_term | string | No | Override segment terminator (X12 only). Detected automatically if omitted. |
Response:
{
"ok": true,
"fields": {
"ISA.06": "ACME-CORP",
"ISA.08": "PARTNER",
"BEG.03": "PO-88241",
"BEG.05": "20260416",
"PO1.02": "50",
"PO1.04": "29.99"
},
"format": "x12",
"tx_set": "850",
"elem_sep": "*",
"seg_term": "~",
"field_count": 24,
"environment": "sandbox"
}
Converts a source document into a target format using a saved map ID or an inline field_map array.
Use map_id to reference a map you built in the Visual Mapping GUI — this is the recommended approach for production integrations.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | string | Yes | Raw source document |
map_id | integer | Conditional | ID of a saved mapping project. Required unless field_map is provided. |
field_map | array | Conditional | Inline array of mapping rule objects. Required unless map_id is provided. |
source_format | string | No | Overrides the map's source format: x12, json, csv, xml |
target_format | string | No | Overrides the map's target format |
direction | string | No | inbound (default) or outbound |
save_to_vault | boolean | No | If true, saves the converted output to your Document Vault and returns doc_id |
Inline field_map rule object:
{
"src": "BEG.03", // source field (segment.element notation)
"tgt": "order.po_number", // target field (dot-notation for nested JSON)
"transform": "none", // none | uppercase | lowercase | trim | date_iso
"note": "PO number" // optional description
}
Response:
{
"ok": true,
"output": "{\"order\":{\"po_number\":\"PO-88241\",\"date\":\"2026-04-16\"}}",
"doc_id": 42,
"environment": "sandbox"
}
Returns trading partners associated with your account. Sandbox keys return only partners in testing status.
{
"ok": true,
"count": 2,
"environment": "sandbox",
"partners": [
{
"id": 1,
"name": "Walmart",
"partner_status": "testing",
"inbound_url_test": "https://x12port.com/edi/receive/TOKEN?env=test"
}
]
}
Returns EDI transactions. Supports filtering and pagination.
| Query param | Description |
|---|---|
direction | inbound or outbound |
tx_set | Transaction set code, e.g. 850 |
partner_id | Filter by trading partner ID |
limit | Max results (default 50, max 200) |
offset | Pagination offset |
Submits an EDI transaction to a trading partner.
| Parameter | Required | Description |
|---|---|---|
partner_id | Yes | Trading partner ID |
tx_set | Yes | Transaction set code, e.g. 850 |
direction | Yes | inbound or outbound |
content | Yes | Raw X12 EDI document content |
Returns 997/999 functional acknowledgements received for your transactions.
The following endpoints require a logged-in session. They are used by the Visual Mapping GUI and are not intended for server-to-server integrations. For programmatic map execution, use POST /api/v1/convert with a map_id instead.
Returns all mapping projects belonging to the authenticated user.
{
"ok": true,
"maps": [
{ "id": 7, "name": "Walmart 850 → Order JSON", "source_fmt": "x12", "target_fmt": "json", "tx_set": "850", "updated_at": "Apr 20, 2026" }
]
}
Returns the full detail of a mapping project including all rules.
Returns metadata and content of a stored Document Vault record.
{
"ok": true,
"doc": {
"id": 42,
"filename": "api_20260420_120000.json",
"fmt": "json",
"direction": "outbound",
"content": "{ ... }",
"file_size": 1024,
"transaction_set": "850",
"status": "processed",
"created_at": "2026-04-20T12:00:00"
}
}
| Status | Meaning |
|---|---|
200 | Success — check the ok field for application-level status |
400 | Bad request — missing or invalid parameters, check the error field |
401 | Unauthorized — missing or invalid API key |
403 | Forbidden — account suspended or resource belongs to another user |
404 | Not found — resource does not exist or is not yours |
429 | Rate limited — too many requests |
500 | Server error — try again or open a support ticket |
# 1. Verify your key
curl https://x12port.com/api/v1/ping \
-H "Authorization: Bearer xp_test_YOUR_KEY"
# 2. Parse an X12 document
curl https://x12port.com/api/v1/parse \
-X POST \
-H "Authorization: Bearer xp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"format":"x12","document":"ISA*00*..."}'
# 3. Convert using a saved map (map_id from your dashboard)
curl https://x12port.com/api/v1/convert \
-X POST \
-H "Authorization: Bearer xp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"map_id":1,"document":"ISA*00*...","save_to_vault":true}'