Skip to content

Instantly share code, notes, and snippets.

@azrosen92
Last active September 17, 2019 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azrosen92/792294e55f92cf9ce63549b719bf2df0 to your computer and use it in GitHub Desktop.
Save azrosen92/792294e55f92cf9ce63549b719bf2df0 to your computer and use it in GitHub Desktop.
Potential API Response Body for Load Details v7 endpoint

Shipment Detail API

/mobile/v7/shipments/:id

  interface ShipmentAPIResponse {
    shipment: {
      id: number;
      state: string;
      trackingRequired: boolean;
      pallets: number;
      floorLoaded: boolean;
      nextStopId: number;
      rate: number;
      mapImage: string;
      keepAwake: boolean;
      pickups: ShipmentStopAPIResponse[];
      deliveries: ShipmentStopAPIResponse[];
      contact: {
        phone: string;
      };
      loadOverview: {
        title: string;
        value: string;
      }[];
      equipmentAttrbutes: {
        attribute: string;
        value: string;
      }[];
      requirements: {
        text: string;
      }[];
    };
  };

  interface ShipmentStopAPIResponse {
    id: number;
    address: {
      stateCode: string;
      city: string;
      postalCode: string;
      country_code: string;
    };
    commodity: string;
    appointmentDateTime: string; // datetime in ISO 8601 format
    timezone: string;
    billOfLading: string;
    poReference: string;
    isDropTrailer: string;
    instructions: {
      text: string;
    };
    hours: string;
    palletCount: number;
    weight: number;
  };
@derekmisler
Copy link

If this same serializer will be used for the driver's current shipment, there is a keepAwake property I'd like to retain, as well. It's one of those things that we could determine on the front-end, but if we ever want to change the logic, I'd rather a simple back-end deploy than a whole new app build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment