---
updatedAt: 2025-09-10T21:01:12.000Z
agentTools:
  projectIndex: https://shipcars.readme.io/llms.txt
---

# /api/tripplanner/v1/trips/{trip-id}/rearrange-stops

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "User Management",
    "description": "Ship.Cars User Management",
    "contact": {
      "url": "https://ship.cars",
      "email": "support@ship.cars"
    },
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "oauth2",
        "flows": {
          "password": {
            "tokenUrl": "https://auth.ship.cars/auth/realms/master/protocol/openid-connect/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://ship.cars/api"
    }
  ],
  "paths": {
    "/api/tripplanner/v1/trips/{trip-id}/rearrange-stops": {
      "post": {
        "tags": [
          "Trip Controller"
        ],
        "parameters": [
          {
            "name": "trip-id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Context",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stops": {
                    "type": "array",
                    "items": {
                      "required": [
                        "trip_load_id",
                        "type"
                      ],
                      "type": "object",
                      "properties": {
                        "trip_load_id": {
                          "pattern": "\\S",
                          "type": "string",
                          "example": "VIYNZDDVO5GPPEQS44AZBVKBFY"
                        },
                        "type": {
                          "enum": [
                            "PICK_UP",
                            "DELIVERY"
                          ],
                          "type": "string"
                        }
                      }
                    }
                  },
                  "vault": {
                    "type": "array",
                    "items": {
                      "required": [
                        "trip_load_id",
                        "type"
                      ],
                      "type": "object",
                      "properties": {
                        "trip_load_id": {
                          "pattern": "\\S",
                          "type": "string",
                          "example": "VIYNZDDVO5GPPEQS44AZBVKBFY"
                        },
                        "type": {
                          "enum": [
                            "PICK_UP",
                            "DELIVERY"
                          ],
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "required": [
                    "id",
                    "name",
                    "status",
                    "capacity",
                    "origin",
                    "destination",
                    "revenue",
                    "route",
                    "plan",
                    "loads",
                    "stops"
                  ],
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "ACTIVE",
                        "COMPLETED",
                        "ARCHIVED"
                      ],
                      "type": "string"
                    },
                    "capacity": {
                      "format": "int32",
                      "type": "integer"
                    },
                    "driver": {
                      "required": [
                        "id",
                        "full_name"
                      ],
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "full_name": {
                          "type": "string"
                        },
                        "profile_picture": {
                          "type": "string"
                        }
                      }
                    },
                    "origin": {
                      "required": [
                        "state",
                        "city"
                      ],
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string"
                        },
                        "city": {
                          "type": "string"
                        },
                        "zip": {
                          "type": "string"
                        }
                      }
                    },
                    "destination": {
                      "required": [
                        "state",
                        "city"
                      ],
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string"
                        },
                        "city": {
                          "type": "string"
                        },
                        "zip": {
                          "type": "string"
                        }
                      }
                    },
                    "revenue": {
                      "format": "double",
                      "type": "number"
                    },
                    "route": {
                      "type": "object",
                      "properties": {
                        "polyline": {
                          "type": "string"
                        },
                        "total_distance_miles": {
                          "format": "double",
                          "type": "number"
                        },
                        "legs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "miles": {
                                "format": "double",
                                "type": "number"
                              },
                              "start_location": {
                                "type": "object",
                                "properties": {
                                  "latitude": {
                                    "format": "double",
                                    "type": "number"
                                  },
                                  "longitude": {
                                    "format": "double",
                                    "type": "number"
                                  }
                                }
                              },
                              "end_location": {
                                "type": "object",
                                "properties": {
                                  "latitude": {
                                    "format": "double",
                                    "type": "number"
                                  },
                                  "longitude": {
                                    "format": "double",
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "plan": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "exceeding_capacity": {
                            "type": "boolean"
                          },
                          "spots": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "start_mile": {
                                  "format": "double",
                                  "type": "number"
                                },
                                "end_mile": {
                                  "format": "double",
                                  "type": "number"
                                },
                                "load_id": {
                                  "type": "string"
                                },
                                "type": {
                                  "enum": [
                                    "LOAD",
                                    "WASTE",
                                    "UNAVAILABLE",
                                    "NES",
                                    "ES"
                                  ],
                                  "type": "string"
                                },
                                "vcg_ids": {
                                  "type": "array",
                                  "items": {
                                    "format": "int32",
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "loads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "load_id": {
                            "type": "string"
                          },
                          "shipper_load_id": {
                            "type": "string"
                          },
                          "pickup_city": {
                            "required": [
                              "state",
                              "city"
                            ],
                            "type": "object",
                            "properties": {
                              "state": {
                                "type": "string"
                              },
                              "city": {
                                "type": "string"
                              },
                              "zip": {
                                "type": "string"
                              }
                            }
                          },
                          "delivery_city": {
                            "required": [
                              "state",
                              "city"
                            ],
                            "type": "object",
                            "properties": {
                              "state": {
                                "type": "string"
                              },
                              "city": {
                                "type": "string"
                              },
                              "zip": {
                                "type": "string"
                              }
                            }
                          },
                          "pickup_dates_range": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "format": "date",
                                    "type": "string",
                                    "example": "2022-03-10"
                                  }
                                ],
                                "example": "2022-10-06"
                              },
                              "end": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "format": "date",
                                    "type": "string",
                                    "example": "2022-03-10"
                                  }
                                ],
                                "example": "2022-10-06"
                              }
                            }
                          },
                          "delivery_dates_range": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "format": "date",
                                    "type": "string",
                                    "example": "2022-03-10"
                                  }
                                ],
                                "example": "2022-10-06"
                              },
                              "end": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "format": "date",
                                    "type": "string",
                                    "example": "2022-03-10"
                                  }
                                ],
                                "example": "2022-10-06"
                              }
                            }
                          },
                          "vehicles_count": {
                            "format": "int32",
                            "type": "integer",
                            "example": 10
                          },
                          "status": {
                            "enum": [
                              "POSTED",
                              "UNAVAILABLE",
                              "LOAD_CANDIDATE",
                              "OFFER_SENT",
                              "REPLY_TO_OFFER",
                              "PENDING",
                              "BOOKED",
                              "ASSIGNED",
                              "PICKED_UP",
                              "DELIVERED",
                              "ARCHIVED",
                              "EXPIRED"
                            ],
                            "type": "string"
                          },
                          "total_payment_to_carrier": {
                            "format": "double",
                            "type": "number"
                          },
                          "notes": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "stops": {
                      "type": "array",
                      "items": {
                        "required": [
                          "trip_load_id",
                          "type"
                        ],
                        "type": "object",
                        "properties": {
                          "trip_load_id": {
                            "pattern": "\\S",
                            "type": "string",
                            "example": "VIYNZDDVO5GPPEQS44AZBVKBFY"
                          },
                          "type": {
                            "enum": [
                              "PICK_UP",
                              "DELIVERY"
                            ],
                            "type": "string"
                          }
                        }
                      }
                    },
                    "vault": {
                      "type": "array",
                      "items": {
                        "required": [
                          "trip_load_id",
                          "type"
                        ],
                        "type": "object",
                        "properties": {
                          "trip_load_id": {
                            "pattern": "\\S",
                            "type": "string",
                            "example": "VIYNZDDVO5GPPEQS44AZBVKBFY"
                          },
                          "type": {
                            "enum": [
                              "PICK_UP",
                              "DELIVERY"
                            ],
                            "type": "string"
                          }
                        }
                      }
                    },
                    "email_notifications_enabled": {
                      "type": "boolean"
                    },
                    "can_be_archived": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "format": "date-time",
                      "type": "string",
                      "example": "2022-03-10T16:15:50Z"
                    },
                    "httpStatus": {
                      "format": "int32",
                      "type": "integer"
                    },
                    "errorCode": {
                      "format": "int32",
                      "type": "integer"
                    },
                    "errorMessage": {
                      "type": "string"
                    },
                    "errorDetails": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```