Job.dropoffs must be filled

Hello there,
I am trying to Create a New Job in Stuart API - sandbox . This is the request I am sending.
{
“AssignmentCode”: “Andromeda123”,
“PickupAt”: null,
“TransportType”: null,
“Fleets”: null,
“Pickups”: null,
“dropoffs”: [
{
“id”: 0,
“package_type”: 2,
“package_description”: “The blue one.”,
“client_reference”: “Order_ID#1234_1”,
“address”: “42 rue rivoli, 75001 Paris”,
“Latitude”: 0.0,
“Longitude”: 0.0,
“comment”: “2nd floor on the left”,
“contact”: {
“firstname”: “Dany”,
“lastname”: “Dan”,
“phone”: “+33611112222”,
“email”: “client1@email.com”,
“company”: “Sample Company Inc.”
}
}
]
}

I have deliberately left the Pickups as null, because the error I am getting is ‘job.dropoffs must be filled.’ As you can see I am clearly providing the dropoffs data.
The complete error is like so -
{
“error”: “RECORD_INVALID”,
“message”: “Unable to save record”,
“data”: {
“job.dropoffs”: [
“must be filled”
]
}
}

Hey!

Thanks for your message!

I see there are strings that do not correspond to the request payload such as the latitude and longitude or the ID for the dropoffs, in order to understand better, where did you find them?

I allowed myself to add an equivalent request payload to align the format (adding also a pickup address so you can validate them both).

{
  "job": {
    "pickups": [
      {
        "address": "8 avenue des ternes, 75017 Paris"
      }
    ],
  "dropoffs": [
      {
        "package_type": "small",
        "address": "42 rue rivoli, 75001 Paris",
        "client_reference": "Order_ID#1234_1",
        "package_description": "The blue one.",
        "contact": {
          "firstname": "Dany",
          "lastname": "Dan",
          "phone": "+33611112222",
          "email": "client1@email.com",
          "company": "Sample Company Inc."
          }
      }
     ]
  }
}

Do not hesitate to contact if the problem persists.

Cheers

Thanks I see the issue. All the fields/properties are inside “job”, I was missing that obviously.

Thanks very much.

1 Like

Hello there,

How to i create multiple drop off (upto 8 ) in api.i created one pick up address to one drop off address but i need multi drop off for single pick up address. kindly help me for this.

Hello @Saran,

The dropoffs is an array, so you can add more than one dropoff object inside of it.
You can find an exemple in this post.

Cheers!