Skip to main content

Add Invoice

The AddInvoice requests performs a credit check of the customer, and if approved, adds the invoice. Otherwise an error message is returned.

Unless using the GetAddress/GetCompanyInformation method (only available in Sweden), this is the first step in creating an invoice.

This method will return the Invoice number (InvoiceNumber) which should be stored and used when handling the order/invoice later (e.g. CreditInvoice, PartCreditInvoice, AdjustInvoice, CancelInvoice etc).

The created invoice then needs to be activated through the ActivateInvoice or PartActivateInvoice (The invoice can also be auto activated directly in the AddInvoice request, if the package is sent directly when ordered).

The functionality Campaign Products, included in the AddInvoice request, allows you to customize and set up campaigns for your customers with special conditions of sale, e.g. campaigns with longer payment time, different invoice fees or specific transaction costs. To use this functionality, an agreement with Walley must be made.

This method is available in the following countries:

Request Parameters​

IMPORTANT

Please note that the order of the parameters is of importance. The list below displays the expected order.

FieldOccursnullableMaxTypeDescription
ClientIpAddress1false50stringThe IP address of the customer performing the purchase at the partner's web shop.
Password1false50stringThe password used to authorize the request.
Username1false50stringThe username used to authorize the request.
ActivationOption1false-intDifferent options for affecting a purchase.
Following values can be used (default value is 0):
0 = Purchase will be preliminary and must be
activated, by using the ActivateInvoice or through
the Walley Merchant Hub.
1 = Auto activation, will automatically active the
invoice so it can be sent out directly.
This can only be used when the order can be
delivered directly.
2 = Pre-Paid invoice. The purchase will be activated
first when an invoice is paid. Not used at the moment.
AdditionalInformation[]1true-AdditionalInformation[]Used depending on agreement with Walley.
AuthorizedSignatory1False-[]In case of a B2B purchase using part payment
Authorized (InvoiceType=5). This segment is used to send out a
Signatory digital signing task to the authorized signatory.
Nillable in case of B2C purchase.
Buyer1true-Buyer[]This field is used for company purchases where the
details of the person making the purchase should be
sent in
CorrelationId1true50stringCorrelationID is sent back in the response.
CostCenter1true50stringFor companies that needs to specify a cost center.
CountryCode1false2stringThe country code (ISO 3166-1 alpha-2) for country.
Currency1false3stringCurrency used during the purchase. Must be the same currency where the customer is registered, and the e-store owner is located. Currency code is a three-letter combination based on ISO 4217, for example: SEK, DKK, EUR.
CustomerNumber1true20stringIf the e-store wants to search for a customer by their
own customer id, this field can be used to specify
that number. Also shown on invoice.
CustomerProxyIdentifier1true50stringThe civic registration number of the proxy person.
DeliveryAddress1true-Address[]The address where the product should be delivered
to. For private persons this must be the address
where the person is registered.
ElectronicInvoiceDeliveryInformation1true1000stringUsed for passing information about electronic invoice information.
Currently used for Finvoice in Finland.
Used in combination with InvoiceDeliveryMethod 8
Format:
IntermediatorAddress ; ReceiverAddress
ForceApproveCreditCheck1true-boolValidation of address information can be ignored if the purchase is prepaid
IgnoreAddressValidationForPrepaid1true-boolUsed to ignore address validation on purchases made using prepaid payment methods.
IntegrationId1true128stringThe integration ID can be assigned to customers in order to uniquely identify customers (instead of using Civic reg no).
InvoiceAddress1true-Address[]The invoice address where the invoice should be
sent to. For private persons this must be the address
where the person is registered.
InvoiceDeliveryMethod1false-intThe way to send the invoice. By default this is set by
Walley, but can be negotiated with Walley. If a
current invoice exists, the latest information will be
used next time the invoice is sent.
The Value can be:
1 = By post or in package based on invoice type.
2 = E-mail.
3 = Both by post and e-mail
8 = Electronic invoice delivery
16 = Suppress delivery of invoice
32 = Force mail (only used in combination with InvoiceType 0 and if agreed with Walley)
InvoiceRows1false-InvoiceRow[]The articles that should be listed on the invoice and
contains the quantity and price of the article.
InvoiceType1false-intSpecify the type of invoice to use.
The values (default value is 0) are:
0 = Invoice will be in the package and/or directly
sent with e-mail if InvoiceDeliveryMethod is set to e-
mail, Walley will not send this invoice to the
customer, you will send it as part of the package.
1 = Monthly invoice. Walley will send this invoice.
3 = Aggregated invoice. Walley will send the
invoice. All invoices incoming during the same
month with this flag will be aggregated to one
invoice.
4 = Interest free invoice. Walley will send the
invoice.
5 = Annuity invoice. Walley will send this invoice.
OrderDate1false-datetimeThe date that the costumer placed the order.
OrderNumber1true20stringThe order's identification can be used to search for a
specific order in the Walley Merchant Hub.
PaymentInfo1true-PaymentInfoBank or invoice Information for payout. Cannot be used in combination with SettlementReference.
ProductCode1true16stringThe campaign product code. The product code is
determined by Walley. To use campaign products
an agreement with Walley must be made.
PurchaseClassification1true50stringThis field is used for an alternative credit evaluation. Contact Walley for more details.
PurchaseType1true-intThe type of the purchase, to specify where the
purchase originates from. The value can be:
0 = E-Commerce
1 = InStore
2 = InvoicePayment
3 = P2P
4 = Telesales
5 = CreditCard
6 = DebitCard
7 = Cash
Reference1true50stringThe Reference that should be as a reference on an
invoice. Will only be used for companies.
RegNo1true20stringThe registration number of the customer. Either civic registration number or organization number. Only nillable if an IntegrationId is set and has been assigned to the RegNo beforehand.
RequireStrongCustomerVerification1true-boolThis parameter is deprecated.
Determines if the customer should be required to
authenticate themselves using some type of strong verification method.
RequireUnknownRegistrationNumber1true-boolUsed to enable anonymous purchases, without known registration number.
SalesPerson1true50stringInformation about the sales person
SettlementReference1true350stringSettlement reference added to the payment. Cannot be used in combination with PaymentInfo.
StoreId1true-intThe StoreId used for identification of store.
StoreReference1true50stringThis field can be used for specifying a store reference

InvoiceRow​

ParameterRequiredTypeMaxDescription
ArticleIdxstring50The ArticleId of the product.
Descriptionxstring50The description of the product.
Quantityxint8The quantity of the product. 1-99999999 (0 not allowed)
QuantityUnit-string50The quantity unit of the product, e.g. pcs, meter, number, kg etc.
UnitPricexdecimal6,2Price per unit incl. VAT.
VATxdecimal6,2VAT in per cent

PaymentInfo​

ParameterRequiredTypeMaxDescription
ReceiverName-string64Name of the company
ReceiverRegNumber-string64The organization number of receiving company
PaymentReference-string350Reference added to the payment. OCR number must be no longer than 20 characters
BankAccount-string50Bank account number. For bank account types with multiple parts "|" (pipe) is used as a delimiter.
BankAccountType-intSee below

AdditionalInformation​

ParameterRequiredTypeMaxDescription
Key: PeppolId
Value: <The peppol id>
-string50The peppol id including prefix and address, separated by comma (:).
Used in combination with InvoiceDeliveryMethod 8.
Currently used in SE, NO and FI.
Example SE: 0007:2120000787
Key: BusinessToken
Value: <Token returned from B2B identification API>
-string50The token returned from the B2B identification API after purchase rights have been validated.
Only used after agreement with Walley.
Key: ProxyEvaluation
Value: <Disabled/Enabled>
-string50Set to "Disabled" in order to override and ignore the proxy evaluation functionality.

BankAccountType​

  • 0 - Bic Iban (DEUTDEFF DE99203205004989123456)
  • 1 - Iban (DE99203205004989123456)
  • 2 - Plusgiro, with OCR
  • 3 - Plusgiro, with message
  • 4 - Bankgiro, with OCR
  • 5 - Bankgiro, with message

Response Parameters​

FieldOccursnullableMaxTypeDescription
CorrelationId1true50stringCorrelationID from the request if any.
PaymentReference1true50stringThe payment identification number. This is the id the
customer must use when they do a payment of an
invoice. Only returned if the invoice is auto activated.
AvailableReservationAmount1true6,2decimalThe current available reservation amount. If no credit reservation is done, 0 will be returned.
LowestAmountToPay1true6,2decimalThe lowest amount to pay on the invoice. Only returned
if the invoice is auto activated.
TotalAmount1true6,2decimalThe total amount to pay for the invoice. Only returned if
the invoice is auto activated.
InvoiceNumber1false-stringThe invoice number of the invoice.
InvoiceStatus1false-stringThe status of the purchase. Values:
0 = On hold - Walley haven't approved the invoice
yet.
1 = Approved - The invoice is approved by Walley and
can be activated through the Activate invoice or
PartActivate invoice method or from the Walley
Merchant Hub.
2 = Activated - The product(s) is delivered and Walley
will buy the invoice.
DueDate1true-datetimeThe due date of the invoice. Only returned if the invoice
is auto activated.
InvoiceUrl1true-stringIf the invoice is auto activated and the invoice type is

direct invoice, the InvoiceUrl contains a url to theinvoice in a pdf file format.

Example Requests​

Β Value
Environment:UAT
Service:PaymentService
URL:https://ecommercetest.collector.se/v3.0/PaymentServiceV10.svc?wsdl
Function:AddInvoice
Description:The operation returns invoice information upon creation of an invoice.
Notes:N/A

Example for B2C​

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pay="http://schemas.ecommerce.collector.se/v30/PaymentService">
<soapenv:Header>
<pay:Username>USERNAME</pay:Username>
<pay:Password>PASSWORD</pay:Password>
<pay:ClientIpAddress>127.0.0.1</pay:ClientIpAddress>
</soapenv:Header>
<soapenv:Body>
<pay:AddInvoiceRequest>
<pay:ActivationOption>0</pay:ActivationOption>
<pay:AdditionalInformation xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:CorrelationId>AddInvoiceV10_B2C</pay:CorrelationId>
<pay:CostCenter xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:CountryCode>SE</pay:CountryCode>
<pay:Currency>SEK</pay:Currency>
<pay:CustomerNumber xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:CustomerProxyIdentifier xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:DeliveryAddress>
<pay:Address1>Teststreet 1</pay:Address1>
<pay:Address2 xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:COAddress>C/O Address</pay:COAddress>
<pay:City>Test CIty</pay:City>
<pay:CompanyName xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:CountryCode>SE</pay:CountryCode>
<pay:Email>nohmtest@walley.se</pay:Email>
<pay:Firstname>FirstName</pay:Firstname>
<pay:Lastname>LastName</pay:Lastname>
<pay:MobilePhone>+461234567890</pay:MobilePhone>
<pay:PhoneNumber xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PostalCode>12345</pay:PostalCode>
</pay:DeliveryAddress>
<pay:ElectronicInvoiceDeliveryInformation xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:IntegrationId xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:InvoiceAddress>
<pay:Address1>Teststreet 1</pay:Address1>
<pay:Address2 xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:COAddress>C/O Address</pay:COAddress>
<pay:City>Test CIty</pay:City>
<pay:CompanyName xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:CountryCode>SE</pay:CountryCode>
<pay:Email>nohmtest@walley.se</pay:Email>
<pay:Firstname>FirstName</pay:Firstname>
<pay:Lastname>LastName</pay:Lastname>
<pay:MobilePhone>+461234567890</pay:MobilePhone>
<pay:PhoneNumber xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PostalCode>12345</pay:PostalCode>
</pay:InvoiceAddress>
<pay:InvoiceDeliveryMethod>1</pay:InvoiceDeliveryMethod>
<pay:InvoiceRows>
<pay:InvoiceRow>
<pay:ArticleId>ArticleId 1</pay:ArticleId>
<pay:Description>Description 1</pay:Description>
<pay:Quantity>1</pay:Quantity>
<pay:QuantityUnit>pcs</pay:QuantityUnit>
<pay:UnitPrice>100</pay:UnitPrice>
<pay:VAT>25</pay:VAT>
</pay:InvoiceRow>
<pay:InvoiceRow>
<pay:ArticleId>ArticleId 2</pay:ArticleId>
<pay:Description>Description 2</pay:Description>
<pay:Quantity>2</pay:Quantity>
<pay:QuantityUnit>meter</pay:QuantityUnit>
<pay:UnitPrice>200</pay:UnitPrice>
<pay:VAT>12</pay:VAT>
</pay:InvoiceRow>
<pay:InvoiceRow>
<pay:ArticleId>Article 1</pay:ArticleId>
<pay:Description>Description 1</pay:Description>
<pay:Quantity>150</pay:Quantity>
<pay:QuantityUnit>pcs</pay:QuantityUnit>
<pay:UnitPrice>150</pay:UnitPrice>
<pay:VAT>25</pay:VAT>
</pay:InvoiceRow>
</pay:InvoiceRows>
<pay:InvoiceType>0</pay:InvoiceType>
<pay:OrderDate>2020-02-01</pay:OrderDate>
<pay:OrderNumber>O123456789</pay:OrderNumber>
<pay:ProductCode xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PurchaseClassification xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PurchaseType xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:Reference xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:RegNo>195109212224</pay:RegNo>
<pay:SalesPerson xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:SettlementReference xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:StoreId>1234</pay:StoreId>
<pay:StoreReference xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</pay:AddInvoiceRequest>
</soapenv:Body>
</soapenv:Envelope>

Example for B2B with Authorized Signatory and Buyer Information​



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pay="http://schemas.ecommerce.collector.se/v30/PaymentService"
xmlns:inv="http://schemas.ecommerce.collector.se/v30/InvoiceService">
<soapenv:Header>
<pay:Username>USERNAME</pay:Username>
<pay:Password>PASSWORD</pay:Password>
<pay:ClientIpAddress>127.0.0.1</pay:ClientIpAddress>
</soapenv:Header>
<soapenv:Body>
<pay:AddInvoiceRequest>
<pay:ActivationOption>0</pay:ActivationOption>
<pay:AdditionalInformation xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:AuthorizedSignatory>
<pay:Email>test@walley.se</pay:Email>
<pay:RegistrationNumber>4502198429</pay:RegistrationNumber>
<pay:UsePersonalGuarantee>true</pay:UsePersonalGuarantee>
</pay:AuthorizedSignatory>
<pay:Buyer>
<pay:Email>test@walley.se</pay:Email>
<pay:FirstName>Testare</pay:FirstName>
<pay:LastName>Testsson</pay:LastName>
<pay:MobilePhone>+460123456789</pay:MobilePhone>
<pay:RegistrationNumber>194901022188</pay:RegistrationNumber>
</pay:Buyer>
<pay:CorrelationId xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:CostCenter>8858</pay:CostCenter>
<pay:CountryCode>SE</pay:CountryCode>
<pay:Currency>SEK</pay:Currency>
<pay:DeliveryAddress>
<pay:Address1/>
<pay:Address2 xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:COAddress xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:City>Testcity</pay:City>
<pay:CompanyName>Skuldman o Son, TEST AB</pay:CompanyName>
<pay:CountryCode>SE</pay:CountryCode>
<pay:Email>test@walley.se</pay:Email>
<pay:Firstname xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:Lastname xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PostalCode>12345</pay:PostalCode>
</pay:DeliveryAddress>
<pay:IntegrationId xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:InvoiceAddress>
<pay:Address1/>
<pay:Address2 xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:COAddress xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:City>Testcity</pay:City>
<pay:CompanyName>Skuldman o Son, TEST AB</pay:CompanyName>
<pay:CountryCode>SE</pay:CountryCode>
<pay:Email>test@walley.se</pay:Email>
<pay:Firstname xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:Lastname xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PostalCode>12345</pay:PostalCode>
</pay:InvoiceAddress>
<pay:InvoiceDeliveryMethod>1</pay:InvoiceDeliveryMethod>
<pay:InvoiceRows>
<pay:InvoiceRow>
<pay:ArticleId>10547</pay:ArticleId>
<pay:Description>Linne</pay:Description>
<pay:Quantity>12</pay:Quantity>
<pay:UnitPrice>500</pay:UnitPrice>
<pay:VAT>25</pay:VAT>
</pay:InvoiceRow>
<pay:InvoiceRow>
<pay:ArticleId>57389</pay:ArticleId>
<pay:Description>Ring</pay:Description>
<pay:Quantity>3</pay:Quantity>
<pay:UnitPrice>250</pay:UnitPrice>
<pay:VAT>6</pay:VAT>
</pay:InvoiceRow>
</pay:InvoiceRows>
<pay:InvoiceType>5</pay:InvoiceType>
<pay:OrderDate>2020-08-06</pay:OrderDate>
<pay:OrderNumber>6005075764</pay:OrderNumber>
<pay:ProductCode xsi:nil="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<pay:PurchaseType>1</pay:PurchaseType>
<pay:Reference>Your Reference</pay:Reference>
<pay:RegNo>5561234567</pay:RegNo>
<pay:SalesPerson/>
<pay:SettlementReference>5050</pay:SettlementReference>
<pay:StoreId>9666</pay:StoreId>
</pay:AddInvoiceRequest>
</soapenv:Body>
</soapenv:Envelope>


Error Codes​

Fault CodeDescription
AUTHORIZATION_FAILEDCould not authorize the request, check your login credentials. Please contact Walley for more help.
VALIDATION_COUNTRY_CODE_REQUIREDThe CountryCode field was not present in the request.
VALIDATION_ARTICLE_ID_REQUIREDAn article is missing its ArticleId.
VALIDATION_QUANTITY_RANGEThe Quantity field was not within its allowed range.
VALIDATION_SETTLEMENT_REFERENCE_LENGTHThe Settlement Reference field was not within its allowed range.
INVALID_REGISTRATION_NUMBERWhen the reg.no is not in a correct format.
INTEGRATION_ID_AND_REGISTRATION_NUMBER_MUST_BE_EMPTYNeither IntegrationId nor RegNo was set in the request.
INVOICE_EXCEEDS_AVAILABLE_RESERVATIONThe purchase sum of the invoice exceeds the available reservation amount.
EMAIL_IS_MISSINGInclude customer's email address in the request
NOT_ALLOWED_TO_SEND_NOTIFICATION_BY_MAILThe agreement with Walley does not allow invoices by regular post
NOT_ALLOWED_TO_IGNORE_CREDIT_CHECK_WITH_UNKNOWN_REGISTRATION_NUMBERThe agreement with Walley does not allow to ignore credit check with unknown registration number
PEPPOL_ID_INVALIDWhen the peppol id is not in correct format

If the error code you are looking for is not in the list above Please see separate page Error Codes