An external system informs VirtualNewspaper about a new subscription.
Webservice url
http://[wwx].virtualnewspaper.it/editor_or_title_name/webservice/insertSubscriberCode.jsp + POST parameters
Webservice Mandatory Parameters
Mandatory parameters are : authCode, code, product_id (or product_internalId), activationDate, expirationDate
A different call is required for each subscription you need to insert.
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) Call received and correctly processed
In this scenario, a JSON response will look like:
{
"order": {
internalId: “88261”
user_email: “customer@email.com” #Blank in case no user was found
}
“status”:”OK”
“request”:“Request parameters”
}
Please link provided VirtualNewspaper internal order ID, with user data fields stored at your end.
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 |
|---|---|---|---|---|
| code | Y | varchar(255) | Is the subscriber code, will be always used to find the a real subscriber. If the subscriber is found the subscription will be immediately connected to him, the order will be freezed in case no subscriber found matching this provided code | ayy877s |
| product_id | Y | varchar(255) |
The product code to be used so to connect the user the correct titles (it can be replaced by product_internalId) so to find products by internal id instead of product code |
DGT_1 |
| activationDate | Y | varchar(10) | with the format: yyyy-MM-dd provides the activation date of the subscription | 2016-10-25 |
| expireDate | Y | varchar(10) | with the format: yyyy-MM-dd provides the expiration date of the subscription | 2017-02-24 |
| authCode | Y | varchar | must contains code+security code (available on the "Settings" pane of your VirtualNewspaper Back-end) in md5 (e.g authCode = md5(ayy877sYourSecredSecurityCode)) | |
| description | N | varchar(255) | A text which describes the subscription to the user | Your free online reading of these 4 months |
| orderId | N | int(11) | External system unique order id. | |
| 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. | |
| paymentDate | N | date | ||
| gracePeriod | N | date | ||
| paymentCode | N | string | ||
| idGateway or gateway_id | N | int(10) | Payment gateway ID, if available. | |
| 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 | 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 |
cart example
{
"product_id": "ABB12M_1t",
"product_internalId": 0,
"price": 33.3
},
{
"product_id": "ABB12M_2t",
"product_internalId": 0,
"price": 33.3
},
{
"product_id": "ABB12M_3t",
"product_internalId": 0,
"price": 33.3
},
{
"product_id": "",
"product_internalId": 15,
"price": 3.9
}