VNP Input Webservices - Orders/Subscriptions
"wsRegisterOrder.jsp" is a VirtualNewspaper input webservice to collect and store any order created on an external platform. VirtualNewspaper will reply with its internal order ID.

An external platform informs VirtualNewspaper that a new order has been created. All order details are submitted to VirtualNewspaper.
Warning:
This POST call needs to be url encoded
Webservice url
http://[wwx].virtualnewspaper.it/title_or_platform_name/webservice/wsRegisterOrder.jsp+parameters
Webservice Mandatory Parameters
Mandatory parameters are : 'orderId, 'customerId, product_id and authCode.
Example
Parameters need to be provided using this syntax:
?orderId=1a2b3c4d5e&customerId=3645g4&product_id=fr34df56&authCode=1a2b3c4d5k34725t
A new webservice call is needed for every incoming order.
Parameters and their values, need to be separated by the "equal to" char ("=").
After each parameter/value an "&" char is required.
Warning:
You need to provide all parameters you want to synchronize.
Any missing or empty parameter will be stored using a "default value".
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”
}
| PARAMETER NAME | MANDATORY | VALUE FORMAT | DESCRIPTION | EXAMPLE |
|---|---|---|---|---|
| orderId | Y | String | External system unique order id. | |
| customerId | Y (if you don't provide the email) | String | External system unique customer id. It must already exist in VirtualNewspaper customers table. Orders from unkown users will be rejected. | |
| Y (if you don't provide customerId) | String | Customer email. It must already exist in VirtualNewspaper customers table. Orders from unkown users will be rejected. | ||
| [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). | |
| zip | N | String | ZIP Code | |
| town | N | String | Zone or locality | |
| city | N | String | City | |
| address | N | String | ||
| nation | N | String | ||
| telephone | N | String | ||
| surname | N | String | ||
| name | N | String | ||
| 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 | |
| mobile | N | Strjng | ||
| shipping_amount | N | Double(10,2) | Paid by the user for the shipping | |
| company_name | N | String |
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
}