Skip to main content

What API can I use to insert longitude latitude for customer location, I found in customer location api but I don't find longitude latitude field? 

@abdi You should extended the CustomerLocation endpoint as those fields are not available in the OOB definition.

See in the following image the 2 fields being added at the bottom of the grid:

 

I am attaching a customization project that installs this extension in case you’d like to test it locally.

After that, you can refer to those fields in your PUT request:

 

Result

 


hi @Fernando Amadoz Thank you so much, in API url in params $filter what value should i fill in?


hi @Fernando Amadoz Thank you so much, in API url in params $filter what value should i fill in?

 


@abdi to insert/update records, in most cases you do not need to specify the filter parameter in the URL. It is indicated in the payload.

Acumatica identifies the record based on the primary key definition.

Example

PUT: http:///Instance]/entity/DefaultSetup/20.200.001/CustomerLocation

{
"Customer": {
"value": "AACUSTOMER"
},
"LocationID": {
"value": "1006"
},
"LocationName": {
"value": "TESTABC"
},
"AddressOverride": {
"value": "true"
},
"LocationContact": {
"Address": {
"AddressLine1": {
"value": "Line1"
},
"AddressLine2": {
"value": ""
},
"City": {
"value": "Cleveland"
},
"Country": {
"value": "US"
},
"Latitude": {
"value": "211"
},
"Longitude": {
"value": "322"
}

},
"DisplayName": {
"value": "DisplayName"
},
"Attention" : {
"value": "Attention"
}
}
}

For customer Location, the primary key is: Customer, LocationID.

If Acumatica does not identify this combination as created in the DB, then a new record will be created.

If the record does exist in the DB, then the specific values indicated are updated.

For instance, this reduced payload will update Latitude info only:

{
"Customer": {
"value": "AACUSTOMER"
},
"LocationID": {
"value": "1006"
},
"LocationContact": {
"Address": {
"Latitude": {
"value": "511"
}

},
}
}

 


hi @Fernando Amadoz I have tried but instead create a new customer location instead of updating, such as copying data from the customer and the latitude and longitude remains unfilled, I also tried to update the PostalCode field and the results did not change

 

 

 

 

 

 


@abdi 

Your payload looks correct.

I’d suggest testing it using a SalesDemo environment without customizations.


Hi @Fernando Amadoz is there any other solution?


@abdi 

Testing in a fresh demo environment would be my most immediate suggestion.

This will allow you to discard if it’s a customization or data issue.


@abdi 

Were you able to test it in a fresh environment?


Reply