Create a Job 500 Internal Server Error. Why?

We are testing Create a Job, but we get an error.
Please, Can you help us?

Error in callExternalRestPostJsonWebservice
org.springframework.web.client.HttpServerErrorException: 500 Internal Server Error

Please, can you help us?

Headers
{Content-Type=[application/json],
authorization=[Bearer ad1bXXXXXXXXXXXXXXXXXXXXXXX9]}

url
https://sandbox-api.stuart.com/v2/jobs

JSON
{
“job”:{
“pickups”:[
{
“address”:“Calle del Camino de Vinateros 1”,
“comment”:“Preguntar por Fermin”,
“contact”:{
“firstname”:“Boss”,
“lastname”:“First”,
“company”:“Moratalaz”,
“phone”:“91 555 77 22”,
“email”:"emailBoss@stuart.com"
}
}
],
“dropoffs”:[
{
“address”:“Calle del Corregidor Diego de Valderrábano 25, 28030 Madrid”,
“comment”:“piso 2, puerta izq.”,
“contact”:{
“firstname”:“Tomas”,
“phone”:“654466999”
}
}
],
“transport_type”:“motorbike”
}
}

Hello @carlosMshop

When trying your JSON I noticed several issues:
First the phone numbers are not valid, we recommend you to use the international format:
+34915557722 instead of 91 555 77 22 for the pickup phone number and
+34654466999 instead of 654466999 for the dropoff phone number.
Please refer to How should I format phone numbers? for more details.

In addition the pickup address is not in our zone coverage. You can check it by using our Validate address endpoint or Validate Job parameters. All the best practices related to the addresses are described in the following topic: What are the addresses best practices?

Feel free to ask if it is not clear or if you have any other question.
Best,

In addition to my previous answer we noticed that you send Calle del Corregidor Diego de Valderr\xE1bano 25, 28030 Madrid as the dropoff address. There is an encoding issue on the á. We are expecting an UTF-8 encoding.

Hello

Both addresses have been validated OK for your “validate” service
and the same error keeps coming.
org.springframework.web.client.HttpServerErrorException: 500 Internal Server Error
Can you help us, please?
{
“job”:{
“pickups”:[
{
“address”:“Calle del Camino de los Vinateros 1, 28030 Madrid”,
“comment”:“Preguntar por Alcampo”,
“contact”:{
“firstname”:“Encagardo”,
“lastname”:“Alcampo”,
“company”:“Alcampo Moratalaz”,
“phone”:“+34914376012”,
email":"emailTienda@yopmail.com
}
}
],
“dropoffs”:[
{
“address”:“Calle del Corregidor Diego de Valderrábano 25, 28030 Madrid”,
“comment”:“piso 2, puerta izq.”,
“contact”:{
“firstname”:“Raul”,
“phone”:“+34654666999”
}
}
],
“transport_type”:“motorbike”
}
}

Can you try without the strange \xE1 character in the dropoff address String?
You are currently sending us: Calle del Corregidor Diego de Valderr\xE1bano 25, 28030 Madrid but we are expecting UTF-8 encoding only so it leads to an invalid byte sequence in UTF-8 error.

OK i have tested this address Calle del Corregidor Diego de Valderrabano 25, 28030 Madrid.
the result is ERROR,:

{“error”:“RECORD_INVALID”,“message”:“Unable to save record”,“data”:{“deliveries”:[“is invalid”,“Origin place: can’t be blank”,“Origin place: Address: This location is out of range”]}}

We have validated the two addresses with your “validate” service, and both return us ok. Why does he tell us something else here?

JSON Create Job
{
“job”:{
“pickups”:[
{
“address”:“Calle del Camino de los Vinateros 1, 28030 Madrid”,
“comment”:“Preguntar por Alcampo”,
“contact”:{
“firstname”:“Encagardo”,
“lastname”:“Alcampo”,
“company”:“Alcampo Moratalaz”,
“phone”:“+34914376012”,
email":"emailTienda@yopmail.com
}
}
],
“dropoffs”:[
{
“address”:“Calle del Corregidor Diego de Valderrabano 25, 28030 Madrid”,
“comment”:“piso 2, puerta izq.”,
“contact”:{
“firstname”:“Raul”,
“phone”:“+34654666999”
}
}
],
“transport_type”:“motorbike”
}
}

Good, so the error was indeed about the UTF-8 encoding.

In fact the Calle del Camino de los Vinateros 1, 28030 Madrid is indeed out of range, the address you validated before was not exactly the same but CC Moratalaz Camino De Vinateros, 28030 Madrid.
Notice also that when using the validate address endpoint you must specify either picking or delivering type from which the zone coverage depends on.

To deliver from the address above we recommend you to use the following address as the pickup address: Alcampo Moratalaz, Calle del Camino de los Vinateros, s/n, 28017 Madrid, Spain which is inside the picking zone.

this changes are ok

Ok thanks