Web Services - Sales Order
1 Module Overview
General information about the NetBaron-Web Services interface is provided in a separate document, available from NetBaron support upon request. This document describes only the Sales Order Web Services module, which enables the use of NetBaron® Sales Order from external services.
The module allows retrieving invoice data and creating invoices. The interface does not support multiple currencies; only the EUR currency is supported.
Error handling must be integrated into the interfaces in case of connection interruptions.
1.1 Usage Examples
Retrieve orders by given identifier
Retrieve orders by customer
Retrieve backordered customer orders for the online store
Retrieve orders by status
Retrieve orders within a date range
Add new orders
1.2 Linking Customer Data to a Sales Order
Note: Customer data is not updated in the register during this process. Instead, information provided on the sales order is used to link existing customer register data to the sales order.
Customer address information is retrieved from the customer register if only a Business ID (Y-tunnus) is provided and a match is found. If no matching customer is found, a new customer record will be created.
The linking process between the sales order and customer data in the register is carried out using the Business ID as follows:
If the Business ID is present in the data and only one match is found in the register, the customer will be linked based on that Business ID.
If multiple matches are found for the Business ID and the data also includes an EDI identifier (OVT), the search is refined using the EDI identifier.
If the refined search results in a single match, the link is created accordingly.
If multiple matches remain, the search is further refined using: Business ID + TownName + PostCodeIdentifier
If still multiple matches are found, refine further with: Business ID + TownName + PostCodeIdentifier + OrganisationName
If more than one match still remains, the first match based on Business ID is selected from the register.
If the Business ID is not provided, the system attempts to link based on the OrganisationTaxCode (VAT ID), using the same matching logic as for the Business ID.
If neither Business ID nor VAT ID is provided, the system will attempt to find a match using the following fields (all must exactly match values in the customer register):
OrganisationName → company name
ContactPersonName → contact person
TownName → city
PostCodeIdentifier → postal code
StreetName → street address
If the Business ID is missing and no match is found using the above, a final attempt is made without OrganisationName, using:
ContactPersonName
TownName
PostCodeIdentifier
StreetName
1.3 Import-Related Application Settings
Settings | Application settings | Order – settings. This section is visible to organizations that have WS-Sales Order enabled.
Allow pricelists in Finvoice import: When this setting is active, discounts from customer-specific price lists are applied to order rows, provided that the customer and product data match entries in the application registers.
Allow stock prices on Finvoice import: When this setting is active, prices specific to the stock location are applied to the order lines.
Allow create customer in Finvoice import: When this setting is active, any new customer data present on the order is added to the customer register during import.
Allow the order to be marked as paid on Finvoice import: When this setting is active, the imported order can be marked as Paid using the PaymentStatusCode element with the value PAID.
Allow delivery in Finvoice import: When this setting is active, the order is automatically set to Delivered status during import, and inventory is deducted for the products accordingly.
2 Technical Information
2.1 Service Information
Address: | If a parallel interface has been enabled, the interface number must be included in addition to the address to ensure the request is directed to the correct endpoint. Otherwise, authentication will fail. Example: |
Authentication: | Organization and the organization-specific Web Services password |
The character set used: | UTF-8 |
Available methods: | GET / PUT |
Type of request: | Object |
Type of response: | Object |
Notes: | When using the PUT method with FinvoiceMethod, the InvoiceTypeCode in the Finvoice must be ORD01 if the imported data is to be created as a sales order. The data is imported as a quotation if the InvoiceTypeCode is QUO01. When using the PUT method with FinvoiceMethod, the reference number can be passed via the EpiRemittanceInfoIdentifier or EpiReference fields in the Finvoice. |
2.2 Request content (GET)
OrderIdentifierIds or OrderNumbers is required if no other search criteria are defined. BuyerIdentifierId is required if UseBuyerIdentifierId is set to TRUE.
Using the OrderIdentifierIds element, multiple orders can be retrieved in a single query using Order(x) and OrderIdentifierId elements, for example:
<OrderIdentifierIds>
<Order1>
<OrderIdentifierId>1</OrderIdentifierId>
</Order1>
<Order2>
<OrderIdentifierId>2</OrderIdentifierId>
</Order2>
<Order3>
<OrderIdentifierId>3</OrderIdentifierId>
</Order3>
</OrderIdentifierIds>
In the example, the OrderIdentifierId value corresponds to the order's ID.
Similarly, the OrderNumbers element can be used to retrieve multiple orders in a single query, for example:
<OrderNumbers>
<OrderNumber>MT20131</OrderNumber>
<OrderNumber>MT20132</OrderNumber>
</OrderNumbers>
In this example, the OrderNumber value corresponds to the order’s order number.
The GetOnlyComplementaryDelivery filter limits the search to orders that have rows in backorder. The search is restricted to orders that are in the statuses Incomplete, Collected, or On Collection List. When the GetOnlyComplementaryDelivery filter is used, other possible status filters are not taken into account.
Status-based search filters allow results to be filtered based on the order status. Status filters cannot be combined. If more than one status filter is included in the query, the interface will return the error Request: "Getting by more than one status is not possible."
The UseBuyerIdentifierId parameter limits the search to a specific buyer using the BuyerIdentifierId value. When combined with status filters, it can be used to return backordered orders per buyer - for example, for integration with an online store.
The SearchDate, StartDate, and EndDate parameters can be used to limit the query to a specific date range. The SearchDate element defines which order date field is used for filtering (e.g., Agreed delivery date, Delivery date, Order date, or Printed date). If StartDate or EndDate is provided but SearchDate is left empty, the default value "OrderDate" is used. The interface validates the value of SearchDate. If it does not match any of the predefined date fields, the interface returns an error message: "SearchDate must be AgreedDeliveryDate, DeliveryDate, OrderDate or PrintedDate."
OrderIdentifierIds and OrderNumbers always limit the search to the specified orders - even when used in combination with status filters or the UseBuyerIdentifierId parameter.
2.2.1 Contents of the GET Request sent to the service
Element | Type | Use | Default | Definition | Mandatory |
GetSellerPartyDetails | boolean | Control message | FALSE | Seller details | |
GetInvoiceRecipientPartyDetails | boolean | Control message | FALSE | Payer details | |
GetBuyerPartyDetails | boolean | Control message | FALSE | Buyer details | |
GetDeliveryPartyDetails | boolean | Control message | FALSE | Delivery address details | |
GetDeliveryDetails | boolean | Control message | FALSE | Delivery details | |
GetInvoiceDetails | boolean | Control message | FALSE | Sales order details | |
GetInvoiceFreeText | boolean | Control message | FALSE | Sales order rows | |
GetInvoiceRow | boolean | Control message | FALSE | Invoice rows | |
GetOnlyComplementaryDelivery | boolean | Search criteria (Status-based) | FALSE | Returns orders that contain rows in backorder. | |
GetUnbilled | boolean | Search criteria (Status-based) | FALSE | Returns orders that contain rows to be invoiced but that have not yet been invoiced. | |
GetIncompleted | boolean | Search criteria (Status-based) | FALSE | Returns orders with the status Incomplete | |
GetOffer | boolean | Search criteria (Status-based) | FALSE | Returns orders with the status Offer | |
GetOnCollectionList | boolean | Search criteria (Status-based) | FALSE | Returns orders with the status Collected or On Collection List. | |
GetDelivered | boolean | Search criteria (Status-based) | FALSE | Returns orders with status Delivered and invoicing status = [empty] | |
GetAdvanceBillBilled | boolean | Search criteria (Status-based) | FALSE | Returns orders with invoicing status Preliminary invoice - Invoiced | |
GetAdvanceBillPaid | boolean | Search criteria (Status-based) | FALSE | Returns orders with invoicing status Preliminary invoice - Paid | |
GetBilled | boolean | Search criteria (Status-based) | FALSE | Returns orders with invoicing status Invoiced | |
GetPaid | boolean | Search criteria (Status-based) | FALSE | Returns orders with invoicing status Paid | |
GetCancelled | boolean | Search criteria (Status-based) | FALSE | Returns orders with the status Cancelled | |
GetArchived | boolean | Search criteria (Status-based) | FALSE | Returns orders with the status Archived | |
UseBuyerIdentifierId | boolean | Control message | FALSE | Uses the BuyerIdentifierId to filter the search by buyer. | |
OrderIdentifierIds | object | Search criteria | Orders to be retrieved by their identifiers. | X | |
BuyerIdentifierId | int(11) | Search criteria | Identifier of the buyer | ||
SearchDate | string | Control message | OrderDate | Search date (AgreedDeliveryDate, DeliveryDate, OrderDate, PrintedDate) | |
StartDate | Date (YYYY-mm-dd) | Search criteria | Start date | ||
EndDate | Date (YYYY-mm-dd) | Search criteria | End date | ||
OrderNumbers | object | Search criteria | Orders to be retrieved by order number. |
2.2.2 OrderIdentifierIds-object
Element | Type | Use | Default | Definition | Mandatory |
Order(x) | object | Search criteria | Counter for order identifiers, e.g., Inv1, Inv2, etc. | X |
2.2.3 Order(x)-object
Element | Type | Use | Default | Definition | Mandatory |
OrderIdentifierId | int(11) | Search criteria | Identifier of the order to be retrieved | X |
2.2.4 OrderNumbers-object
Element | Type | Definition |
OrderNumber | string | Order number of the order to be retrieved |
2.3 Response content (GET)
The content of the response returned by the service
Element | Type | Definition |
ResponseStatus | int (0/1) | 0=Error 1=Operation completed successfully |
ResponseMessage | string | Additional description about events, errors, etc. |
NumberOfOrders | int | Number of orders found |
Orders | array | Found orders |
2.3.1 Orders-table
Element | Type | Definition |
OrderIdentifierId | int(11) | Identifier of a single order |
OrderDate | date(YYYY-mm-dd) | Order date |
SellerPartyDetails | object | Seller details |
SellerContactPersonName | string | Contact person |
SellerCommunicationDetails | object | Contact details |
SellerInformationDetails | object | Seller information |
InvoiceRecipientPartyDetails | object | Payer details |
InvoiceRecipientContactPersonName | string | Contact person |
InvoiceRecipientCommunicationDetails | object | Contact details |
BuyerPartyDetails | object | Buyer details |
BuyerContactPersonName | string | Contact person |
BuyerCommunicationDetails | object | Contact details |
DeliveryPartyDetails | object | Delivery address details |
DeliveryContactPersonName | string | Contact person |
DeliveryCommunicationDetails | object | Contact details |
DeliveryDetails | object | Delivery details |
InvoiceDetails | object | Order details |
PaymentStatusDetails | object | Order status |
InvoiceRow | object | Order rows |
2.3.1.1 SellerPartyDetails-object
Element | Type | Definition |
SellerPartyIdentifier | string | Business ID |
SellerOrganisationName | array (1-2) | Seller |
SellerOrganisationTaxCode | string | VAT number |
SellerPostalAddressDetails | object | Address details |
2.3.1.2 SellerOrganisationName-table
Element | Type | Definition |
OrganisationName | string | Seller name |
2.3.1.3 SellerPostalAddressDetails-olio
Taulukko 9 Ohessa on esitetty SellerPostalAddressDetails-olio.
Element | Type | Definition |
SellerStreetName | array(0...2) | Street addresses |
SellerTownName | string | Town / post office |
SellerPostCodeIdentifier | string | Postal code |
2.3.1.4 SellerStreetName-table
Element | Type | Definition |
StreetName | string | Street address |
2.3.1.5 SellerCommunicationDetails-object
Element | Type | Definition |
SellerPhoneNumberIdentifier | string | Phone number |
SellerEmailaddressIdentifier | string | E-mail address |
2.3.1.6 SellerInformationDetails-object
Element | Type | Definition |
SellerPhoneNumber | string | Phone number |
SellerCommonEmailaddressIdentifier | string | E-mail address |
2.3.1.7 InvoiceRecipientPartyDetails-object
Element | Type | Definition |
InvoiceRecipientPartyIdentifier | string | Business ID |
InvoiceRecipientOrganisationName | array(1-2) | Seller |
InvoiceRecipientOrganisationTaxCode | string | VAT number |
InvoiceRecipientPostalAddressDetails | object | Address details |
2.3.1.8 InvoiceRecipientOrganisationName-table
Element | Type | Definition |
OrganisationName | string | Invoice recipient name |
2.3.1.9 InvoiceRecipientPostalAddressDetails-object
Element | Type | Definition |
InvoiceRecipientStreetName | array(0...2) | Street addresses |
InvoiceRecipientTownName | string | Town / post office |
InvoiceRecipientPostCodeIdentifier | string | Postal code |
2.3.1.9.1 InvoiceRecipientStreetName-table
Element | Type | Definition |
StreetName | string | Street address |
2.3.1.10 InvoiceRecipientCommunicationDetails-object
Element | Type | Definition |
InvoiceRecipientPhoneNumberIdentifier | string | Phone number |
InvoiceRecipientEmailaddressIdentifier | string | E-mail address |
2.3.1.11 BuyerPartyDetails-object
Element | Type | Definition |
BuyerPartyIdentifier | string | Business ID |
BuyerOrganisationName | array(1-2) | Seller |
BuyerOrganisationTaxCode | string | VAT number |
BuyerPostalAddressDetails | object | Address details |
2.3.1.12 BuyerOrganisationName-table
Element | Type | Definition |
OrganisationName | string | Buyer party name |
2.3.1.13 BuyerPostalAddressDetails-object
Element | Type | Definition |
BuyerStreetName | array(0...2) | Street addresses |
BuyerTownName | string | Town / post office |
BuyerPostCodeIdentifier | string | Postal code |
2.3.1.14 BuyerStreetName-table
Element | Type | Definition |
StreetName | string | Street address |
2.3.1.15 BuyerCommunicationDetails-object
Element | Type | Definition |
BuyerPhoneNumberIdentifier | string | Phone number |
BuyerEmailaddressIdentifier | string | E-mail address |
2.3.1.16 DeliveryPartyDetails-object
Element | Type | Definition |
DeliveryPartyIdentifier | string | Business ID |
DeliveryOrganisationName | array(1-2) | Seller |
DeliveryOrganisationTaxCode | string | VAT number |
DeliveryPostalAddressDetails | object | Address details |
2.3.1.17 DeliveryOrganisationName-table
Element | Type | Definition |
OrganisationName | string | Delivery address name |
2.3.1.18 DeliveryPostalAddressDetails-object
Element | Type | Definition |
DeliveryStreetName | array(0...2) | Street addresses |
DeliveryTownName | string | Town / post office |
DeliveryPostCodeIdentifier | string | Postal code |
2.3.1.19 DeliveryStreetName-table
Element | Type | Definition |
StreetName | string | Street address |
2.3.1.20 DeliveryCommunicationDetails-object
Element | Type | Definition |
DeliveryPhoneNumberIdentifier | string | Phone number |
DeliveryEmailaddressIdentifier | string | E-mail address |
2.3.1.21 DeliveryDetails-object
Element | Type | Definition |
DeliveryDate | date (YYYY-mm-dd) | Delivery date |
DeliveryMethodText | string | Delivery method |
DeliveryTermsText | string | Delivery terms |
DeliveryNoteIdentifier | string | Consignment note |
2.3.1.22 InvoiceDetails-object
Element | Type | Definition |
InvoiceNumber | string | Sales order number |
SellerReferenceIdentifier | string | Seller’s reference |
OrderIdentifier | string | Tilaajan viite |
ProjectReferenceIdentifier | string | Project number |
InvoiceTotalVatExcludedAmount | double(####,##) | Total amount excluding tax |
InvoiceTotalVatAmount | double(####,##) | VAT amount |
InvoiceTotalVatIncludedAmount | double(####,##) | Total amount including tax |
AmountCurrencyIdentifier | string(3) | Currency |
InvoiceFreeText | array | Free text |
PaymentTermsDetails | object | Payment terms |
SalesPersonName | string | Seller |
2.3.1.23 InvoiceFreeText-table
Element | Type | Definition |
InvoiceFreeTextTitle | string | Title of free text |
InvoiceFreeText | string | Free text |
2.3.1.24 PaymentTermsDetails-object
Element | Type | Definition |
PaymentTermsFreeText | string | Payment terms |
InvoiceDueDate | date (YYYY-mm-dd) | Agreed delivery date |
2.3.1.25 PaymentStatusDetails-object
Element | Type | Definition |
PaymentStatusCode | string | Sales order status 1 = Kesken = Incomplete 12 = Keräilylistalla = On collection list 27 = Tarjous = Offer 41 = Toimitettu = Delivered 58 = Ennakkolasku-Laskutettu = Preliminary invoice - Invoiced 59 = Ennakkolasku-Maksettu = Preliminary invoice - Paid 50 = Laskutettu = Billed 52 = Maksettu = Paid 90 = Peruutettu = Cancelled 80 = Arkistoitu = Archived |
2.3.1.26 InvoiceRow-table
Element | Type | Definition |
RowIdentifier | string | Row identifier |
ExternalRowIdentifier | string | External row identifier |
ArticleIdentifier | string | Product number |
ArticleName | string | Product name |
ArticleStockName | string | Stock name |
ArticleRackName | string | Shelf |
EanCode | string | EAN barcode |
SerialNumberIdentifier | string | Serial number |
ArticleInfoUrlText | array | Product extra info |
OrderedQuantity | double (####) | Ordered quantity |
DeliveredQuantity | double (####) | Delivered quantity |
QuantityUnitCode | string | Unit |
UnitPriceAmount | double (####,#####) | VAT free unit price |
UnitPurchaseAPriceAmount | double (####,#####) | VAT free unit a-price |
UnitPurchaseBPriceAmount | double (####,#####) | VAT free unit b-purchase price |
RowProjectReferenceIdentifier | string | Project number |
RowNormalProposedAccountIdentifier | string | Account |
RowAccountDimensionText | string | Cost center |
RowDiscountPercent | double (####) | Discount percentage |
RowVatRatePercent | double (####) | VAT percentage |
RowVatAmount | double (####,##) | VAT amount |
RowVatExcludedAmount | double (####,##) | Total amount excluding tax |
RowAmount | double (####,##) | Total amount including tax |
AmountCurrencyIdentifier | string(3) | Currency |
RowType | string | Row type |
RowInvoice | string(1) | Row invoicing
|
RowDeliveryDate | date | Date when the row was delivered |
RowSalesPersonName | string | Salesperson (from personnel register) * Description below |
* The content of the RowSalesPersonName element must be in the format “FirstName LastName”, and the person must exist in the personnel register under the location that is the default location during the import of the sales order. |
2.3.1.27 ArticleInfoUrlText-table
Element | Type | Definition |
ArticleInfoUrlText | string | Product extra info |
2.4 Request content (PUT FinvoiceMethod)
The FinvoiceMethod PUT request to be sent to the service.
Element | Type | Use | Default | Definition | Mandatory |
FinvoiceMethod | boolean | Control message | TRUE | Use TRUE | X |
Finvoices | object | Orders | X | ||
ProductStructureFromRegister | boolean | Control message | FALSE | If TRUE and the InvoiceRow refers to a multi-level product, the subproducts will be retrieved from the register. | |
CreateFromRowProjectReferenceIdentifier | boolean | Control message | FALSE | TRUE = a new project number will be created automatically if it is not found in the register. The project number must end with a digit. | |
CreateFromRowAccountDimensionText | boolean | Control message | FALSE | TRUE = a new cost center will be created automatically if it is not found in the register. | |
MarkAsPayed * | boolean | Control message | FALSE | TRUE = marks the sales order and its order rows as paid | |
UpdatePaymentTermsFromCustomerRegistry | boolean | Control message | FALSE | TRUE = updates the payment terms from the customer registry | |
GetArticleNameFromRegister | boolean | Control message | FALSE | TRUE = updates the product name from the product register |
2.4.1 Finvoices-object
Through the WS Sales Order interface, it is possible to import more than one Finvoice file in a single call.
Example of a request: the File field content [BASE64] refers to a base64-encoded Finvoice file.
<Finvoices>
<Finvoice1>
<FileName>Salesorder_1.xml</FileName>
<File>[BASE64]</File>
</Finvoice1>
<Finvoice2>
<FileName>Salesorder_2.xml</FileName>
<File>[BASE64]</File>
</Finvoice2>
<Finvoice3>
<FileName>Salesorder_3.xml</FileName>
<File>[BASE64]</File>
</Finvoice3>
</Finvoices>
Finvoices-object
Element | Type | Definition | Mandatory |
Finvoice(x) | object | Orders
| X |
2.4.1.1 Finvoice(x)-object
Element | Type | Definition | Mandatory |
FileName | string | File name | X |
File | text (base64) | File content | X |
2.4.1.2 NetBaron® Extensions to the Finvoice Standard
Element | Type | Definition |
DeliveryWeek | string | The delivery week for the entire sales order |
RowDeliveryWeek | string | Delivery week for the individual order row |
BuyerPartyDetails/ BuyerCommunicationDetails/ BuyerGsmNumberIdentifier | string | Buyer’s mobile phone number |
BuyerPartyDetails/ | string | External customer number
|
DeliveryPartyDetails / DeliveryCommunicationDetails / DeliveryGsmNumberIdentifier | string | Supplier’s mobile phone number |
DeliveryPartyDetails/ | string | External customer number |
InvoiceRecipientPartyDetails/ InvoiceRecipientCommunicationDetails/ InvoiceRecipientGsmNumberIdentifier | string | Invoice recipient's mobile phone number |
InvoiceRecipientPartyDetails/ | string | External customr number |
ExtraField1 – ExtraField6 | string | Extra fields 1–6 in the Additional information tab |
InternalInformationFreeText | string | Internal information in the Additional information tab |
InvoiceInstructionFreeText | string | Instructions tab – Billing instructions |
DeliveryInstructionFreeText | string | Instructions tab – Delivery instructions |
TransportInstructionFreeText | string | Instructions tab – Transport instructions |
InvoiceRow/ArticleStockName | string | The Stock for the row; the Shelf location is also required |
InvoiceRow/ArticleRackName | string | The Shelf for the row; must exist in the Stock |
InvoiceRow/ExternalRowIdentifier | string | External row identifier |
InvoiceRow/RowInvoice | string | Row invoicing
Not mandatory |
2.5 Response content (PUT FinvoiceMethod)
The content of the response returned by the service
Element | Type | Definition |
ResponseStatus | int (0/1) | 0=error 1=OK |
ResponseMessage | string | Additional description about events, errors, etc. |
OrderIdentifierId | object | Identifiers of the added orders |
2.5.1 OrderIdentifierId-object
Element | Type | Definition |
[FileName] | object | Identification details contained in the file |
2.5.1.1 [FileName]-object
Element | Type | Definition |
Status | int (0/1) | 0=error 1=OK |
Message | string | Additional description about events, errors, etc. |
OrderIdentifierId | string | Identifier of the added order |
2.6 Request content (PUT CreatePaymentTermMethod)
The content of the CreatePaymentTermMethod PUT request sent to the service
Element | Type | Definition | Default | Mandatory |
CreatePaymentTermMethod | boolean | Control message | TRUE | X |
PaymentTerm | object | Payment terms | X |
2.6.1 PaymentTerm-object
Element | Type | Definition |
Description | string | Description |
AmountToAdd | int | Amount to be added |
UnitToAdd | string | Unit, day/month |
DiscountDays | int | Discount days |
DiscountPercent | double (####.##) | Discount percentage |
2.7 Response content (PUT CreatePaymentTermMethod)
The content of the response returned by the service
Element | Type | Use |
ResponseStatus | int (0/1) | 0=Error 1=OK |
ResponseMessage | string | Additional description about events, errors, etc. |
3 Code samples
It should be noted that the code samples presented in the documents are examples of how the interface can be used. Implementation of the codes requires PHP knowledge from the www-service provider. NetBaron Solutions Oy is not responsible for any direct or indirect damage and costs related to the sample codes when a third party does the implementation and further development.
Please note: The code created by your software developer must not cause server overload situations. We reserve the right to bill the creator of the software code or the end customer for system failure in the server environment. If necessary, please get the software code checked by sending it to tuki@netbaron.fi and adding the mention: "WS-Sales Order interface software code to product development for review and possible feedback".
3.1 PHP (GET)
<?php
function getresp($responsex, $pref=""){
$responserows = "";
foreach($responsex as $k => $r){
if(is_array($r)){
$responserows .= $pref."$k => Array(<br>".getresp($r,$pref." ").$pref."),<br>";
} else if(is_object($r)){
$responserows .= $pref."$k => Object(<br>".getresp($r,$pref." ").$pref."),<br>";
} else $responserows .= $pref."$k => $r<br>";
}
return $responserows;
}
$ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
$token = new stdClass;
// Client-puolen encodingista riippuen, mahdollisesti utf_encode tarvitaan
$token->Username = new SOAPVar ("username", XSD_STRING, null, null, null, $ns);
$token->Password = new SOAPVar("password", XSD_STRING, null, null, null, $ns);
$wsec = new stdClass;
$wsec->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $ns);
$soapHeaders[] = new SOAPHeader($ns, 'Security', $wsec->UsernameToken, true);
/**
* Client
*/
$client = new SoapClient(null, array(
"location" => "https://<serverurl>/ws/salesorder",
"uri" => "urn:NBWS",
'style' => SOAP_RPC,
'use' => SOAP_LITERAL,
"soap_version" => SOAP_1_2,
"compression" => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5,
"trace" => 1)
);
/**
* Set headers
*/
$client->__setSoapHeaders( $soapHeaders );
/**
* Call PHP soap
*/
try{
$Request = new stdClass();
$Request->GetSellerPartyDetails = true;
$Request->GetInvoiceRecipientPartyDetails = true;
$Request->GetBuyerPartyDetails = true;
$Request->GetDeliveryPartyDetails = true;
$Request->GetDeliveryDetails = true;
$Request->GetInvoiceDetails = true;
$Request->GetInvoiceFreeText = true;
$Request->GetInvoiceRow = true;
$Request->OrderIdentifierIds = new stdClass();
$Inv = "Inv2";
$Request->OrderIdentifierIds->$Inv = (object) array("OrderIdentifierId"=>"3800");
$response = $client->get( new SoapVar($Request, SOAP_ENC_OBJECT,"","","Request") );
if(is_object($response)){
$responserows = getresp($response);
} else $responserows = $response;
$response = "<b>RESPONSE</b><pre>".utf8_decode($responserows)."</b></pre>";
}
catch(SoapFault $fault){
$response .= "<b>SOAP Fault:</b><pre>faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring}</pre>";
}
echo $response;
?>
3.2 PHP (PUT)
<?php
function getresp($responsex, $pref=""){
$responserows = "";
foreach($responsex as $k => $r){
if(is_array($r)){
$responserows .= $pref."$k => Array(<br>".getresp($r,$pref." ").$pref."),<br>";
} else if(is_object($r)){
$responserows .= $pref."$k => Object(<br>".getresp($r,$pref." ").$pref."),<br>";
} else $responserows .= $pref."$k => $r<br>";
}
return $responserows;
}
$ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
$token = new stdClass;
// Client-puolen encodingista riippuen, mahdollisesti utf_encode tarvitaan
$token->Username = new SOAPVar("username", XSD_STRING, null, null, null, $ns);
$token->Password = new SOAPVar("password", XSD_STRING, null, null, null, $ns);
$wsec = new stdClass;
$wsec->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $ns);
$soapHeaders[] = new SOAPHeader($ns, 'Security', $wsec->UsernameToken, true);
/**
* Client
*/
$client = new SoapClient(null, array(
"location" => "https://<serverurl>/ws/salesorder",
"uri" => "urn:NBWS",
'style' => SOAP_RPC,
'use' => SOAP_LITERAL,
"soap_version" => SOAP_1_2,
"compression" => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5,
"trace" => 1)
);
/**
* Set headers
*/
$client->__setSoapHeaders( $soapHeaders );
/**
* Call PHP soap
*/
try{
$Request = new stdClass();
$Request->FinvoiceMethod = true;
$Request->InvoiceBill = true;
$Files = new stdClass();
$Files->Finvoice1 = new stdClass();
$Files->Finvoice1->FileName = utf8_encode("e-lasku.xml");
$Files->Finvoice1->File = new SoapVar(file_get_contents("e-lasku.xml"), XSD_BASE64BINARY);
$Request->Finvoices = $Files;
$response = $client->put( new SoapVar($Request, SOAP_ENC_OBJECT,"","","Request") );
if(is_object($response)){
$responserows = getresp($response);
} else $responserows = $response;
$response = "<b>RESPONSE</b><pre>".utf8_decode($responserows)."</b></pre>";
}
catch(SoapFault $fault){
$response .= "<b>SOAP Fault:</b><pre>faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring}</pre>";
}
echo $response;
?>
3.3 XML Content
3.3.1 Request (GET)
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NBWS" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<env:Header>
<wsse:Security env:mustUnderstand="true">
<wsse:UsernameToken>
<wsse:Username>username</wsse:Username>
<wsse:Password>password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<env:Body>
<ns1:get>
<Request>
<GetSellerPartyDetails>true</GetSellerPartyDetails>
<GetInvoiceRecipientPartyDetails>true</GetInvoiceRecipientPartyDetails>
<GetBuyerPartyDetails>true</GetBuyerPartyDetails>
<GetDeliveryPartyDetails>true</GetDeliveryPartyDetails>
<GetDeliveryDetails>true</GetDeliveryDetails>
<GetInvoiceDetails>true</GetInvoiceDetails>
<GetInvoiceFreeText>true</GetInvoiceFreeText>
<GetInvoiceRow>true</GetInvoiceRow>
<OrderIdentifierIds>
<Order1>
<OrderIdentifierId>3800</OrderIdentifierId>
</Order1>
</OrderIdentifierIds>
</Request>
</ns1:get>
</env:Body>
</env:Envelope>
3.3.2 Response (GET)
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NBWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
<ns1:getResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<rpc:result>Response</rpc:result>
<Response xsi:type="enc:Struct">
<ResponseStatus xsi:type="xsd:int">1</ResponseStatus>
<ResponseMessage xsi:type="xsd:string">
</ResponseMessage>
<NumberOfOrders xsi:type="xsd:int">1</NumberOfOrders>
<Orders xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:int">1</key>
<value xsi:type="enc:Struct">
<OrderIdentifierId xsi:type="xsd:string">3800</OrderIdentifierId>
<OrderDate xsi:type="xsd:string">2010-09-22</OrderDate>
<SellerPartyDetails xsi:type="enc:Struct">
<SellerPartyIdentifier xsi:type="xsd:string">1234567-1</SellerPartyIdentifier>
<SellerOrganisationName enc:itemType="enc:Struct" enc:arraySize="1" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<SellerOrganisationName xsi:type="xsd:string">Seller</SellerOrganisationName>
</item>
</SellerOrganisationName>
<SellerOrganisationTaxCode xsi:type="xsd:string">FI12345671</SellerOrganisationTaxCode>
<SellerPostalAddressDetails xsi:type="enc:Struct">
<SellerStreetName enc:itemType="enc:Struct" enc:arraySize="1" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<SellerStreetName xsi:type="xsd:string">Street</SellerStreetName>
</item>
</SellerStreetName>
<SellerTownName xsi:type="xsd:string">Town</SellerTownName>
<SellerPostCodeIdentifier xsi:type="xsd:string">00000</SellerPostCodeIdentifier>
</SellerPostalAddressDetails>
</SellerPartyDetails>
<SellerContactPersonName xsi:type="xsd:string">Contact</SellerContactPersonName>
<SellerCommunicationDetails xsi:type="enc:Struct">
<SellerPhoneNumberIdentifier xsi:type="xsd:string">123456789/SellerPhoneNumberIdentifier>
<SellerEmailaddressIdentifier xsi:type="xsd:string">email@email.fi</SellerEmailaddressIdentifier>
</SellerCommunicationDetails>
<SellerInformationDetails xsi:type="enc:Struct">
<SellerPhoneNumber xsi:type="xsd:string">123456789</SellerPhoneNumber>
<SellerCommonEmailaddressIdentifier xsi:type="xsd:string">email@email.fi</SellerCommonEmailaddressIdentifier>
</SellerInformationDetails>
<InvoiceRecipientPartyDetails xsi:type="enc:Struct">
<InvoiceRecipientPartyIdentifier xsi:type="xsd:string">1234567-8</InvoiceRecipientPartyIdentifier>
<InvoiceRecipientOrganisationName enc:itemType="enc:Struct" enc:arraySize="2" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<InvoiceRecipientOrganisationName xsi:type="xsd:string">Invoice recipient</InvoiceRecipientOrganisationName>
</item>
<item xsi:type="enc:Struct">
<InvoiceRecipientOrganisationName xsi:type="xsd:string">Invoice recipient2</InvoiceRecipientOrganisationName>
</item>
</InvoiceRecipientOrganisationName>
<InvoiceRecipientOrganisationTaxCode xsi:type="xsd:string">1234567-8</InvoiceRecipientOrganisationTaxCode>
<InvoiceRecipientPostalAddressDetails xsi:type="enc:Struct">
<InvoiceRecipientStreetName enc:itemType="enc:Struct" enc:arraySize="1" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<InvoiceRecipientStreetName xsi:type="xsd:string">Street</InvoiceRecipientStreetName>
</item>
</InvoiceRecipientStreetName>
<InvoiceRecipientTownName xsi:type="xsd:string">Town</InvoiceRecipientTownName>
<InvoiceRecipientPostCodeIdentifier xsi:type="xsd:string">00000</InvoiceRecipientPostCodeIdentifier>
</InvoiceRecipientPostalAddressDetails>
</InvoiceRecipientPartyDetails>
<InvoiceRecipientContactPersonName xsi:type="xsd:string">Contact</InvoiceRecipientContactPersonName>
<InvoiceRecipientCommunicationDetails xsi:type="enc:Struct">
<InvoiceRecipientPhoneNumberIdentifier xsi:type="xsd:string">123456789</InvoiceRecipientPhoneNumberIdentifier>
<InvoiceRecipientEmailaddressIdentifier xsi:type="xsd:string">email@email.fi</InvoiceRecipientEmailaddressIdentifier>
</InvoiceRecipientCommunicationDetails>
<BuyerPartyDetails xsi:type="enc:Struct">
<BuyerOrganisationName enc:itemType="enc:Struct" enc:arraySize="2" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<BuyerOrganisationName xsi:type="xsd:string">Buyer</BuyerOrganisationName>
</item>
<item xsi:type="enc:Struct">
<BuyerOrganisationName xsi:type="xsd:string">Buyer2</BuyerOrganisationName>
</item>
</BuyerOrganisationName>
<BuyerPostalAddressDetails xsi:type="enc:Struct">
<BuyerStreetName enc:itemType="enc:Struct" enc:arraySize="2" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<BuyerStreetName xsi:type="xsd:string">StreetBuyerStreetName>
</item>
<item xsi:type="enc:Struct">
<BuyerStreetName xsi:type="xsd:string">Street2</BuyerStreetName>
</item>
</BuyerStreetName>
<BuyerTownName xsi:type="xsd:string">Town</BuyerTownName>
<BuyerPostCodeIdentifier xsi:type="xsd:string">00000</BuyerPostCodeIdentifier>
</BuyerPostalAddressDetails>
</BuyerPartyDetails>
<BuyerContactPersonName xsi:type="xsd:string">Contact</BuyerContactPersonName>
<BuyerCommunicationDetails xsi:type="enc:Struct">
<BuyerPhoneNumberIdentifier xsi:type="xsd:string">123456789</BuyerPhoneNumberIdentifier>
<BuyerEmailaddressIdentifier xsi:type="xsd:string">email@email.fi</BuyerEmailaddressIdentifier>
</BuyerCommunicationDetails>
<DeliveryPartyDetails xsi:type="enc:Struct">
<DeliveryOrganisationName enc:itemType="enc:Struct" enc:arraySize="2" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<DeliveryOrganisationName xsi:type="xsd:string">Delivery</DeliveryOrganisationName>
</item>
<item xsi:type="enc:Struct">
<DeliveryOrganisationName xsi:type="xsd:string">Delivery2</DeliveryOrganisationName>
</item>
</DeliveryOrganisationName>
<DeliveryPostalAddressDetails xsi:type="enc:Struct">
<DeliveryStreetName enc:itemType="enc:Struct" enc:arraySize="1" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<DeliveryStreetName xsi:type="xsd:string">Street</DeliveryStreetName>
</item>
</DeliveryStreetName>
<DeliveryTownName xsi:type="xsd:string">Town</DeliveryTownName>
<DeliveryPostCodeIdentifier xsi:type="xsd:string">00000</DeliveryPostCodeIdentifier>
</DeliveryPostalAddressDetails>
</DeliveryPartyDetails>
<DeliveryContactPersonName xsi:type="xsd:string">Contact</DeliveryContactPersonName>
<DeliveryCommunicationDetails xsi:type="enc:Struct">
<DeliveryPhoneNumberIdentifier xsi:type="xsd:string">123456789</DeliveryPhoneNumberIdentifier>
<DeliveryEmailaddressIdentifier xsi:type="xsd:string">email@email.fi</DeliveryEmailaddressIdentifier>
</DeliveryCommunicationDetails>
<DeliveryDetails xsi:type="enc:Struct">
<DeliveryDate xsi:type="xsd:string">2010-09-29</DeliveryDate>
<DeliveryMethodText xsi:type="xsd:string">Posti, Tuotteiden hinta yli170e</DeliveryMethodText>
<DeliveryTermsText xsi:type="xsd:string">Vapaasti varastossa</DeliveryTermsText>
<DeliveryNoteIdentifier xsi:type="xsd:string">FI124356458967234</DeliveryNoteIdentifier>
</DeliveryDetails>
<InvoiceDetails xsi:type="enc:Struct">
<InvoiceNumber xsi:type="xsd:string">2010120</InvoiceNumber>
<SellerReferenceIdentifier xsi:type="xsd:string">Tilausnumero: 22010248</SellerReferenceIdentifier>
<OrderIdentifier xsi:type="xsd:string">OrderIdentifier</OrderIdentifier>
<ProjectReferenceIdentifier xsi:type="xsd:string">333333</ProjectReferenceIdentifier>
<InvoiceTotalVatExcludedAmount xsi:type="xsd:string">1071,31</InvoiceTotalVatExcludedAmount>
<InvoiceTotalVatAmount xsi:type="xsd:string">98,56</InvoiceTotalVatAmount>
<InvoiceTotalVatIncludedAmount xsi:type="xsd:string">1169,87</InvoiceTotalVatIncludedAmount>
<AmountCurrencyIdentifier xsi:type="xsd:string">EUR</AmountCurrencyIdentifier>
<InvoiceFreeText enc:itemType="enc:Struct" enc:arraySize="3" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<InvoiceFreeTextTitle xsi:type="xsd:string">Announcement</InvoiceFreeTextTitle>
<InvoiceFreeText xsi:type="xsd:string">Tiedonanto</InvoiceFreeText>
</item>
<item xsi:type="enc:Struct">
<InvoiceFreeTextTitle xsi:type="xsd:string">TransportInstruction</InvoiceFreeTextTitle>
<InvoiceFreeText xsi:type="xsd:string">Kuljetusohjeet</InvoiceFreeText>
</item>
<item xsi:type="enc:Struct">
<InvoiceFreeTextTitle xsi:type="xsd:string">FreeField1</InvoiceFreeTextTitle>
<InvoiceFreeText xsi:type="xsd:string">Varakenttä1</InvoiceFreeText>
</item>
</InvoiceFreeText>
<PaymentTermsDetails xsi:type="enc:Struct">
<PaymentTermsFreeText xsi:type="xsd:string">14 pv netto</PaymentTermsFreeText>
<InvoiceDueDate xsi:type="xsd:string">2010-10-13</InvoiceDueDate>
</PaymentTermsDetails>
<SalesPersonName xsi:type="xsd:string">Matti Myyjä</SalesPersonName>
</InvoiceDetails>
<PaymentStatusDetails xsi:type="enc:Struct">
<PaymentStatusCode xsi:type="xsd:string">Toimitettu</PaymentStatusCode>
</PaymentStatusDetails>
<InvoiceRow enc:itemType="enc:Struct" enc:arraySize="4" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<RowIdentifier xsi:type="xsd:string">9720</RowIdentifier>
<ArticleIdentifier xsi:type="xsd:string">ArticleIdentifier</ArticleIdentifier>
<ArticleGroupIdentifier xsi:type="xsd:string">ArticleGroupIdentifier</ArticleGroupIdentifier>
<ArticleName xsi:type="xsd:string">ArticleName</ArticleName>
<ArticleInfoUrlText enc:itemType="enc:Struct" enc:arraySize="1" xsi:type="enc:Array">
<item xsi:type="enc:Struct">
<ArticleInfoUrlText xsi:type="xsd:string">http://address.fi</ArticleInfoUrlText>
</item>
</ArticleInfoUrlText>
<EanCode xsi:type="xsd:string">4902030181000</EanCode>
<OrderedQuantity xsi:type="xsd:string">1</OrderedQuantity>
<DeliveredQuantity xsi:type="xsd:string">1</DeliveredQuantity>
<QuantityUnitCode xsi:type="xsd:string">kpl</QuantityUnitCode>
<UnitPriceAmount xsi:type="xsd:string">1000,00000</UnitPriceAmount>
<UnitPurchaseAPriceAmount xsi:type="xsd:string">900.605</UnitPurchaseAPriceAmount>
<UnitPurchaseBPriceAmount xsi:type="xsd:string">900.605</UnitPurchaseBPriceAmount>
<RowProjectReferenceIdentifier xsi:type="xsd:string">333333</RowProjectReferenceIdentifier>
<RowVatRatePercent xsi:type="xsd:string">9</RowVatRatePercent>
<RowVatAmount xsi:type="xsd:string">90,00</RowVatAmount>
<RowVatExcludedAmount xsi:type="xsd:string">1000,00</RowVatExcludedAmount>
<RowAmount xsi:type="xsd:string">1090,00</RowAmount>
<AmountCurrencyIdentifier xsi:type="xsd:string">EUR</AmountCurrencyIdentifier>
<RowType xsi:type="xsd:string">Material</RowType>
<RowInvoice xsi:type="xsd:string">Y</RowInvoice>
</item>
<item xsi:type="enc:Struct">
<RowIdentifier xsi:type="xsd:string">10048</RowIdentifier>
<ArticleIdentifier xsi:type="xsd:string">ArticleIdentifier</ArticleIdentifier>
<ArticleGroupIdentifier xsi:type="xsd:string">ArticleGroupIdentifier</ArticleGroupIdentifier>
<ArticleName xsi:type="xsd:string">ArticleName</ArticleName>
<SerialNumberIdentifier xsi:type="xsd:string">SerialNumberIdentifier</SerialNumberIdentifier>
<OrderedQuantity xsi:type="xsd:string">1</OrderedQuantity>
<DeliveredQuantity xsi:type="xsd:string">1</DeliveredQuantity>
<QuantityUnitCode xsi:type="xsd:string">kpl</QuantityUnitCode>
<UnitPriceAmount xsi:type="xsd:string">71,31000</UnitPriceAmount>
<UnitPurchaseAPriceAmount xsi:type="xsd:string">47.605</UnitPurchaseAPriceAmount>
<UnitPurchaseBPriceAmount xsi:type="xsd:string">47.605</UnitPurchaseBPriceAmount>
<RowProjectReferenceIdentifier xsi:type="xsd:string">333333</RowProjectReferenceIdentifier>
<RowNormalProposedAccountIdentifier xsi:type="xsd:string">1111</RowNormalProposedAccountIdentifier>
<RowAccountDimensionText xsi:type="xsd:string">22222</RowAccountDimensionText>
<RowVatRatePercent xsi:type="xsd:string">12</RowVatRatePercent>
<RowVatAmount xsi:type="xsd:string">8,56</RowVatAmount>
<RowVatExcludedAmount xsi:type="xsd:string">71,31</RowVatExcludedAmount>
<RowAmount xsi:type="xsd:string">79,87</RowAmount>
<AmountCurrencyIdentifier xsi:type="xsd:string">EUR</AmountCurrencyIdentifier>
<RowType xsi:type="xsd:string">Material</RowType>
<RowInvoice xsi:type="xsd:string">Y</RowInvoice>
<RowSalesPersonName xsi:type="xsd:string">Matti Myyjä</RowSalesPersonName>
</item>
</InvoiceRow>
</value>
</item>
</Orders>
</Response>
</ns1:getResponse>
</env:Body>
</env:Envelope>
3.3.3 Request (PUT FinvoiceMethod)
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NBWS" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<env:Header>
<wsse:Security env:mustUnderstand="true">
<wsse:UsernameToken>
<wsse:Username>username</wsse:Username>
<wsse:Password>password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<ns1:put>
<Request>
<FinvoiceMethod>true</FinvoiceMethod>
<UpdatePaymentTermsFromCustomerRegistry>false</UpdatePaymentTermsFromCustomerRegistry>
<GetArticleNameFromRegister>false</GetArticleNameFromRegister>
<Finvoices>
<Finvoice1>
<FileName>e-lasku</FileName>
<File>PD94bWwgdmVyc2...</File>
</Finvoice1>
</Finvoices>
</Request>
</ns1:put>
</env:Body>
</env:Envelope>
3.3.4 Response (PUT FinvoiceMethod)
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NBWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
<ns1:postResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<rpc:result>Response</rpc:result>
<Response xsi:type="enc:Struct">
<ResponseStatus xsi:type="xsd:int">1</ResponseStatus>
<ResponseMessage xsi:type="xsd:string">
</ResponseMessage>
<OrderIdentifierId xsi:type="enc:Struct">
<e-lasku.xml xsi:type="enc:Struct">
<Status xsi:type="xsd:int">1</Status>
<Message xsi:type="xsd:string">
</Message>
<OrderIdentifierId xsi:type="xsd:string">3864</OrderIdentifierId>
</e-lasku.xml>
</OrderIdentifierId>
</Response>
</ns1:postResponse>
</env:Body>
</env:Envelope>
3.3.5 Finvoice example
<?xml version="1.0" encoding="UTF-8"?>
<Finvoice Version="1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Order seller details -->
<SellerPartyDetails>
<!-- Business ID -->
<SellerPartyIdentifier>1234567-1</SellerPartyIdentifier>
<SellerOrganisationName>Pullin Musiikki oy</SellerOrganisationName>
<!-- Order seller post address -->
<SellerPostalAddressDetails>
<SellerStreetName>Puukatu 2 F</SellerStreetName>
<SellerTownName>Helsinki</SellerTownName>
<SellerPostCodeIdentifier>00112</SellerPostCodeIdentifier>
<CountryCode>FI</CountryCode>
<CountryName>Suomi</CountryName>
</SellerPostalAddressDetails>
</SellerPartyDetails>
<!-- EDI-identidier (OVT) -->
<SellerOrganisationUnitNumber>00371234567100001</SellerOrganisationUnitNumber>
<!-- Seller Contact person name -->
<SellerContactPersonName>Petri Pulli</SellerContactPersonName>
<SellerCommunicationDetails>
<SellerPhoneNumberIdentifier>09123123</SellerPhoneNumberIdentifier>
<SellerEmailaddressIdentifier>petri.pulli@pullinmusiikki.fi</SellerEmailaddressIdentifier>
</SellerCommunicationDetails>
<!-- Seller party additional information -->
<SellerInformationDetails>
<SellerHomeTownName>Helsinki</SellerHomeTownName>
<SellerPhoneNumber>09123123</SellerPhoneNumber>
<SellerFaxNumber>09123124</SellerFaxNumber>
<SellerCommonEmailaddressIdentifier>webmaster@pullinmusiikki.fi</SellerCommonEmailaddressIdentifier>
<SellerWebaddressIdentifier>www.pullinmusiikki.fi</SellerWebaddressIdentifier>
<SellerFreeText>It pays to do business with us</SellerFreeText>
</SellerInformationDetails>
<!-- Orders buyer party details -->
<BuyerPartyDetails>
<!-- Buyer party business ID, used for linking customer data to registry -->
<BuyerPartyIdentifier>1234567-1</BuyerPartyIdentifier>
<!-- Buyer party name, used for linking customer data to registry -->
<BuyerOrganisationName>Musakauppa Oy</BuyerOrganisationName>
<!-- Buyer party VAT-code -->
<BuyerOrganisationTaxCode>0112305-3</BuyerOrganisationTaxCode>
<!-- Buyer address -->
<BuyerPostalAddressDetails>
<BuyerStreetName>Kalastajankatu 14</BuyerStreetName>
<BuyerTownName>Joensuu</BuyerTownName>
<BuyerPostCodeIdentifier>80200</BuyerPostCodeIdentifier>
<CountryCode>FI</CountryCode>
<CountryName>Suomi</CountryName>
</BuyerPostalAddressDetails>
</BuyerPartyDetails>
<!-- Buyer contact, used for linking customer data to registry (mandatory information if customer is private individual!) -->
<BuyerContactPersonName>Marko Musakauppias</BuyerContactPersonName>
<!-- Buyer EDI identifier, used for linking customer data to registry -->
<BuyerOrganisationUnitNumber>00371234567100001</BuyerOrganisationUnitNumber>
<!-- Buyer contant details -->
<BuyerCommunicationDetails>
<BuyerPhoneNumberIdentifier>020052300</BuyerPhoneNumberIdentifier>
</BuyerCommunicationDetails>
<!-- Invoicing details -->
<InvoiceRecipientPartyDetails>
<InvoiceRecipientOrganisationName>Tilitoimisto</InvoiceRecipientOrganisationName>
<InvoiceRecipientPartyIdentifier>1234567-1</InvoiceRecipientPartyIdentifier>
<InvoiceRecipientPostalAddressDetails>
<InvoiceRecipientStreetName>Tilitoimistonkatu 15</InvoiceRecipientStreetName>
<InvoiceRecipientTownName>Joensuu</InvoiceRecipientTownName>
<InvoiceRecipientPostCodeIdentifier>80250</InvoiceRecipientPostCodeIdentifier>
<CountryCode>FI</CountryCode>
<CountryName>Suomi</CountryName>
</InvoiceRecipientPostalAddressDetails>
</InvoiceRecipientPartyDetails>
<InvoiceRecipientOrganisationUnitNumber>00371234567100001</InvoiceRecipientOrganisationUnitNumber>
<InvoiceRecipientCommunicationDetails>
<InvoiceRecipientEmailaddressIdentifier>kalle@tilitoimisto.fi</InvoiceRecipientEmailaddressIdentifier>
</InvoiceRecipientCommunicationDetails>
<!-- Delivery information -->
<DeliveryPartyDetails>
<DeliveryPartyIdentifier>1234567-1</DeliveryPartyIdentifier>
<DeliveryOrganisationName>Musakauppa Oy logistiikkakeskus</DeliveryOrganisationName>
<DeliveryOrganisationTaxCode>0112305-3</DeliveryOrganisationTaxCode>
<DeliveryPostalAddressDetails>
<DeliveryStreetName>Kalastajankatu 15</DeliveryStreetName>
<DeliveryTownName>Joensuu</DeliveryTownName>
<DeliveryPostCodeIdentifier>80200</DeliveryPostCodeIdentifier>
<CountryCode>FI</CountryCode>
<CountryName>Suomi</CountryName>
</DeliveryPostalAddressDetails>
</DeliveryPartyDetails>
<DeliveryOrganisationUnitNumber>00371234567100001</DeliveryOrganisationUnitNumber>
<DeliveryContactPersonName>Matti Muusikko</DeliveryContactPersonName>
<DeliveryCommunicationDetails>
<DeliveryEmailaddressIdentifier>Matti.Muusikko@musakauppa.fi</DeliveryEmailaddressIdentifier>
</DeliveryCommunicationDetails>
<InvoiceDetails>
<InvoiceTypeCode>ORD01</InvoiceTypeCode>
<OrderDate Format="CCYYMMDD">20121205</OrderDate>
<AmountCurrencyIdentifier>EUR</AmountCurrencyIdentifier>
<InvoiceFreeText>Tiedonanto / Noficiation</InvoiceFreeText>
<PaymentTermsDetails>
<PaymentTermsFreeText>14 pv netto</PaymentTermsFreeText>
</PaymentTermsDetails>
<VatSpecificationDetails>
<VatRatePercent>24</VatRatePercent>
</VatSpecificationDetails>
<DeliveryMethodText>Posti</DeliveryMethodText>
<DeliveryTermsText>Vapaasti varastosta</DeliveryTermsText>
<!-- Sales person is linked to personnel registry if found -->
<SalesPersonName>Matti Myyjä</SalesPersonName>
</InvoiceDetails>
<DeliveryDetails>
<!-- Agreed delivery date, optional -->
<DeliveryDate Format="CCYYMMDD">20121205</DeliveryDate>
</DeliveryDetails>
<InvoiceRow>
<ArticleIdentifier>5544</ArticleIdentifier>
<ArticleName>Puoliakustinen kitara</ArticleName>
<OrderedQuantity QuantityUnitCode="kpl">1,000</OrderedQuantity>
<UnitPriceAmount AmountCurrencyIdentifier="EUR"
UnitPriceUnitCode="kpl">300,000</UnitPriceAmount>
<RowVatRatePercent>24</RowVatRatePercent>
<!-- RowSalesPersonName is linket to personnel registry if found -->
<RowSalesPersonName>Matti Myyjä</RowSalesPersonName>
</InvoiceRow>
<InvoiceRow>
<ArticleIdentifier>5545</ArticleIdentifier>
<ExternalRowIdentifier>123<ExternalRowIdentifier
<ArticleName>Kitaran kielet (paketti)</ArticleName>
<OrderedQuantity QuantityUnitCode="kpl">1,000</OrderedQuantity>
<UnitPriceAmount AmountCurrencyIdentifier="EUR"
UnitPriceUnitCode="kpl">29,000</UnitPriceAmount>
<RowVatRatePercent>24</RowVatRatePercent>
<!-- Discount for 25% -->
<RowDiscountRate>25</RowDiscountRate>
<!-- Order row dercription -->
<RowFreeText>Steel strings</RowFreeText>
<RowInvoice>Y</RowInvoice>
</InvoiceRow>
<ExtraField1>Varakenttä1</ExtraField1>
<ExtraField2>Varakenttä2</ExtraField2>
<ExtraField3>Varakenttä3</ExtraField3>
<ExtraField4>Varakenttä4</ExtraField4>
<ExtraField5>Varakenttä5</ExtraField5>
<ExtraField6>Varakenttä6</ExtraField6>
<InternalInformationFreeText>For urgent attention</InternalInformationFreeText>
<DeliveryInstructionFreeText>Delivery to doorstep, call the recipient at 0501231234</DeliveryInstructionFreeText>
<InvoiceInstructionFreeText>Accounting office customer number 123456 on the invoice</InvoiceInstructionFreeText>
<TransportInstructionFreeText>FRAGILE!</TransportInstructionFreeText>
</Finvoice>
3.3.6 Request (PUT CreatePaymentTermMethod)
<?xml version="1.0" encoding="utf-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NBWS" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<env:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>username</wsse:Username>
<wsse:Password>password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<ns1:put>
<Request>
<CreatePaymentTermMethod>true</CreatePaymentTermMethod>
<PaymentTerm>
<Description>Maksuehto</Description>
<AmountToAdd>10</AmountToAdd>
<UnitToAdd>day</UnitToAdd>
<DiscountDays>5</DiscountDays>
<DiscountPercent>3.5</DiscountPercent>
</PaymentTerm>
</Request>
</ns1:put>
</env:Body>
</env:Envelope>
3.3.7 Response (PUT CreatePaymentTermMethod)
<?xml version="1.0" encoding="utf-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:NBWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
<env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
<ns1:putResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<rpc:result>Response</rpc:result>
<Response xsi:type="enc:Struct">
<ResponseStatus xsi:type="xsd:int">1</ResponseStatus>
<ResponseMessage xsi:type="xsd:string">Payment term was created successfully</ResponseMessage>
</Response>
</ns1:putResponse>
</env:Body>
</env:Envelope>