GraphQL API
CXTMS provides a comprehensive GraphQL API for interacting with the system. The API supports queries, mutations, and subscriptions for real-time updates.
Base URL
https://api.cargoxplorer.com/graphql
Authentication
All GraphQL requests require authentication via Bearer token in the Authorization header:
Authorization: Bearer <your-access-token>
Common Patterns
Pagination
List queries support offset-based pagination with the following parameters:
| Parameter | Type | Description |
|---|---|---|
skip | Int | Number of items to skip |
take | Int | Number of items to return (default: 20, max: 100) |
Filtering
Most list queries support filtering via the filter parameter using Lucene query syntax:
query {
getAttachments(organizationId: 1, filter: "attachmentType:Picture") {
items {
attachmentId
fileName
}
}
}
Sorting
Use the orderBy parameter to sort results:
query {
getAttachments(organizationId: 1, orderBy: "created desc") {
items {
attachmentId
fileName
}
}
}
Search
Full-text search is available via the search parameter:
query {
getAttachments(organizationId: 1, search: "invoice") {
items {
attachmentId
fileName
}
}
}
Order Resolvers
getCommoditiesWithRelatedOrder
Returns the flat list of leaf commodities linked to shipments of a specified order type within an order's commodity hierarchy. Available as a field on the Order type.
query {
getOrders(organizationId: 1, take: 1) {
items {
orderId
getCommoditiesWithRelatedOrder(orderType: "ParcelShipment", filter: "weight>0") {
commodityId
description
pieces
weight
}
}
}
}
Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
orderType | String! | Yes | The related order type to filter by (e.g., ParcelShipment, PickupOrder). Uses the OrderTypes enum values (case-insensitive). |
filter | String | No | Lucene filter to apply on the returned commodities |
Behavior
- Traverses the order's commodity hierarchy via
OrderCommodityHierarchyView - Finds commodities linked to related orders of the specified type
- Returns only leaf commodities — excludes wrapper/consolidated commodities whose children are also linked
- Supports projection and filtering
Available APIs
- Attachments - File attachments and document management