VNP Input Webservices - Register Anonymous order

WS Register Anonymous order

"wsRegisterAnonymousOrder.jsp" is a VirtualNewspaper input webservice to collect and store any anonymous order created on an external platform.

How to invoke this webservice

An external platform informs VirtualNewspaper that a new anonymous order has been created. All order details are submitted to VirtualNewspaper.

Webservice url
https://DOMAIN/PLATFORM/webservice/wsRegisterAnonymousOrder.jsp

Webservice Mandatory Parameters
Mandatory parameters are: orderId, appsn, product_id, authCode.

Example
Parameters need to be provided using this syntax:
?orderId=1a2b3c4e&product_id=3645g4&authCode=1a2b3c34725t

A new request is needed for every incoming order.

Warning:
You need to provide all parameters you want to synchronize. 
Any missing or empty parameter will be stored using a "default value".

Webservice reply

This VirtualNewspaper webservice is able to provide two different replies :

01) Order has been successfully created. This is VirtualNewspaper internal order ID.
In this scenario VirtualNewspaper JSON reply will look like this :

{
“order” : {
internalId: “88261”
productDescription: “1 month subscription”
orderNumber: “VNP-136446314182261”
orderId: “orderExternalId”
}
“status”: “OK”
“request” : “Request parameters”
}

Please, link VirtualNewspaper order ID to your internal order ID.

02) Something went wrong.
In this scenario VirtualNewspaper JSON reply will look like this :

{
“status”:“KO”,
“error”:“Error message”
“request”:“Request parameters”
}

PARAMETERS REFERENCE TABLE

PARAMETER NAME MANDATORY VALUE FORMAT DESCRIPTION EXAMPLE
orderId Y String External system unique order id.
appsn Y String The unique device identifier
[provider]_uid N String Third party provider unique customer id.
In case users datas are handled by a third party this will contain the third party user ID. E.g. If the third party is Gigya the parameter will be named gigya_uid
product_id Y (if you don't provide product_internalId) string [Can be left blank if product_internalId is used] External system unique product id. It must already exist in VirtualNewspaper products table. Orders reporting unkown products will be rejected.
product_internalId Y (if you don't provide product_id) int(11) [Can be left blank if product_id is used] VirtualNewspaper unique product id.
authCode Y string Authorization token that allows VirtualNewspaper to handle any incoming request. md5(orderId+privateKey)
amount N Double(10,2) Total amount paid by the end user (currency is configured inside the product).
notes N String
days N varchar(7) Number of days on which the end user will receive his hard copy
confirmed N int(11) 1: order is activated, 0: order is not activated.
activationDate N date
expireDate N date
paymentDate N date
gracePeriod N date
paymentCode N string
idGateway or gateway_id N int(10) Payment gateway ID, if available.
cart N string in case more than one product is collected within a single order, they can be provided as a JSON list (format described below). If this parameter is provided, product_id and product_internalId will be ignored See below
scope N String If submitted, webservice will create an order with this scope value. It will return the discountCode only when the confirmed parameter is 1 scope=gift
sendMail N String If confirmed is 1 and this parameter is set to true, VirtualNewspaper will send a confirmation email to the end user (default value is false) true/false
title N String The title the order is associated to titlename
custom1 N String Your reference field, can contain anything you need
custom2 N String Your reference field, can contain anything you need
custom3 N String Your reference field, can contain anything you need
custom4 N String Your reference field, can contain anything you need
custom5 N String Your reference field, can contain anything you need
shipping_amount N Double(10,2) Paid by the user for the shipping
createAnonymousUser N Boolean if true an anonymous user connected to the order will be created. In this case the response will contain "anonymousEmail" and "anonymousPassword" autogenerated by the system
withWebservice N Boolean if true the CreateOrder webservice will be triggered

cart example

 {
"product_id": "ABBQR12M",
"product_internalId": 0,
"price": 33.3,
"issues": ""
"custom1": "",
"custom2": "",
"custom3": "",
"custom4": "",
"custom5": "",
},
{
"product_id": "ABBQR12M",
"product_internalId": 0,
"price": 33.3
},
{
"product_id": "ABBQR12M",
"product_internalId": 0,
"price": 33.3
},
{
"product_id": "",
"product_internalId": 15,
"price": 3.9
}