Location Endpoints
The Location entity represents a place associated with a business partner. Each location includes a series of attributes that describe it as well as information relevant to business partners.
Common Location Characteristicsβ
-
Unique Identification: Each location has a unique identifier
idthat distinguishes them from other locations in the system. It also has anidRemotefield, which refers to the id that may be stored in the client's ERP database. -
Location Data: Typically, a location has associated information such as name, address, city, state, postal code and other contact details.
-
Activities and Logging: Activities performed by a location within the system, such as creation, modification, or deletion of resources, may be logged.
-
Business Partner: Basic information about the business partner to which the location belongs, such as contact name and business name, is stored.
Importance in the APIβ
Our API offers specific endpoints to manage and manipulate locations within the system. These endpoints enable operations such as creation, updating, retrieval, and deletion of location information in a structured and secure manner.
Endpointsβ
GET/Location/getLocationβ
Retrieve a paginated list of locations.
Descriptionβ
This endpoint retrieves a paginated list of locations from the system. It allows clients to fetch locations data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each location, including their ID, idRemote, business partner information, name, address, city, state, postal code, country, created at and last update timestamp.
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
id | Location Id | Integer optional | 1 |
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"idRemote": "string",
"businessPartner": {
"id": "string",
"idRemote": "string",
"contactName": "string",
"commercialName": "string"
},
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"default": true,
"active": true,
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XMLβ
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<businessPartner>
<id>string</id>
<idRemote>string</idRemote>
<contactName>string</contactName>
<commercialName>string</commercialName>
</businessPartner>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<default>true</default>
<active>true</active>
<shippingAddress>true</shippingAddress>
<billingAddress>true</billingAddress>
<country>
<id>string</id>
<description>string</description>
<iso>string</iso>
</country>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
πTry it outπ±
GET/Location/updatedFromβ
Retrieve locations from a modification date
Descriptionβ
This endpoint retrieves a paginated list of locations from the system, starting from a specific modification date using the parameter date. It allows clients to fetch locations data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each location, including their ID, idRemote, business partner information, name, address, city, state, postal code, country, created at and last update timestamp.
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
date | Updated Date | String required | 1999-01-01 |
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"idRemote": "string",
"businessPartner": {
"id": "string",
"idRemote": "string",
"contactName": "string",
"commercialName": "string"
},
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"default": true,
"active": true,
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XMLβ
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<businessPartner>
<id>string</id>
<idRemote>string</idRemote>
<contactName>string</contactName>
<commercialName>string</commercialName>
</businessPartner>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<default>true</default>
<active>true</active>
<shippingAddress>true</shippingAddress>
<billingAddress>true</billingAddress>
<country>
<id>string</id>
<description>string</description>
<iso>string</iso>
</country>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
πTry it outπ±
POST/Location/createβ
Location Registration in the API: Using the POST Methodβ
Currently, our POST method in the API exclusively handles JSON format. To effectively register locations, it is crucial to follow a process that ensures data integrity and proper system functionality.
Registration Process:β
- Creation of Business Partner:
To create a location, it is mandatory to relate it to a Business Partner. The
businessPartnerIdattribute must contain a valid identifier registered in the database.
πRegister Business Partnerπ±
Mandatory Parameters:β
| Name | Description | Type |
|---|---|---|
idRemote | Identifier of the new Location | String |
businessPartnerId | Identifier of the Business Partner to whom the new Location will be assigned | String |
countryId | Identifier of the Country of the new Location | String |
name | Name of the new Location | String |
address | Address of the new Location | String |
city | Name of the city of the new Location | String |
shippingAddress | Indicates whether the new Location should be set as the shipping address | Boolean |
billingAddress | Indicates whether the new Location should be set as the billing address | Boolean |
active | Indicates whether the new Location is active | Boolean |
default | Indicates whether the new Location is the default location | Boolean |
countryId | Country Id | String |
A complete request must follow the following outline:
[
{
"idRemote": "string",
"businessPartnerId": "string",
"name": "string",
"address": "string",
"city": "string",
"stateId": "string",
"countryId": "string",
"postalCode": "string",
"default": true,
"active": true,
"shippingAddress": true,
"billingAddress": true,
"countryId": "string"
}
]
It is possible to add multiple locations through the same request by separating them with commas within the array in the body of the request.
πTry it outπ±
PUT/Location/update/{id}β
Updating locations
Descriptionβ
The PUT method of our API allows clients to update locations data using the id parameter. This id field can be either the B2B system's own identifier or the idRemote you provide when registering locations on our platform. In this way, our platform guarantees efficient and accurate location information management.
Please note that you can update any attribute of an existing Location except the Business Partner assigned to it through this endpoint. If you want to update this information you must do so from the Business Partner update endpoint.
πBusiness Partner Endpointsπ±
Parametersβ
| Name | Description | Type |
|---|---|---|
id | Location identifier | String required |
It is not necessary to include the entire JSON structure, you should only include the attributes you want to modify.
Request body:β
To fully update a Location, the request body must follow the following scheme:
{
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"stateId": "string",
"postalCode": "string",
"default": true,
"active": true,
"shippingAddress": true,
"billingAddress": true,
"countryId": "string",
}
πTry it outπ±
DELETE/Location/delete/{id}β
Removing Locations
Descriptionβ
This endpoint allows the deletion of locations using their unique identifier. This id field can be either the identifier generated by the B2B database or the idRemote you provide when registering locations. Once deleted, the Location is recorded in the Deleted History.
β οΈA Location that has a Business Partner associated with it cannot be deleted.
Parametersβ
| Name | Description | Type |
|---|---|---|
id | Location identifier | String required |
πTry it outπ±
Possible Response Errorsβ
| Error | Response Status | Response Body |
|---|---|---|
| This error occurs when a connection to the database cannot be established. It is an internal server problem. | 500 | {"code": 500,"error": "Database connection failed."} |
| This error occurs when you cannot insert or update items into the database. | 500 | {"code": 500,"error": "Invalid connection name, you cannot insert in default"} |
| This error occurs when a parameter is missing. | 400 | {"code": 400,"error": "Parameter $parameter is required"} |
| This error occurs when you are not authorized. | 401 | {"code": 401,"error": "Unauthorized."} |
| This error occurs when the Location could not be found. | 404 | {"code": 404,"error": "No entity found for Location with $id."} |
| This error occurs when you try to insert a Location that already exists. | 409 | {"code": 409,"error": "Duplicate entry"} |
| This error occurs when you try to send too many requests in a short period of time. | 429 | {"code": 429,"error": "Too Many Requests"} |