Request
PATCH https://backend.net0.com/v1/batches/{batchId}/moving/{movementId}
This endpoint allows for the partial update of an existing batch movement available on your Net0 account.
curl --location --request PATCH 'https://backend.net0.com/v1/batches/3/moving/733af8ae-0512-495d-bdf6-aa8a10d6fd2f' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"fromAddress": {
"startAddress": "c26 A & B, Yah Wahab Estate, Ilese, Lagos",
"startPoint": "lat"
},
"toAddress": {
"endAddress": "New providence gardens, Lekki",
"endPoint": "lng"
},
"name": "Opemipo Jokotagba",
"transportType": "AIR",
"startDate": "2021-11-28T02:03:30.512Z",
"endDate": "2021-11-29T02:03:30.512Z"
}'
Request Body
Attribute | Type | Description | In | Required |
---|---|---|---|---|
batchId | String | The id of the batch. | path | true |
movementId | String | The id of the movement | path | true |
body | PatchOperation | Update operations to be performed on the already existing movement | body | true |
fromAddress | Object, String | An object containing the startAddress & startPoint of the movement. | body | true |
toAddress | Object, String | An object containing the startAddress & startPoint of the movement. | body | true |
transportType | String | The transport type of the batch movement. The required types include: TRUCK, SHIP, AIR, and RAIL | body | true |
startDate | String | The start date of the movement for the batch | body | true |
endDate | String | The end date the movement for the batch. | body | true |
Response
The response returns the updated batch movement.
{
"distance": 15628,
"totalEmission": 498,
"transportWeightTon": 30,
"transportType": "AIR",
"vendorId": null,
"comment": null,
"emission": {
"co2e": 498,
"companyId": 2,
"unitId": 2,
"co2": null,
"ch4": null,
"n2o": null,
"id": "d5a8717b-b4f3-43e1-89cf-379d2f114723",
"createdAt": "2021-11-27T15:36:38.869Z",
"updatedAt": "2021-11-27T15:36:38.869Z"
},
"startAddress": "c26 A & B, Yah Wahab Estate, Ilese, Lagos",
"startPoint": "lat",
"endAddress": "New providence gardens, Lekki",
"endPoint": "lng",
"name": "Opemipo Jokotagba",
"startDate": "2021-11-28T02:03:30.512Z",
"endDate": "2021-11-29T02:03:30.512Z",
"emissionKindId": "37f3ed79-349b-4cac-9dcd-96c29c01015e",
"companyId": 2,
"id": "733af8ae-0512-495d-bdf6-aa8a10d6fd2f",
"referenceNumber": null,
"updatedAt": "2021-11-27T15:36:38.869Z"
}