Receiving documents

In order to receive documents from your trading partner via the Edisoft platform, you will need to use 3 API commands in sequence:

  • ‘ListMB’ or ‘ListMBAll’
  • ‘Receive’
  • ‘ChangeDocumentStatus’

 

1. Command ‘ListMB’ or ‘ListMBAll’

The ‘ListMB’ command allows you to get a list of documents based on the specified parameters. The parameters described in the table must be passed in the request:

Parameter

Description

Mandatory

Name

Login name

Yes

Password

Password

Yes

PartnerILN

ILN / GLN number of your partner

No

DocumentType

The type of document you want to receive (ORDER, INVOICE, DESADV, RECADV, etc.)

Yes

DocumentStatus

Select the document status:

N (New) – only new documents

R (Read) – only read documents

If no value is specified, all documents will be returned

No

 

Example of a request using the ‘ListMB’ command 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:wsedi">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:ListMB>
         <urn:Name>SomeName</urn:Name>
         <urn:Password>SomePassword</urn:Password>
         <urn:DocumentType>ORDER</urn:DocumentType>
         <urn:DocumentStatus>N</urn:DocumentStatus>
         <urn:Timeout>100</urn:Timeout>
      </urn:ListMB>
   </soapenv:Body>
</soapenv:Envelope>

The ‘ListMBAll’ command allows you to retrieve all documents assigned to you with the status N (New). The parameters described in the table must be passed in the request:

Parameter

Description

Mandatory

Name               

Login name

Yes

Password

Password

Yes

 

Example of a request using the ‘ListMBAll’ command

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:wsedi">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:ListMBAll>
         <urn:Name>SomeName</urn:Name>
         <urn:Password>SomePassword</urn:Password>
      </urn:ListMBAll>
   </soapenv:Body>
</soapenv:Envelope>

 

After executing the ‘ListMB’ or ‘ListMBAll’ command, the Edisoft system will send data about the requested documents. The following fields will be provided in the response:

Field

Description

<partner-iln>

ILN / GLN number of the partner from whom the document was received

<tracking-id>

Document number in the EDI platform

<document-type>

Document type (ORDER, INVOICE, DESADV, RECADV, etc.)

<document-status>

Document status (N – new, R – read)

<document-number>

The document number specified by the sender

<document-date>

Document date

<document-control-number>

Document control number

<receive-date>

Date of receipt of the document

<file-name>

File name

Example of a response using the ‘ListMB’ or ‘ListMBAll’ command

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ListMBAllResponse xmlns="urn:wsedi">
            <ns1:ListMBAllResult xmlns:ns1="urn:wsedi">
                <ns1:Res>00000000</ns1:Res>
                <ns1:Cnt><![CDATA[<mailbox-response>
<document-info>
    <partner-iln>2000000000109</partner-iln>
    <tracking-id>14768804</tracking-id>
    <document-type>ORDER</document-type>
    <document-version>1.0</document-version>
    <document-standard>XML</document-standard>
    <document-test>P</document-test>
    <document-status>New</document-status>
    <document-number>ORD0001</document-number>
    <document-date>2023-01-26</document-date>
    <document-control-number></document-control-number>
    <receive-date>2023-01-26T10:27:23</receive-date>
    <file-name>ORDER_20230126102724016_0a0055e62d374991abbe06b262704f4a.xml</file-name>
</document-info>
</mailbox-response>]]></ns1:Cnt>
            </ns1:ListMBAllResult>
        </ListMBAllResponse>
    </soapenv:Body>
</soapenv:Envelope>

 

2. Command ‘Receive’

The ‘Receive’ command allows you to receive EDI documents according to the specified parameters. The request must pass the parameters described in the table:

Parameter

Description

Mandatory

Name               

Login name

Yes

Password

Password

Yes

PartnerILN

ILN / GLN number of your partner

Yes

DocumentType

The type of document you want to receive (ORDER, INVOICE, DESADV, RECADV, etc.)

Yes

TrackingId

Document number in the EDI platform

Yes

DocumentStandard

Document format (EDIFACT, XML, CSV, etc.)

No

Timeout

Request execution time, specified as an integer (ms)

Yes

Mandatory parameters (PartnerILN, DocumentType, TrackingId) are obtained after executing the first command ‘ListMB’ or ‘ListMBAll’. Documents with a status of R (Read) cannot be retrieved.

 

Example of a request using the ‘Receive’ command

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:wsedi">
    <soapenv:Header/>
    <soapenv:Body>
        <urn:Receive>
            <urn:Name>SomeName</urn:Name>
            <urn:Password>SomePassword</urn:Password>
            <urn:PartnerIln>2000000000109</urn:PartnerIln>
            <urn:DocumentType>ORDER</urn:DocumentType>
            <urn:TrackingId>14768804</urn:TrackingId>
            <urn:Timeout>100</urn:Timeout>
        </urn:Receive>
    </soapenv:Body>
</soapenv:Envelope>

 

After executing the ‘Receive’ command, the Edisoft system will send the result. The response will contain the following fields:

Field

Description

<ns1:res>

Confirmation or an error code

<ns1:cnt>

A complete Edisoft XML format document is embedded inside CDATA

 

Possible error codes and their descriptions:

Error code Description
00000000 API operation completed successfully
00000001 Authentication error
00000003 Invalid parameters
00000004 There is no such connection
00000005 The request timed out
00000006 System error

 

Example of a response using the ‘Receive’ command

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ReceiveResponse xmlns="urn:wsedi">
            <ns1:ReceiveResult xmlns:ns1="urn:wsedi">
                <ns1:Res>00000000</ns1:Res>
                <ns1:Cnt><![CDATA[<Document-Order>
<Document-Header>
<DocumentReceiveDateTime>2023-01-26T10:27:10</DocumentReceiveDateTime>
<DocumentProcessDateTime>2023-01-26T10:27:23</DocumentProcessDateTime>
<DocumentID>21823748</DocumentID>
<DocumentUID>0a0055e62d374991abbe06b262704f4a</DocumentUID>
<DocumentLink>https://bltest.ediweb.eu/edi//showDocument?uid=MGEwMDU1ZTYyZDM3NDk5MWFiYmUwNmIyNjI3MDRmNGE%3D</DocumentLink>
<DocumentType>ORDER</DocumentType>
<DocumentSource>S</DocumentSource>
<OriginalFileName><![CDATA[ORDER_20230126102710417]]]]>><![CDATA[</OriginalFileName></Document-Header>
<Order-Header>
<OrderNumber>ORD0001</OrderNumber>
<OrderDate>2023-01-26</OrderDate>
<OrderCurrency>EUR</OrderCurrency>
<ExpectedDeliveryDate>2023-02-15</ExpectedDeliveryDate>
<DocumentFunctionCode>9</DocumentFunctionCode>
</Order-Header>
<Document-Parties>
<Sender>
<ILN>2000000000109</ILN>
<Name>LT Test Buyer(SOAP)</Name>
</Sender>
<Receiver>
<ILN>2000000000110</ILN>
<Name>LT Test Supplier(SOAP)</Name>
</Receiver>
<Creator>
<SystemUniqueCode>2000000000109WS</SystemUniqueCode>
<CodeBySender>2000000000109WS</CodeBySender>
<Name>LT Test Buyer(StrongPoint) WS servise</Name>
<E-mail>denis@edisoft.lt</E-mail>
<CreationType>M</CreationType>
</Creator>
</Document-Parties>
<Order-Parties>
<Buyer>
<ILN>2000000000109</ILN>
<Name>LT Test Buyer(SOAP)</Name>
</Buyer>
<Seller>
<ILN>2000000000110</ILN>
<Name>LT Test Supplier(SOAP)</Name>
</Seller>
<DeliveryPoint>
<ILN>9981616200001</ILN>
<Name>Prekybos centras 01</Name>
<CodeBySupplier>01</CodeBySupplier>
<CodeByBuyer>S009</CodeByBuyer>
<StreetAndNumber>Ateities g. 1</StreetAndNumber>
<CityName>Vilnius</CityName>
<Country>LT</Country>
</DeliveryPoint>
</Order-Parties>
<Order-Lines>
<Line>
<Line-Item>
<LineNumber>1</LineNumber>
<EAN>5903355000001</EAN>
<BuyerItemCode>8004001</BuyerItemCode>
<ItemDescription>Prekė 1</ItemDescription>
<OrderedQuantity>100.000</OrderedQuantity>
<OrderedUnitPacksize>1.000</OrderedUnitPacksize>
<UnitOfMeasure>vnt.</UnitOfMeasure>
<OrderedUnitNetPrice>0.0000</OrderedUnitNetPrice>
</Line-Item>
</Line>
<Line>
<Line-Item>
<LineNumber>2</LineNumber>
<EAN>5903355000002</EAN>
<BuyerItemCode>8004002</BuyerItemCode>
<ItemDescription>Prekė 2</ItemDescription>
<OrderedQuantity>4.000</OrderedQuantity>
<OrderedUnitPacksize>1.000</OrderedUnitPacksize>
<UnitOfMeasure>vnt.</UnitOfMeasure>
<OrderedUnitNetPrice>0.0000</OrderedUnitNetPrice>
</Line-Item>
</Line>
<Line>
<Line-Item>
<LineNumber>3</LineNumber>
<EAN>5903355000003</EAN>
<BuyerItemCode>8004003</BuyerItemCode>
<ItemDescription>Prekė 3</ItemDescription>
<OrderedQuantity>2.000</OrderedQuantity>
<OrderedUnitPacksize>1.000</OrderedUnitPacksize>
<UnitOfMeasure>vnt.</UnitOfMeasure>
<OrderedUnitNetPrice>0.0000</OrderedUnitNetPrice>
</Line-Item>
</Line>
<Line>
<Line-Item>
<LineNumber>4</LineNumber>
<EAN>5903355000004</EAN>
<BuyerItemCode>8004004</BuyerItemCode>
<ItemDescription>Prekė 4</ItemDescription>
<OrderedQuantity>12.000</OrderedQuantity>
<OrderedUnitPacksize>1.000</OrderedUnitPacksize>
<UnitOfMeasure>vnt.</UnitOfMeasure>
<OrderedUnitNetPrice>0.0000</OrderedUnitNetPrice>
</Line-Item>
</Line>
</Order-Lines>
<Order-Summary>
<TotalLines>4</TotalLines>
<TotalOrderedAmount>118.0000</TotalOrderedAmount>
<TotalNetAmount>0.0000</TotalNetAmount>
</Order-Summary>
</Document-Order>]]></ns1:Cnt>
            </ns1:ReceiveResult>
        </ReceiveResponse>
    </soapenv:Body>
</soapenv:Envelope>


3. Command ‘ChangeDocumentStatus’

The ‘ChangeDocumentStatus’ command allows you to change the status of a document from ‘New’ to ‘Read’. After changing the status, the next time you use the ‘ListMBAll’ command, you will no longer receive documents that have already been retrieved. The parameters described in the table must be passed in the ‘ChangeDocumentStatus’ request:

Parameter

Description

Mandatory

Name               

Login name

Yes

Password

Password

Yes

TrackingId

Document number in the EDI platform

Yes

Status

New document status

Yes

 

Example of a request using the 'ChangeDocumentStatus' command

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:wsedi">
    <soapenv:Header/>
    <soapenv:Body>
        <urn:ChangeDocumentStatus>
            <urn:Name>SomeName</urn:Name>
            <urn:Password>SomePassword</urn:Password>
            <urn:TrackingId>14768804</urn:TrackingId>
            <urn:Status>R</urn:Status>
        </urn:ChangeDocumentStatus>
    </soapenv:Body>
</soapenv:Envelope>

 

After executing the ‘ChangeDocumentStatus’ command, the document status is changed in the Edisoft system and a response is sent with the result. The following fields will be provided in the response:

Field

Description

<tracking-id>  

Document number in the EDI platform

<new-document-status>

Updated document status

 

Example of a response using the command 'ChangeDocumentStatus'

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ChangeDocumentStatusResponse xmlns="urn:wsedi">
            <ns1:ChangeDocumentStatusResult xmlns:ns1="urn:wsedi">
                <ns1:Res>00000000</ns1:Res>
                <ns1:Cnt><![CDATA[<change-status-response>
    <tracking-id>14768804</tracking-id>
    <new-document-status>14768804</new-document-status>
</change-status-response>]]></ns1:Cnt>
            </ns1:ChangeDocumentStatusResult>
        </ChangeDocumentStatusResponse>
    </soapenv:Body>
</soapenv:Envelope>

2024-11-26