VNP Output Webservices - Orders/Subscriptions

WS Output Update Order

"UpdateOrder.jsp" is used by VirtualNewspaper to transmits to any external platform updates occurred on a particular order, allowing the external platform to update its own datas accordingly. Each time a particular order is updated on VirtualNewspaper, this webservice will take care to inform the external platform about these changes. All order informations are transmitted, even if only few of them have been updated.

WS: UpdateOrder.jsp

How to invoke this webservice

VirtualNewspaper will make this POST call to an external webservice, providing a complete set of informations coming out from any order updated on VirtualNewspaper.

Warning:
This POST call will be url encoded

Webservice url
Any external platform needs to provide a proper webservice url, allowing VirtualNewspaper to make its own call.

Parameters
VirtualNewspaper will transmit a complete parameters set, even if only few of them have been updated by the end user. Any external platform needs to be ready to collect and store informations arriving from VirtualNewspaper.

Example
Parameters will be provided using this syntax:
?customerId=376387&product_id=fr34df56&and_so_on...

A different call will take place for every updated order.
Parameters and their values, will be separated by the "equal to" char ("="). 
After each parameter/value an "&" char is provided.

Webservice reply

Any external platform, once datas will be collected, needs to reply with its own internal order ID.
Two different replies are expected by VirtualNewspaper :

01) Order has been found and its details have been updated accordingly.  
In this scenario a JSON reply will look like this :

{
“status” : “OK”
}

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

{
“status”:“KO”,
“message”:“Error message”
}

GIFT and MULTIPLE ORDERS

In MULTIPLE order (or business order) we have a "father" order that is related to more "sons" orders. The sons are allowed to access the content.

In GIFT order (or business order) we have a "father" order that is related to one "son" order. The son is allowed to access the content.
For those orders the webservice sends:

parent_order_internalId = FATHER ORDER internal Id (internal VNP Id)
parent_order_id = FATHER ORDER external Id (the external platform Id)
parent_order_scope = declare if it's a GIFT or BUSINESS order

PARAMETERS REFERENCE TABLE

PARAMETER NAME VALUE FORMAT DESCRIPTION
orderId int(11) External platform unique order ID
id int(11) VirtualNewspaper unique order id
activationDate date Subscription start date
expireDate date Subscription expiration date
customerId int(11) External platform unique customer id
[provider]_uid String(255) 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 String External platform unique product id (it needs to be set in VirtualNewspaper back-end)
number varchar(60) VirtualNewspaper auto generated order number
date date Order registration date
amount Double (10,2) Total amount
discount decimal(10,2) Total discounted value
discountPerc decimal(10,2) Discount %
discountCode varchar(30) Coupon code to activate any discount
confirmed int(11) (1 or 0) if set to 1, any order will be activated
device varchar(150) End user device (e.g. web, android, iOS)
deleted tinyint(4) (1 or 0) if set to 1, any order will be hidden (deleted) inside VirtualNewspaper back-end
appId String
apple_transaction_id varchar(20)
articleCode String
articleName String
processed Int (1 or 0) 1 means VirtualNewspaper has successfully processed this order
gateway_id int(10)
id_user Int VirtualNewspaper unique user id
monthsValidity Int
payment_Id int(11)
paymentCode String Payment method code
paymentDate date
shipping mediumtext
shipping_administrative_area_level_1 varchar(200)
shipping_administrative_area_level_2 varchar(200)
shipping_administrative_area_level_3 varchar(200)
shipping_formatted_address varchar(500)
shipping_ordini.lat varchar(50)
shipping_ordini.lng varchar(50)
shippingAddress mediumtext
shippingCity mediumtext
shippingCompany mediumtext
shippingName mediumtext
shippingNation mediumtext
notes mediumtext
shippingPrice String
shippingSurname mediumtext
shippingTelephone mediumtext
shippingTown mediumtext 
shippingWeight Double (7,2)
shippingZip String
transactionId text
usedCopies varchar(100) Contains copies used with this order. Possible values: 20160620virtualnews refers to the copy of 20/06/2016 for the title Virtual News.
detailOrders String(JSON) JSon array containing all the products purchased in this transaction (e.g. detailOrders=[{"article_id":"988328","articleCode":"ART-988328","articleName":"1 month subscription","monthsValidity":"1"}, {"article_id":"513322","articleCode":"ART-513322","articleName":"1 month subscription","monthsValidity":"1"}]) where article_id is the product_id purchased mostly the only useful field in the JSON
parent_order_internalId int FATHER ORDER internal Id (internal VNP Id)
parent_order_id String FATHER ORDER external Id (the external platform Id)
parent_order_scope String Gift / Business