Skip to main content

Rest API


Weaver WMS API

Weaver WMS operates based on a REST API architecture, utilizing the HTTP protocol and its methods, such as:

  • GET – used to retrieve data (e.g., display a list of materials),
  • POST – creates new data (e.g., adds a new recipient),
  • PUT – updates previously added resources (e.g., modifies a material),
  • DELETE – used to delete data.

Incoming and outgoing data from the API is in JSON format. Each object is enclosed in curly braces, and its individual elements are separated by commas. Values of the elements are specified after their names, followed by a colon.

When sending requests to the local API, the Weaver WMS program must be running.

Swagger

You can test the functionality of individual URI addresses (endpoints) using Swagger included in the Weaver WMS program.

You can find your API address on the Weaver WMS Account page or by selecting the entity and clicking the pencil icon.

Example: https://apidemo.weaver365.com/swagger/index.html

Next, to gain full access, navigate to the Authentication tab and click the "Try it out" button. Now, in the places where "string" is entered, provide the WMS user login and password in quotation marks.

After filling in the fields, execute the request by clicking "Execute." A 200 status code indicates that the command was successfully executed.

You can also review the API structure in Swagger via a test panel, linked below.

Successful Swagger authorization

Once authorized, you can perform additional requests, appropriately filling in the required fields.

Below is an example of adding a recipient (fields not filled should be removed; in this case, only the required data has been completed).

Adding recipient example

Postman

Another way to test requests is through the Postman program.

To start, import the request collection:

  1. Open Swagger.
  2. Navigate to the JSON format page.

Swagger JSON format

  1. Select all text (Ctrl + A) and copy it (Ctrl + C).
  2. In the main Postman window, click the "Import" button in the top-left corner.
  3. Go to the "Raw text" tab and paste the previously copied text.

After completing these steps, a "WMS API" collection should appear in the Collections tab on the left menu.

You also need to configure the environment:

  1. Click the "Manage Environments" icon in the top-right corner.

Postman manage environments

  1. Click "Add," then fill in the fields as shown in the screenshot below, and click "Add" again.

Environment configuration in Postman

  1. In the top-right corner, select the newly added environment from the list.

In Postman, you also need to authorize before performing further requests. To do this, select /auth/sign-in from the added collection, go to the Body section, and replace the default values with the WMS user login and password.

When making individual requests, remove any fields that are not filled in, as this may cause errors.

Adding Material

Adding Material Request in Postman

{"Selected":false,
"Type":3,
"Reference":" HD2285",
"Name":"Bezprzewodowy skaner 22Bluetooth HD85",
"DefaultQuantityInContainer":0.0,
"Removed":false,
"Inactive":false,
"SingleUnitPrice":0.0,
"Unit":
{
"Description":"szt.",
"DescriptionEng":"pcs",
"DescriptionDe":"psc",
"DescriptionRu":"psc",
"Details":"sztuka",
"IsLenght":false,
"Precision":4,
"IsDefault":false,
"Id":1
},
"TaxRate":{
"Value":0.23000,
"Name":"23%",
"IsDefault":false,
"TaxRateLegalType":0,
"Id":1
},
"SuggestedPlace":{
"Selected":false,
"Reference":"MAG_S1_0_0",
"Level":0,
"Number":0,
"QuantityOfMaterial":0.0,
"Id":1
},
"PercantageProfit":0.0,
"InitialQuantity":0.0,
"HasChildren":false,
"IsOnMachines":false,
"IsDangerous":false,
"CountSeparately":false,
"AdvisingQuantity":0.0,
"Length":0.0,"Width":0.0,
"Height":0.0,
"PackageRequireReference":false,
"PackageDoNotAddToShippingDocument":false,
"PackageIsTemporary":false,
"PackageType":0,
"RequiredQuantity":0.0,
"OnCustomOrder":false,
"LengthIsWidth":false,
"AbcClass":0,
"XyzClass":0,
"MaterialTradeInfo":{
"IsEcommerceShopPosition":true,
"IsEcommerceAuctionPosition":false,
"Id":0},"LengthStrategy":0,
"WidthStrategy":0,
"HeightStrategy":0,
"SplitPayment":false,
"RequireLotNumber":false,
"RequireLotExpiration":false,
"Id":0
}

!Material preview in Postman

Material preview added via Postman.

Adding Recipient

Adding Recipient in Postman

{ 
"reference": "HDWR",
"nameLine1": "HDWR",
"nameLine2": "Hardware for business",
"removed": false,
"address": {
"street": "Os. Piastowskie 53",
"postalCode": "63-000",
"city": "Środa Wlkp",
"id": 0
},
"companyDetail": {
"nip": "786-165-45-57",
"nipCleaned": "7861654557",
"ueVatPayer": false,
"id": 481
},
"mail": "[email protected]",
"shippingAddressesCount": 0,
"multiplyQuantityWhileImportEdi": false,
"notificationSetting": {
"newOrderEmailSend": false,
"newOrderEmailJoinAttachement": false,
"id": 3737
},
"currency": {
"symbol": "PLN",
"name": "PLN",
"id": 1
},
"paymentWay": 0,
"paymentDays": 0,
"salesBlockade": false,
"creditLimit": false,
"creditLimitAmout": 0.00000,
"nip": "786-165-45-57",
"name": "Waever Software Andrzej Lenkowski",
"id": 473
}

Recipient preview in Postman

Recipient preview added in Postman.

Creating a Delivery Notification

To send a delivery notification, first retrieve the necessary data via GET from the relevant endpoints:

Retrieving Data for Delivery Notification in Postman

/suppliers?IncludeAllId=false&IdList=1 Another piece of information needed is the numbering, retrieved from the /document-numbers endpoint. Additionally, you can use the parameters IncludeAllTypes and Types.

The Types parameter for receipts can take the following values:

  • 0 - Order to supplier
  • 1 - External receipt
  • 2 - Internal revenue

Document Numbers Endpoint in Postman

Endpoint example:
/document-numbers?IncludeAllTypes=false&Types=1

The next set of data includes materials and VAT rates, retrieved from the /materials and /tax-rates endpoints respectively.
For VAT rates, the view cannot be filtered, so all rates available in the system must be downloaded.

Retrieving Materials Data in Postman

Endpoint example:
/materials?IncludeAllId=false&IdList=101

Retrieving VAT Rates in Postman

Endpoint:
/tax-rates

Once all the data has been retrieved, you can proceed to upload the acceptance acknowledgment via the /delivery-documents POST method.

For clarity, in the following example, data that do not need to be completed are included. For sections like supplier, material, unit, taxrate, document-number, and currency, only the id needs to be entered.

Adding External Receipt in Postman

Adding External Receipt

Endpoint:
/delivery-documents

{"Selected":false,
"Number":"PZ/2021/4",
"IssueDate":"2021-03-08T11:23:14.08771+01:00",
"PlannedDate":"2021-03-08T11:23:14.08771+01:00",
"DocumentStatus":0,
"DocumentType":0,
"Supplier":{
"Reference":"Andrzej Lenkowski Weaver Software",
"NameLine1":"Andrzej Lenkowski Weaver Software",
"CompanyDetail":{
"Nip":"7861654557"
},
"Id":1
},
"Positions":[{
"PlannedQuantity":2.0,
"Material":{
"Reference":"MAT1",
"Name":"Testowy",
"Id":101
},
"NetUnitPrice":0.0,
"Unit":{
"Description":"szt.",
"Id":1
},
"TaxRate":{
"Value":0.23000,
"Id":11
},
"Status":0,
"Orgin":0,
"NetUnitPriceInCurrency":55.0,
"Page":0,
"PositionOrder":0,
"No":0,
"Id":-1
}],
"Owner":{
"Reference":"Andrzej Lenkowski Weaver Software",
"IsOwner":true,
"Id":1
},
"DocumentNumber":{
"DocumentType":1,
"DocumentName":"PZ",
"Number":3,
"Next":"PZ/2021/4",
"Id":3
},
"Currency":{
"Symbol":"PLN",
"Name":"PLN",
"Id":1
},
"Id":0}

Downloading the Realized Documents of Reception

To download the exact data of the realized PZ (goods receipt) documents, you must first retrieve the data from the /delivery-documents endpoint.

Retrieving Delivery Documents in Postman

Endpoint:
/delivery-documents

This operation returns a list of delivery documents with their statuses. The document status is indicated by the documentStatus parameter, which can take the following values:

  • 0 - Pending
  • 15 - Cancelled
  • 20 - In progress
  • 30 - Realized

Once you have identified the IDs of the completed receipt documents (documentStatus: 30), you can query the /delivery-documents/position-items endpoint to fetch detailed data.
Use the IncludeAllDocuments and Documents parameters with the values false and the specific document ID, respectively.

Fetching Position Items in Postman

Endpoint example:
/delivery-documents/position-items?IncludeAllDocuments=false&Documents=105


Forwarding the Release Advancement

To transmit a release advancement, the process differs slightly. Instead of a supplier, retrieve the recipient from the /recipients endpoint.

When fetching numbering for release documents, the Types parameter takes different values:

  • 3 - Orders from recipients
  • 4 - External releases
  • 5 - Internal disbursements

Retrieving Release Document Numbers in Postman


Adding an External Release Document

To add an external release document, use the /shipping-documents POST endpoint.

Endpoint:
/shipping-documents

Ensure all relevant data is retrieved and structured before performing this operation.

{
"Number":"WZ/2021/2",
"IssueDate":"2021-03-08T13:18:05.2976294+01:00",
"PlannedDate":"2021-03-08T13:18:05.2976294+01:00",
"Status":0,
"Recipient":{
"Reference":"Andrzej Lenkowski Weaver Software",
"NameLine1":"Andrzej Lenkowski Weaver Software",
"CompanyDetail":{
"Nip":"7861654557"
},
"Id":1
},
"Positions":[{
"PlannedQuantity":10.0,
"Material":{
"Reference":"MAT1",
"Name":"Testowy",
"Id":101
},
"NetUnitPriceBeforeDiscount":150.0,
"Unit":{
"Description":"szt.",
"Id":1
},
"TaxRate":{
"Value":0.23000,
"Id":11
},
"Status":0,
"PositionOrder":0,
"Id":-1
}],
"Currency":{
"Symbol":"PLN",
"Id":1
},
"ShippingAddress":{
"Name":"Weaver Software ",
"Street":"os. Piastowskie 53",
"PostalCode":"63-000",
"City":"Środa Wielkopolska",
"ContactPerson":"Bartosz Walerowicz",
"PhoneNumber":"690042333",
"Email":"[email protected]",
"Country":{
"Name":"Polska",
"Id":1
},
"Id":1
},
"DocumentNumber":{
"DocumentType":4,
"DocumentName":"WZ",
"Number":1,
"ActualPattern":"[Nazwa]/[Rok]/[Numer]",
"Next":"WZ/2021/2",
"Id":12
}
}

Downloading WZ Documents

To retrieve WZ (release) documents, you can apply filters to refine the results. In the following example, WZ documents created after the date 01/09/2020 are downloaded and divided into 2 items per page.

Retrieving WZ Documents


Downloading Logistics Units for the Owner

To download all suppliers that can act as owners, use the /suppliers endpoint with the IsOwner parameter set to true.

Endpoint:
/suppliers?IsOwner=true

Retrieving Suppliers with Ownership

To retrieve logistic units assigned to a specific owner, use the /logistic-units endpoint with the following parameters:

  • IncludeAllOwners: Set to false to filter for a specific owner.
  • Owners: Specify the owner ID.

Endpoint example:
/logistic-units?IncludeAllOwners=false&Owners=1

Retrieving Logistic Units for a Specific Owner

Client Api

Installation of Libraries for Connecting to the Weaver WMS System API

Steps to Install Libraries:

  1. Download the NuGet package bundle from the Weaver WMS website. For example, the latest version at the moment: apiClientNuGet_5.15.0.0.zip.
  2. Extract the package and add the folder to the NuGet Package Manager's sources.
  3. Install the Weaver.Wms.Api.Client package.

https://github.com/HDWR-Global/WmsApiClient

Example Code for Retrieving Materials located in Program.cs:

Code in C#

using Weaver.Wms.Api.Client.Interfaces;

namespace WmsApiClient
{
internal static class Program
{
static async Task Main(string[] args)
{
var client = new Weaver.Wms.Api.Client.WmsApiClient("http://localhost:43400", true);
await client.Login("admin", "admin");
Console.WriteLine("Materiały:");
int page = 0;
int pages = 1;
while (page < pages)
{
page++;
var materials = await client.CreateRequest<IMaterialClient>().List(new Weaver.Wms.ServiceInterfaces.MaterialService.MaterialFilterDto { Page = page });
pages = materials.Pages;
foreach (var material in materials.Items)
{
Console.WriteLine($"{material.Reference} - {material.Name}");
}
}
await client.Logout();
}
}
}