Skip to main content

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​

  1. Unique Identification: Each delivery note has a unique identifier id that distinguishes them from other delivery notes in the system.

  2. Unique ID: Each delivery note has a unique identifier id that distinguishes it from other delivery notes in the system.

  3. 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.

  4. Company: A delivery note must have a company associated with it.

  5. Customer: There must be a customer associated with each delivery note. The customer is a business partner with the role of Client.

  6. 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.

  7. Season: A delivery note must also have a Season associated with it. This is used to obtain reports on delivery notes by season.

  8. Discounts: A delivery note may have discounts associated with it.

  9. 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​
NameDescriptionTypeDefault Value
idDeliveryNote IdString optionalid
pagePage numberInteger1
pageSizeNumber of items per pageInteger10
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:

  1. 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🌱

  2. Client Business Partner: Make sure that the Business Partner you are going to assign to the delivery note in the clientId parameter has the Client role 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🌱

  3. 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 agentId parameter has the Sales Representative role 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🌱

  4. Order: It is necessary to make sure that the Order you are going to associate to the delivery note through the orderId parameter 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🌱

  5. Season: You must attach a correct reference to a Season through the seasonId parameter. 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🌱

  6. 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 idRemote for each discount. The system will automatically create a local id for each new discount you create this way.

  7. 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 productId must exist in the system. In addition, each line is related to an Order (orderId). By creating lines, you can assign an idRemote to each one. The system will automatically create a local id. 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:​
NameDescriptionType
idRemoteIdentifier of the new Delivery NoteString
companyIdIdentifier of the Company related to the new Delivery NoteString
clientIdIdentifier of the Business Partner with the client role related to the new Delivery NoteString
agentIdIdentifier of the Business Partner with the agent role related to the new Delivery NoteString
orderIdIdentifier of the Order associated with the new Delivery NoteString
linesLines of the Delivery Note. It includes detailed information about the content of the new Delivery NoteArray
shipperName of the company that will handle the shippingString
packsNumber of packagesInteger
grossAmountGross amountDecimal
baseAmountBase amountDecimal
totalAmountTotal amountDecimal
totalQuantityTotal quantity of productsDecimal

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​
NameDescriptionType
idDelivery Note identifierString 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​
NameDescriptionType
idDelivery Note identifierString required

πŸ‘‰Try it out🌱

Possible Response Errors​

ErrorResponse StatusResponse 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"}