# Method: networks.shipments.path.commit

Commits the path of a shipment, indicating that it cannot be changed in the future, even by the user, save for force majeure/act of God indicated by the vehicles.makeUnavailable, hubs.makeUnavailable, lines.makeUnavailable methods. This method is not used to tag a particular revision of a path.

### HTTP request

`POST https://middlemileoptimization.googleapis.com/v1/{name=networks/*/shipments/*}/path:commit`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of the shipment whose path must be committed. Format: "networks/{network}/shipments/{shipment}" |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { // Union field `path_to_commit` can be only one of the following: "completeShipmentPath": { object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/networks.shipments.path/commit#PathToCommit`) }, "segments": { object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/networks.shipments.path/commit#IncompletePathToCommit`) } // End of list of possible types for union field `path_to_commit`. } ``` |

| Fields ||
|---|---|
| Union field `path_to_commit`. The path or parts of the path that should be committed. `path_to_commit` can be only one of the following: ||
| `completeShipmentPath` | ``object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/networks.shipments.path/commit#PathToCommit`)`` The segments of a path from a source to a destination. |
| `segments` | ``object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/networks.shipments.path/commit#IncompletePathToCommit`)`` A subset of the segments of a path from a source to a destination. |

### Response body

If successful, the response body contains an instance of `https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/Path`.

## PathToCommit

Full path being committed, from source to destination.

| JSON representation |
|---|
| ``` { "segments": [ { object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/PathSegment`) } ] } ``` |

| Fields ||
|---|---|
| `segments[]` | ``object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/PathSegment`)`` Required. Segments must be in order, from a source to a destination. |

## IncompletePathToCommit

Part of path being committed, i.e. some segments between the source and the destination.

| JSON representation |
|---|
| ``` { "segments": [ { object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/PathSegment`) } ] } ``` |

| Fields ||
|---|---|
| `segments[]` | ``object (`https://developers.google.com/optimization/middlemileoptimization/reference/rest/v1/PathSegment`)`` Required. A subset of the segments of a path from a source to a destination. |