Order Endpoints
This API provides endpoints to obtain, add, modify or delete information related to the Order entity. This has information about the client, the agent, the product and its corresponding season.
Common Order Characteristicsβ
-
Unique identifier: The Order entity has a unique identifier that is used to distinguish it from other orders and reference it easily. It also has an
idRemotefield, which refers to the id that may be stored in the client's ERP database. -
Order Data: Typically, a order has associated information such as company, client, season, discount and other details.
-
Company: It is necessary to store basic information about the company that receives the order.
-
Customer: There must be a client associated with each order. The client is a business partner with the role of
Client. -
Agent: Additionally, an order must have an agent associated with it. This is the representative of the company that made the sale. An agent is a business partner with the role of
Representant. -
Season: Information is stored about the season in which the order was placed.
-
Discount: The Order entity stores information about the discounts applied to it.
-
Lines: Each line of the order corresponds to the product or service requested. The lines store information about the quantity and price of each product or service delivered. The lines have a status that specifies whether it is in stock, whether it is shipped or not, or whether it has been deleted.
Importance in the APIβ
Our API provides specific endpoints to manage and manipulate orders within the system. These endpoints enable operations such as creation, updating, retrieval, and deletion of order information in a structured and secure manner.
Endpointsβ
GET/Order/getOrderβ
Retrieve a paginated list with existing orders in the database.
Descriptionβ
Allows you to obtain a list of orders organized according to pagination parameters. It also includes information such as the company, the client, the agent, the season, the corresponding discount and additional details.
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
id | Order Id | String optional | id |
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"idRemote": "string",
"reference": "string",
"numOrder": "string",
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string"
},
"client": {
"id": "string",
"idRemote": "string",
"contactName": "string"
},
"agent": "string",
"status": "string",
"season": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"shippingAddress": "string",
"billingAddress": "string",
"discount": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"sequence": 0,
"discount": 0,
"amountDiscount": 0,
"isLine": true
}
],
"lines": [
{
"id": "string",
"idRemote": "string",
"lineStatus": "string",
"discount": [
{
"id": "string",
"idRemote": "string",
"discount": 0,
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"sequence": 0,
"discount": 0,
"amountDiscount": 0
}
],
"observations": "string",
"deliveryDate": "string",
"cancellationDate": "string",
"lineAmount": 0,
"quantity": 0,
"quantityServed": 0,
"quantityFromStock": 0,
"lineDetail": [
{
"id": "string",
"idRemote": "string",
"product": "string",
"quantity": 0,
"price": 0,
"retailPrice": 0
}
]
}
],
"dateOrder": "string",
"dateModified": "string",
"dateDelivery": "string",
"observation": "string",
"grossAmount": 0,
"baseAmount": 0,
"shippingAmount": 0,
"taxAmount": 0,
"taxrecAmount": 0,
"totalAmount": 0,
"totalQuantity": 0,
"quantityServed": 0,
"quantityPending": 0,
"shipper": "string",
"origin": "string",
"isSale": true,
"active": true,
"createdBy": {
"id": "string",
"idRemote": "string",
"username": "string"
},
"updatedBy": {
"id": "string",
"idRemote": "string",
"username": "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>Γ§
<reference>string</reference>
<numOrder>string</numOrder>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
</company>
<client>
<id>string</id>
<idRemote>string</idRemote>
<contactName>string</contactName>
</client>
<agent>string</agent>
<status>string</status>
<season>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</season>
<shippingAddress>string</shippingAddress>
<billingAddress>string</billingAddress>
<discount>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<sequence>0</sequence>
<discount>0</discount>
<amountDiscount>0</amountDiscount>
<isLine>true</isLine>
<isHeader>true</isHeader>
</discount>
<lines>
<id>string</id>
<idRemote>string</idRemote>
<lineStatus>string</lineStatus>
<discount>
<item>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<sequence>0</sequence>
<discount>0</discount>
<amountDiscount>0</amountDiscount>
</item>
</discount>
<observations>string</observations>
<deliveryDate>string</deliveryDate>
<cancellationDate>string</cancellationDate>
<lineAmount>0</lineAmount>
<quantity>0</quantity>
<quantityServed>0</quantityServed>
<quantityFromStock>0</quantityFromStock>
<lineDetail>
<id>string</id>
<idRemote>string</idRemote>
<product>string</product>
<quantity>0</quantity>
<price>0</price>
<retailPrice>0</retailPrice>
</lineDetail>
</lines>
<dateOrder>string</dateOrder>
<dateModified>string</dateModified>
<dateDelivery>string</dateDelivery>
<observation>string</observation>
<grossAmount>0</grossAmount>
<baseAmount>0</baseAmount>
<shippingAmount>0</shippingAmount>
<taxAmount>0</taxAmount>
<taxrecAmount>0</taxrecAmount>
<totalAmount>0</totalAmount>
<totalQuantity>0</totalQuantity>
<quantityServed>0</quantityServed>
<quantityPending>0</quantityPending>
<shipper>string</shipper>
<origin>string</origin>
<isSale>true</isSale>
<active>true</active>
<createdBy>
<id>string</id>
<idRemote>string</idRemote>
<username>string</username>
</createdBy>
<updatedBy>
<id>string</id>
<idRemote>string</idRemote>
<username>string</username>
</updatedBy>
<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/Order/getOrder/Statusβ
Retrieves a paginated list with the identifiers and description of the available statuses for the orders.
Descriptionβ
Local and remote identifiers are displayed in a paginated manner along with the status description. Pagination can be modified through these parameters:
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"value": true
}
],
"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>
<value>true</value>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
πTry it outπ±
GET/Order/getOrder/Line/Statusβ
Retrieve a paginated list with the identifiers and descriptions of the available statuses for order lines.
Descriptionβ
Local and remote identifiers are displayed in a paginated manner along with the status description. Pagination can be modified using these parameters:
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"value": true
}
],
"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>
<value>true</value>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
πTry it outπ±
GET/Order/updatedFromβ
Retrieve a paginated list of existing orders since the specified date in the parameters.
Descriptionβ
Allows obtaining a list of existing orders from the specified date. If no orders exist, an empty list is returned.
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
date | Last updated date | String required | 1999-01-01 01:00:00 |
status | Order Status | [String] | -- |
page | Page number | Integer | 1 |
pageSize | Items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"idRemote": "string",
"reference": "string",
"numOrder": "string",
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string"
},
"client": {
"id": "string",
"idRemote": "string",
"contactName": "string"
},
"agent": "string",
"status": "string",
"season": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"shippingAddress": "string",
"billingAddress": "string",
"discount": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"sequence": 0,
"discount": 0,
"amountDiscount": 0,
"isLine": true
}
],
"lines": [
{
"id": "string",
"idRemote": "string",
"lineStatus": "string",
"discount": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"sequence": 0,
"discount": 0,
"amountDiscount": 0
}
],
"observations": "string",
"deliveryDate": "string",
"cancellationDate": "string",
"lineAmount": 0,
"quantity": 0,
"quantityServed": 0,
"quantityFromStock": 0,
"lineDetail": [
{
"id": "string",
"idRemote": "string",
"product": "string",
"quantity": 0,
"price": 0,
"retailPrice": 0
}
]
}
],
"dateOrder": "string",
"dateModified": "string",
"dateDelivery": "string",
"observation": "string",
"grossAmount": 0,
"baseAmount": 0,
"shippingAmount": 0,
"taxAmount": 0,
"taxrecAmount": 0,
"totalAmount": 0,
"totalQuantity": 0,
"quantityServed": 0,
"quantityPending": 0,
"shipper": "string",
"origin": "string",
"isSale": true,
"active": true,
"createdBy": {
"id": "string",
"idRemote": "string",
"username": "string"
},
"updatedBy": {
"id": "string",
"idRemote": "string",
"username": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
TODO NEXT DAY
XMLβ
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<reference>string</reference>
<numOrder>string</numOrder>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
</company>
<client>
<id>string</id>
<idRemote>string</idRemote>
<contactName>string</contactName>
</client>
<agent>string</agent>
<status>string</status>
<season>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</season>
<shippingAddress>string</shippingAddress>
<billingAddress>string</billingAddress>
<discount>
<item>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<sequence>0</sequence>
<discount>0</discount>
<amountDiscount>0</amountDiscount>
<isLine>true</isLine>
</item>
</discount>
<lines>
<item>
<id>string</id>
<idRemote>string</idRemote>
<lineStatus>string</lineStatus>
<discount>
<item>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<sequence>0</sequence>
<discount>0</discount>
<amountDiscount>0</amountDiscount>
</item>
</discount>
<observations>string</observations>
<deliveryDate>string</deliveryDate>
<cancellationDate>string</cancellationDate>
<lineAmount>0</lineAmount>
<quantity>0</quantity>
<quantityServed>0</quantityServed>
<quantityFromStock>0</quantityFromStock>
<lineDetail>
<item>
<id>string</id>
<idRemote>string</idRemote>
<product>string</product>
<quantity>0</quantity>
<price>0</price>
<retailPrice>0</retailPrice>
</item>
</lineDetail>
</item>
</lines>
<dateOrder>string</dateOrder>
<dateModified>string</dateModified>
<dateDelivery>string</dateDelivery>
<observation>string</observation>
<grossAmount>0</grossAmount>
<baseAmount>0</baseAmount>
<shippingAmount>0</shippingAmount>
<taxAmount>0</taxAmount>
<taxrecAmount>0</taxrecAmount>
<totalAmount>0</totalAmount>
<totalQuantity>0</totalQuantity>
<quantityServed>0</quantityServed>
<quantityPending>0</quantityPending>
<shipper>string</shipper>
<origin>string</origin>
<isSale>true</isSale>
<active>true</active>
<createdBy>
<id>string</id>
<idRemote>string</idRemote>
<username>string</username>
</createdBy>
<updatedBy>
<id>string</id>
<idRemote>string</idRemote>
<username>string</username>
</updatedBy>
<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/Order/createβ
Order Registration in the API: Using the POST Methodβ
Currently, our POST method in the API exclusively handles JSON format. To effectively register orders, it is crucial to follow a process that ensures data integrity and proper system functionality.
Registration Process:β
-
Creation of Company: Before registering an order, it is necessary to ensure that there is an associated Company. This is important since users can have multiple companies. πRegister Companyπ±
-
Creation of Client: It is necessary to ensure that there is an associated Client and that it has the
Clientrole. Additionally, this customer must belong to the same company that placed the order. If an incorrect client is attached, the response will return an error. πRegister Clientπ± -
Creation of Agent: It is crucial to ensure that the Business Partner you assign to the order in the
agentIdparameter has theRepresentantrole and belongs to the same Company as the one placing the order. If an incorrect agent is attached, the response will return an error. πRegister Agentπ± -
Creation of Season: Before registering an order, it is necessary to ensure that the B2B is used for fashion, in this case a Season entity is created. If it is not used for fashion it is not necessary to have the Season. πRegister Seasonπ±
-
Shipping and Billing Addresses In order to register a new order in the system, you must enter both the shipping and billing addresses. These addresses must be registered as addresses for the ordering Business Partner. These addresses must be registered in the system with the appropriate role. For example, for the shipping address, it must be a Location with the
shippingAddressfield set totrue. You can configure locations when creating a new Business Partner or via the Locations endpoints. π Creating a new Business Partner π± π Endpoints for Locations π± -
Order Status: The reference to the Order Status must exist in the system. To view the available statuses for Orders you can use the endpoint described at the beginning of this documentation.
-
Discount: Discounts are not a mandatory parameter. To enter an order into the system without discounts, simply attach an empty array. You can set an
idfor each discount. Thisidcorresponds to the remote id that you want to assign. The system will automatically create a local id for each new discount you create in this way. -
Lines: An order is made up of lines. Each line includes information about the product or service that is sent to the client. For this reason, the Product associated with each line through the
productIdparameter must exist in the system. Additionally, each line is related to a State (lineStatusId). Through the creation of lines you can assign anidto each one, which corresponds to theidRemote. The system will create a local id automatically. In the same way, discounts can be associated with each Product line. The process of creating discounts for each line is similar to the previous process of creating discounts for an order.