GetShipment
ShipmentService · Unary
Retrieve a shipment and its most recent carrier event.
See Track a shipment for the complete workflow.
RPC contract
Section titled “RPC contract”rpc GetShipment(GetShipmentRequest) returns (GetShipmentResponse);
Connect endpoint
Section titled “Connect endpoint”POST http://localhost:8080/shipping.v1.ShipmentService/GetShipmentContent types: application/json or application/proto. The unary body is one message.
No side effects is declared in the schema. GET availability depends on the deployed server configuration.
See protocol behavior for metadata, deadlines, errors, cancellation, and streaming.
The local example server returns this shipment. An empty identifier returns invalid_argument.
Request example
Section titled “Request example”{ "shipmentId": "shp_123", "includeEvents": true}Calling this method
Section titled “Calling this method”curl --fail-with-body \ --header 'Content-Type: application/json' \ --header 'Connect-Protocol-Version: 1' \ --data '{ "shipmentId": "shp_123", "includeEvents": true}' \ 'http://localhost:8080/shipping.v1.ShipmentService/GetShipment'import { fromJson, toJson } from '@bufbuild/protobuf';import { createClient } from '@connectrpc/connect';import { createConnectTransport } from '@connectrpc/connect-node';import { ShipmentService } from "./gen/shipping/v1/shipping_pb.js";import { GetShipmentRequestSchema as InputSchema } from "./gen/shipping/v1/shipping_pb.js";import { GetShipmentResponseSchema as OutputSchema } from "./gen/shipping/v1/shipping_pb.js";
const client = createClient(ShipmentService, createConnectTransport({ baseUrl: "http://localhost:8080", httpVersion: '1.1',}));const request = fromJson(InputSchema, { "shipmentId": "shp_123", "includeEvents": true});
const response = await client.getShipment(request);console.log(toJson(OutputSchema, response));package main
import ( "context" "fmt" "log" "net/http" "connectrpc.com/connect" "google.golang.org/protobuf/encoding/protojson" pb "github.com/lanej/wirelit/examples/go/gen/shipping/v1" rpc "github.com/lanej/wirelit/examples/go/gen/shipping/v1/shippingv1connect")
func main() { client := rpc.NewShipmentServiceClient(http.DefaultClient, "http://localhost:8080") request := new(pb.GetShipmentRequest) if err := protojson.Unmarshal([]byte("{\n \"shipmentId\": \"shp_123\",\n \"includeEvents\": true\n}"), request); err != nil { log.Fatal(err) } response, err := client.GetShipment(context.Background(), connect.NewRequest(request)) if err != nil { log.Fatal(err) } data, err := protojson.Marshal(response.Msg) if err != nil { log.Fatal(err) } fmt.Println(string(data))}Response example
Section titled “Response example”{ "shipment": { "shipmentId": "shp_123", "status": "SHIPMENT_STATUS_IN_TRANSIT", "weightMg": "450000", "createdAt": "2026-10-31T12:00:00Z", "metadata": { "order": "ord_456" }, "streetAddress": "417 Example Street", "estimatedTransit": "172800s" }}Documented errors
Section titled “Documented errors”invalid_argument
Section titled “invalid_argument”shipment_id is required
Source: fixture-v1 · Generator: Wirelit 0.1.0