Delivery Note Endpoints
In the context of our API, a delivery note represents an important entity. It has been designed to identify and record key information on delivery notes. This registry allows companies, clients, seasons and orders to be assigned efficiently and accurately.
Common Delivery Note Characteristicsβ
-
Unique Identification: Each delivery note has a unique identifier
idthat distinguishes them from other delivery notes in the system. -
Unique ID: Each delivery note has a unique identifier
idthat distinguishes it from other delivery notes in the system. -
Delivery Note Data: A delivery note includes information about the shipment of a particular order. It includes data such as carrier, quantity shipped, taxes, weight, etc.
-
Company: A delivery note must have a company associated with it.
-
Customer: There must be a customer associated with each delivery note. The customer is a business partner with the role of
Client. -
Agent: In addition, a delivery note 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
Sales Representative. -
Season: A delivery note must also have a Season associated with it. This is used to obtain reports on delivery notes by season.
-
Discounts: A delivery note may have discounts associated with it.
-
Lines: A delivery note is made up of lines. Each line of the delivery note corresponds to the product or service requested. The lines store information about the quantity and price of each product or service delivered.
Endpointsβ
GET/DeliveryNote/getDeliveryNoteβ
Retrieve a paginated list with Delivery Notes in the system.
Descriptionβ
This endpoint retrieves a paginated list of all existing packing slips in the system. It allows clients to retrieve packing slip data based on pagination parameters such as page number (page) and number of items per page (pageSize). The response includes detailed information about each packing slip, including its remote and local ID, representative, last updated timestamp, company, customer, order, season, and discount information.
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
id | DeliveryNote Id | String optional | id |
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"idRemote": "string",
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string"
},
"client": {
"id": "string",
"idRemote": "string",
"contactName": "string"
},
"agent": "string",
"order": {
"id": "string",
"idRemote": "string"
},
"season": {
"id": "string",
"idRemote": "string",
"description": "string",
"seasonPos": 0,
"seasonType": "string",
"active": true
},
"discount": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"sequence": 0,
"discount": 0,
"amountDiscount": 0,
"isHeader": true
}
],
"lines": [
{
"id": "string",
"idRemote": "string",
"product": {
"id": "string",
"idRemote": "string",
"reference": "string"
},
"order":{
"id": "string",
"idRemote": "string"
},
"discount": [
{
"id": "string",
"idRemote": "string",
"discount": "string",
"amountDiscount": "string"
}
],
"lineAmount": 0,
"quantity": 0,
"price": 0
}
],
"shipper": "string",
"packs": 0,
"grossAmount": 0,
"baseAmount": 0,
"shippingAmount": 0,
"taxAmount": 0,
"taxrecAmount": 0,
"totalAmount": 0,
"totalQuantity": 0,
"totalWeight": 0,
"updatedAt": "string",
"createdAt": "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>
<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>
<order>
<id>string</id>
<idRemote>string</idRemote>
</order>
<season>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
<seasonPos>0</seasonPos>
<seasonType>string</seasonType>
<active>true</active>
</season>
<discount>
<id>string</id>
<idRemote>string</idRemote>
<discount>0</discount>
<amountDiscount>0</amountDiscount>
<isHeader>true</isHeader>
<isEarlyPayment>true</isEarlyPayment>
</discount>
<lines>
<id>string</id>
<idRemote>string</idRemote>
<product>
<id>string</id>
<idRemote>string</idRemote>
<reference>string</reference>
</product>
<order>
<id>string</id>
<idRemote>string</idRemote>
</order>
<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>
<isHeader>true</isHeader>
</discount>
<lineAmount>0</lineAmount>
<quantity>0</quantity>
<price>0</price>
</lines>
<shipper>string</shipper>
<packs>0</packs>
<grossAmount>0</grossAmount>
<baseAmount>0</baseAmount>
<shippingAmount>0</shippingAmount>
<taxAmount>0</taxAmount>
<taxrecAmount>0</taxrecAmount>
<totalAmount>0</totalAmount>
<totalQuantity>0</totalQuantity>
<totalWeight>0</totalWeight>
<updatedAt>string</updatedAt>
<createdAt>string</createdAt>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
πTry it outπ±
POST/DeliveryNote/createβ
Factors to considerβ
This endpoint is used to create a new delivery note through the data attached in the body of the request. Before creating a new delivery note, you must take into account the following factors:
-
Company: Before registering a delivery note, make sure that the Company you are going to assign to it exists. If the assigned company does not exist, the response will return an error. For more information on how to create a Company, follow this link: πCreate a Companyπ±
-
Client Business Partner: Make sure that the Business Partner you are going to assign to the delivery note in the
clientIdparameter has theClientrole and belongs to the same Company as the Delivery Note issuer. If you attach an incorrect Client Business Partner, the response will return an error. For more information on how to create a Business Partner follow this link: πCreate a Business Partnerπ± -
Agent Business Partner: It is crucial that you make sure that the Business Partner you are going to assign to the delivery note in the
agentIdparameter has theSales Representativerole and belongs to the same Company as the Delivery Note issuer. If you attach an incorrect agent, the response will return an error. For more information on how to create a Business Partner follow this link: πCreate a Business Partnerπ± -
Order: It is necessary to make sure that the Order you are going to associate to the delivery note through the
orderIdparameter is registered in the system. In addition, the order to be associated with the new record must belong to the same Company and Season as the delivery note you want to create. Otherwise, the response will return an exception. For more information about creating Orders, follow the link below: πCreate an Orderπ± -
Season: You must attach a correct reference to a Season through the
seasonIdparameter. You can find information on how to obtain existing Seasons, or how to register a new Season in the system through this link: πCreate a Seasonπ± -
Discounts: Discounts are not a mandatory parameter. To enter a delivery note without discounts into the system, simply attach an empty array. You can set an
idRemotefor each discount. The system will automatically create a localidfor each new discount you create this way. -
Lines: The delivery note is made up of lines. These include information about the product or service that is sent to the customer. This is why the Product associated with each line through the parameter
productIdmust exist in the system. In addition, each line is related to an Order (orderId). By creating lines, you can assign anidRemoteto each one. The system will automatically create a localid. Likewise, you can associate discounts with each line of the Delivery Note. The process of creating discounts for each line corresponds to the process of creating discounts for the Delivery Note.
Mandatory Parameters:β
| Name | Description | Type |
|---|---|---|
idRemote | Identifier of the new Delivery Note | String |
companyId | Identifier of the Company related to the new Delivery Note | String |
clientId | Identifier of the Business Partner with the client role related to the new Delivery Note | String |
agentId | Identifier of the Business Partner with the agent role related to the new Delivery Note | String |
orderId | Identifier of the Order associated with the new Delivery Note | String |
lines | Lines of the Delivery Note. It includes detailed information about the content of the new Delivery Note | Array |
shipper | Name of the company that will handle the shipping | String |
packs | Number of packages | Integer |
grossAmount | Gross amount | Decimal |
baseAmount | Base amount | Decimal |
totalAmount | Total amount | Decimal |
totalQuantity | Total quantity of products | Decimal |
If you want to add Discounts to the Delivery Note, you must ensure that all parameters are mandatory.
All parameters of the Delivery Note lines are mandatory except for Line Discounts.
[
{
"idRemote": "string",
"companyId": "string",
"clientId": "string",
"agentId": "string",
"orderId": "string",
"seasonId": "string",
"discount": [
{
"idRemote": "string",
"discountType": "string",
"sequence": 0,
"discount": 0,
"amountDiscount": 0,
"isHeader": true
}
],
"lines": [
{
"idRemote": "string",
"productId": "string",
"orderId": "string",
"discount": [
{
"idRemote": "string",
"discount": 0,
"amountDiscount": 0
}
],
"lineAmount": 0,
"quantity": 0,
"price": 0
}
],
"shipper": "string",
"packs": 0,
"grossAmount": 0,
"baseAmount": 0,
"shippingAmount": 0,
"taxAmount": 0,
"taxrecAmount": 0,
"totalAmount": 0,
"totalQuantity": 0,
"totalWeight": 0
}
]
It is possible to add multiple delivery notes through the same request by separating them with commas within the array in the body of the request.
Responsesβ
In order not to saturate the server, this endpoint sends a message to a consumer in charge of processing the request. To check the status of the request sent, it is necessary to access the URL attached to the response. A response correctly sent to the consumer should look like this:
{
"code": 201,
"message": "Delivery note message created successfully and dispatched to the queue.",
"statusUrl": "http://host/api/database/v1/message/status/messageId"
}
The statusUrl field redirects us to a more detailed response about the status of the request. A request successfully processed by the consumer looks like this:
{
"data": [
{
"status": "completed",
"errorMessage": null
}
],
"pagination": {
"totalItems": 1,
"itemsPerPage": 10,
"currentPage": 1,
"totalPages": 1,
"nextPageUrl": null
}
}
If any error occurs during message processing, the response will look something like this:
{
"code": 400,
"error": "Invalid delivery note data format, a required parameter is missing"
}
πTry it outπ±
PUT/DeliveryNote/update/{id}β
Updating Delivery Notes
Descriptionβ
This endpoint allows clients to update delivery notes data using the id parameter. This id can be either the identifier generated by the B2B database or the idRemote you provide when registering delivery notes. This flexibility ensures you can easily integrate and synchronize existing data in your system with our platform, guaranteeing efficient and accurate delivery note information management.
Through this endpoint you can update existing Discounts or Lines in the Delivery Note to be updated. To do this, simply attach the idRemote of the Line or Discount you wish to modify.
Parametersβ
| Name | Description | Type |
|---|---|---|
id | Delivery Note identifier | String required |
No es necesario incluir toda la estructura JSON, solo debes incluir los atributos que quieras modificar.
Request Bodyβ
An update of all the fields of a Delivery Note should look like this:
{
"companyId": "string",
"clientId": "string",
"agentId": "string",
"orderId": "string",
"seasonId": "string",
"discount": [
{
"idRemote": "string",
"discountType": "string",
"sequence": 0,
"discount": 0,
"amountDiscount": 0,
"isHeader": true
}
],
"lines": [
{
"idRemote": "string",
"productId": "string",
"orderId": "string",
"discount": [
{
"idRemote": "string",
"discount": 0,
"amountDiscount": 0
}
],
"lineAmount": 0,
"quantity": 0,
"price": 0
}
],
"shipper": "string",
"packs": 0,
"grossAmount": 0,
"baseAmount": 0,
"shippingAmount": 0,
"taxAmount": 0,
"taxrecAmount": 0,
"totalAmount": 0,
"totalQuantity": 0,
"totalWeight": 0
}
πTry it outπ±
DELETE/DeliveryNote/delete/{id}β
Removing a Delivery Note.
Descriptionβ
This endpoint allows deleting delivery notes using their unique identifier, which can be either the B2B system's own id or the idRemote provided by you when registering the delivery notes on our platform. Deleting a delivery note cascade-deletes all its related lines and discounts. Once deleted, the Delivery Note is recorded in the Deleted History.
β οΈA Delivery Note cannot be deleted if it is related to an active Order or Invoice.
Parametersβ
| Name | Description | Type |
|---|---|---|
id | Delivery Note 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 Delivery Note could not be found. | 404 | {"code": 404,"error": "No entity found for Delivery Note with $id."} |
| This error occurs when you try to insert a Delivery Note 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"} |