This section outlines the process for testing Custom API integrations (Customer & Internally Built) between MachShip and external systems. It covers both inbound and outbound data flows, focusing on authentication, data validation, error handling, and timing consistency.
Inbound API Testing (External System → MachShip)
Test Scenario Expected Outcome Status / Notes Authentication and token validity MachShip accepts valid API key/token; rejects invalid credentials Connectivity to endpoint POST/PUT/GET requests reach MachShip endpoint successfully (HTTP 200/201) Payload structure validation Request matches schema; invalid requests return clear error codes (400/422) Required fields (from/to addresses, references, packages) All required data elements successfully parsed by MachShip Duplicate request handling Duplicate consignments are not created for the same order ID Error response handling System logs errors and retries or alerts as configured Consignment creation Consignment visible under Create / Manage > Pending/Unmanifested Consignments Validation of timestamps and references CreatedAt and Reference fields display correctly in MachShip
Outbound API Testing (MachShip → External System)
Test Scenario Expected Outcome Status / Notes Webhook registration and validation Webhook registered and receives POSTs on consignment creation/manifest Webhook authentication External API validates signature or token from MachShip Payload format and data accuracy Outbound JSON/XML matches documented schema and includes correct consignment data Timing of write-back Outbound events triggered within expected timeframe (≤5 minutes post-update) Retry mechanism Failed requests retried per configuration until success or timeout Error logging Outbound error logs available in MachShip Admin > Integration Logs Write-back to external system External system fields updated with tracking number, carrier, cost, ETA, etc. Confirmation of delivery HTTP 200 OK response logged in MachShip after successful post Security All data transmitted via HTTPS using TLS 1.2+
Validation & General Checks
Validation Area Expected Result Status / Notes API response codes All valid responses return 2xx codes; invalid requests return appropriate 4xx or 5xx codes Data consistency All references and consignment IDs match across systems Security All endpoints use HTTPS and token-based authentication Error handling Errors clearly logged and recoverable End-to-end flow Consignment created → manifested → written back successfully