Update Movement For A Specific Batch

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

AttributeTypeDescriptionInRequired
batchIdStringThe id of the batch.pathtrue
movementIdStringThe id of the movementpathtrue
bodyPatchOperationUpdate operations to be performed on the already existing movementbodytrue
fromAddressObject, StringAn object containing the startAddress & startPoint of the movement.bodytrue
toAddressObject, StringAn object containing the startAddress & startPoint of the movement.bodytrue
transportTypeStringThe transport type of the batch movement. The required types include: TRUCK, SHIP, AIR, and RAILbodytrue
startDateStringThe start date of the movement for the batchbodytrue
endDateStringThe end date the movement for the batch.bodytrue

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"
}