#Print&Pay web services
Provides service methods to handle Print&Pay operations.
* **Type**: SOAP
* **Production WSDL**: https://services.generali.gr/soap/v2/printandpay?wsdl
* **Test WSDL**: https://services-test.generali.gr/soap/v2/printandpay?wsdl
Methods
* [listDistChannelLimits](#listDistChannelLimits)
* [findDistChannelLimit](#findDistChannelLimit)
* [listJournalsByDistChannel](#listJournalsByDistChannel)
* [findJournal](#findJournal)
* [findEndorsement](#findEndorsement)
* [listUnpaidEndorsementsByDistChannel](#listUnpaidEndorsementsByDistChannel)
* [listUnpaidFastPayEndorsementsByDistChannel](#listUnpaidFastPayEndorsementsByDistChannel)
* [listEndorsementsByJournal](#listEndorsementsByJournal)
* [createJournal](#createJournal)
* [createPayment](#createPayment)
* [getPaymentStatus](#getPaymentStatus)
* [Error Codes](#errorCodes)
##listDistChannelLimits
Returns the amount and day limits of all Distribution Channels of the user.
###Output
Type | Description | Example
---- | ----------- | -------
List[DistChannelLimit] | A list with all the limits of all Dist Channels | *(see below)*
#### DistChannelLimit
Field | Type | Description | Example
----- | ---- | ----------- | -------
distChannelCode | String | The code of the Dist Channel | 00100
totalAmount | BigDecimal | The allowed total amount of the Dist Channel | 300.00
outstandingAmount | BigDecimal | The remaining amount | 5.05
totalDays | Integer | The allowed total days | 10
outstandingDays | Integer | The remaining days | -5 *(if days are <-2 the Dist Channel is locked, which means that the client is not able to create new Journal)*
###Example
*Input*
```
```
*Output*
```
00100
5.05
-5
300.00
10
06249
300.00
10
300.00
10
06288
300.00
10
300.00
10
06246
300.00
10
300.00
10
06245
300.00
10
300.00
10
06258
300.00
10
300.00
10
06248
300.00
10
300.00
10
06247
300.00
10
300.00
10
06255
300.00
10
300.00
10
08000
99245069.82
920
99250000.00
923
06241
300.00
10
300.00
10
06244
300.00
10
300.00
10
06252
251.49
10
251.49
10
00303
300.00
10
300.00
10
06303
300.00
10
300.00
10
06250
300.00
10
300.00
10
00302
300.00
10
300.00
10
00510
9997105.39
973
9999900.00
990
06260
300.00
10
300.00
10
06310
300.00
10
300.00
10
```
##findDistChannelLimit
Returns the amount and day limits of a specific Dist Channel.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | The Dist Channel code from which we want to retrieve the limits | 00510
###Output
Type | Description | Example
---- | ----------- | -------
DistChannelLimit | The limit data of the DistChannel | *(see above)*
###Example 1
*Input*
```
00510
```
*Output*
```
00510
9997105.39
973
9999900.00
990
```
###Example 2
Example with exception
*Input*
```
12345
```
*Output*
```
ns2:Server
You are not authorized to find limits for distribution channel: 00520, please use: 00304, 06241, 00301, 07797, 50072, 00896, 06249, 06281, 05000, 06250, 06303, 05225, 00928, 06247, 06252, 06000, 06244, 06243, 06279, 08000, 09000, 06245, 00302, 00900, 06258, 08002, 06310, 08802, 06248, 06242, 00311, 08800, 00530, 06246, 00611, 00610, 00511, 00300, 00510, 00100, 04400, 00305, 00303, 00306, 00048, 06288, 55003, 06255, 06260
You are not authorized to find limits for distribution channel: 00520, please use: 00304, 06241, 00301, 07797, 50072, 00896, 06249, 06281, 05000, 06250, 06303, 05225, 00928, 06247, 06252, 06000, 06244, 06243, 06279, 08000, 09000, 06245, 00302, 00900, 06258, 08002, 06310, 08802, 06248, 06242, 00311, 08800, 00530, 06246, 00611, 00610, 00511, 00300, 00510, 00100, 04400, 00305, 00303, 00306, 00048, 06288, 55003, 06255, 06260
```
##listJournalsByDistChannel
Lists all the Journals of a Dist Channel.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | The Dist Channel code from which we want to retrieve the Journals | 08000
first | Integer | Integer | Optional | The first row. *Default value : 0* | 0
max | Integer | Integer | Optional | The number of max rows *Default value : 50* | 3
###Output
Type | Description | Example
---- | ----------- | -------
List[Journal] | A list of all the Journals | *(see below)*
#### Journal
Field | Type | Description | Example
----- | ---- | ----------- | -------
code | String | The code of the Journal | 00771612
creationDate | Date | The date the Journal was created | 2015-09-28T00:00:00+03:00
daysToGetPaid Number | The days remaining to get paid | *(see below)*
premiumAmount | BigDecimal | The gross amount of the Journal | 129.05
netAmount | BigDecimal | The net amount of the Journ | 129.05
status | String *(possible values : OPEN, IN_PAYMENT)* | The status of the Journal | OPEN
distChannelCode | String | The Dist Channel code in the journal belongs | 08000
notes | String | The notes of the Journal | "ΒΟΥΡΟΣ ΚΩΣΤΑΣ"
List[Endorsement] | Endorsement | A list with all the policies inside a journal | *(see below))*
#### EndorsementId
Field | Type | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
code | String | The code of the endorsement | 000000000
policyCode | String | The code of the policy | 11244860
quotationCode | String | The code of the quotation | 00915010
quotationPreviousPolicyCode | String | String | Optional | The old policy code of a renewal quotation | *(see example)*
###Example 1
This examples shows the output if there are existing Journals
*Input*
```
08000
0
3
```
*Output*
```
00771612
2015-09-28T00:00:00+03:00
08000
000000000
11244860
00915010
129.05
ΧΧΧΧΧΧ ΚΩΣΤΑΣ
129.05
OPEN
00771613
2015-09-28T00:00:00+03:00
08000
000000000
11244861
00915011
132.15
ΧΧΧΧΧΧ ΕΜΜΑΝΟΥΗΛ
132.15
OPEN
00771618
2015-09-28T00:00:00+03:00
08000
000000000
11244869
00915023
132.15
ΧΧΧΧΧΧ ΚΩΝΣΤΑΝΤΙΝΟΣ
132.15
OPEN
```
##findJournal
Finding the data of a specific Journal.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
journalCode | String | String | Required | The code of the journal | 00771612
###Output
Type | Description | Example
---- | ----------- | -------
Journal | The Journal data | *(see [listJournalsByDistChannel](#listJournalsByDistChannel))*
###Example 1
*Input*
```
00771612
```
*Output*
```
00771612
2015-09-28T00:00:00+03:00
08000
000000000
11244860
00915010
129.05
ΧΧΧΧΧΧ ΚΩΣΤΑΣ
129.05
OPEN
```
###Example 2
Example with exception
*Input*
```
002193845
```
*Output*
```
S:Server
Error while finding Journal
error
5
/journalCode
Η συναλλαγή δεν υπάρχει.
false
```
##findEndorsement
Retrieve a specific Journal endorsement.
If you want to retrieve a policy then in the input you have to fill **both** the policycode and the endorsementCode. If you want to retrieve a quotation you have to fill **only** the quotationCode.
###Input
Type | Description | Example
---- | ----------- | -------
Endorsement | The data of the endorsement | *(see below)*
#### EndorsementId
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
policyCode | String | String | Optional | The policy code | *(see example)*
code | String | String | Optional | The endorsement code of the policy | 000000000
quotationCode | String | String | Optional | The quotation code | 00915126
quotationPreviousPolicyCode | String | String | Optional | The old policy code of a renewal quotation | *(see example)*
###Output
Type | Description | Example
---- | ----------- | -------
EndorsementReceipt | The data of the specific policy | *(see below)*
#### Endorsement
Field | Type | Description | Example
----- | ---- | ----------- | -------
code | String | Endorsement Receipt code | 000000000
policyCode | String | The code of the policy | *(see example)*
quotationCode | String | The code of the quotation | 00915126
previousPolicyCode | String | The old policy code of a renewal quotation | *(see example)*
insuranceStartDate | Date | The start date of the policy | 2015-10-01T00:00:00+03:00
insuranceEndDate | Date | The end date of the policy | 2016-10-01T00:00:00+03:00
expireDate | Date | The expiration date of the policy | 2015-11-01T00:00:00+03:00
premiumGrossAmount | BigDecimal | The gross amount of the Endorsement | 318.92
premiumNetAmount | BigDecimal | The net amount of the Endorsement | 318.92
customerName | String | The name of the customer | STEF
customerSurname | String | The surname of the customer | TEST
extraDetails | String | Some extra details. To date we show the license number if exists | AAA3315
paymentCode | String | The payment code of the endorsement | 14000008216425375104
###Example1
Searching for a policy
*Input*
```
000000000
00915126
```
*Output*
```
000000000
STEF
TEST
AAA3315
2016-10-01T00:00:00+03:00
2015-10-01T00:00:00+03:00
14000008216425375104
318.92
318.92
00915126
```
###Example2
Searching for a quotation
*Input*
```
000000000
10865768
```
*Output*
```
000000000
ΒΑΣΙΛΕΙΟΣ
XXXXXXX
IPT0332
2013-12-03T00:00:00+02:00
2012-12-03T00:00:00+02:00
10865768
0.00
0.00
```
##listUnpaidEndorsementsByDistChannel
Lists all the Print&Pay Endorsements (Policies and Quotations) of a Dist Channel that are not paid and there are not inside a Journal.
If the output (EndorsementReceipt) has filled the field policyCode then it's a policy, else if the field quotationCode is filled,
then is a Quotation.
In case of a Quotation, if it comes from a renewal then the field quotationPreviousPolicyCode will be filled.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | The Dist. Channel code | 00510
first | Integer | Integer | Optional | The first row. *Default value : 0* | 10
max | Integer | Integer | Optional | The number of max rows *Default value : 50* | 3
###Output
Type | Description | Example
---- | ----------- | -------
List[EndorsementReceipt] | A list with endorsements data | *(see below)*
#### EndorsementReceipt
Field | Type | Description | Example
----- | ---- | ----------- | -------
code | String | Endorsement Receipt code | *(see example)*
policyCode | String | The code of the policy | *(see example)*
quotationCode | String | The code of the quotation | *(see example)*
quotationPreviousPolicyCode | String | The old policy code of a renewal quotation | *(see example)*
startDate | Date | The start date of the policy | *(see example)*
endDate | Date | The end date of the policy | *(see example)*
expireDate | Date | The expiration date of the policy | *(see example)*
premiumAmount | BigDecimal | The gross amount of the Endorsement | *(see example)*
netAmount | BigDecimal | The net amount of the Endorsement | *(see example)*
customerName | String | The name of the customer | *(see example)*
customerSurname | String | The surname of the customer | *(see example)*
extraDetails | String | Some extra details. To date we show the license number if exists | *(see example)*
paymentCode | String | The payment code of the endorsement | *(see example)*
###Example
*Input*
```
00510
10
3
```
*Output*
```
000000000
ΚΩΝΣΤΑΝΤΙΝΟΣ
XXXXXXX
IKM9594
2016-03-12T00:00:00+02:00
2015-09-12T00:00:00+03:00
14000008176327975108
66.88
66.88
00899004
000000000
ΚΩΝΣΤΑΝΤΙΝΟΣ
XXXXXXX
IKM9594
2016-03-12T00:00:00+02:00
2015-09-12T00:00:00+03:00
14000008176328775102
66.88
66.88
00899005
000000000
ΚΩΝΣΤΑΝΤΙΝΟΣ
XXXXXXX
IKM9594
2016-03-12T00:00:00+02:00
2015-09-12T00:00:00+03:00
14000008176329575107
66.88
66.88
00899006
```
##listUnpaidFastPayEndorsementsByDistChannel
Lists all the Fast Pay Endorsements (Policies and Quotations) of a Dist Channel that are not paid and there are not inside a Journal.
If the output (EndorsementReceipt) has filled the field policyCode then it's a policy, else if the field quotationCode is filled,
then is a Quotation.
In case of a Quotation, if it comes from a renewal then the field quotationPreviousPolicyCode will be filled.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | The Dist. Channel code | 00510
first | Integer | Integer | Optional | The first row. *Default value : 0* | 10
max | Integer | Integer | Optional | The number of max rows *Default value : 50* | 3
###Output
Type | Description | Example
---- | ----------- | -------
List[EndorsementReceipt] | A list with endorsements data | *(see below)*
#### EndorsementReceipt
Field | Type | Description | Example
----- | ---- | ----------- | -------
code | String | Endorsement Receipt code | *(see example)*
policyCode | String | The code of the policy | *(see example)*
quotationCode | String | The code of the quotation | *(see example)*
quotationPreviousPolicyCode | String | The old policy code of a renewal quotation | *(see example)*
startDate | Date | The start date of the policy | *(see example)*
endDate | Date | The end date of the policy | *(see example)*
expireDate | Date | The expiration date of the policy | *(see example)*
premiumAmount | BigDecimal | The gross amount of the Endorsement | *(see example)*
netAmount | BigDecimal | The net amount of the Endorsement | *(see example)*
customerName | String | The name of the customer | *(see example)*
customerSurname | String | The surname of the customer | *(see example)*
extraDetails | String | Some extra details. To date we show the license number if exists | *(see example)*
paymentCode | String | The payment code of the endorsement | *(see example)*
###Example
*Input*
```
00510
10
3
```
*Output*
```
000000000
ΚΩΝΣΤΑΝΤΙΝΟΣ
XXXXXXX
IKM9594
2016-03-12T00:00:00+02:00
2015-09-12T00:00:00+03:00
14000008176327975108
66.88
66.88
00899004
000000000
ΚΩΝΣΤΑΝΤΙΝΟΣ
XXXXXXX
IKM9594
2016-03-12T00:00:00+02:00
2015-09-12T00:00:00+03:00
14000008176328775102
66.88
66.88
00899005
000000000
ΚΩΝΣΤΑΝΤΙΝΟΣ
XXXXXXX
IKM9594
2016-03-12T00:00:00+02:00
2015-09-12T00:00:00+03:00
14000008176329575107
66.88
66.88
00899006
```
##listEndorsementsByJournal
Lists the endorsement of a specific Journal
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
journalCode | String | String | Required | The journal from which you want to retrieve the endorsements | 00219360
first | Integer | Integer | Optional | The first row. *Default value : 0* | 0
max | Integer | Integer | Optional | The number of max rows *Default value : 50* | 2
###Output
Type | Description | Example
---- | ----------- | -------
List[EndorsementReceipt] | A list with endorsements data | *(see [listUnpaidEndorsements](#listUnpaidEndorsements))*
###Example 1
*Input*
```
00771629
0
10
```
*Output*
```
000000000
TEST
TEST
2016-03-29T00:00:00+03:00
2015-09-29T00:00:00+03:00
11244920
125.90
125.90
00915070
```
##createJournal
Creates a new Journal. At the end of the section you can find a list with extra error codes besides the ones in *General Considerations* for not being able to create a new Journal.
This method has been constructed mainly to serve bulk operations. In case you want to pay single quotation prefer payQuotation from Policy Services.
For unpaid Motor policies is mandatory to create a Journal before trying to retrieve them, otherwise the operation will result in an exception.
If you want to add to the journal a policy you have to fill in the Endorsement object **both** the policyCode and the quotationCode. In case of quotation you have to add **only** the quotationCode.
When you create a Journal with quotations, those quotations becomes automatically policies which can be retrieved from the output.
The most common errors while creating a Journal is the followings:
* Outreached the money or the day limits.
* The policy or the quotation is not in the list of the unpaid endorsements
* It appears the message "Υπάρχει παλαιότερη Απόδειξη πληρωμών για το επιλεγμένο Ασφαλιστήριο". This message means that there is a previous renewal of this policy that is unpaid. So You have to put this first in a Journal, or put both policies in the same Journal.
* You are not allowed to add in a Journal a policy with negative amount. In case of such policy, you have to add it to a Journal with another policy, so the total amount will be greater than 0€.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | Under which Dist Channel the journal will be created | 00510
notes | String | String | Optional | The notes that will be added to the Journal | "My test Journal"
endorsementIds | List[Endorsement] | Endorsement | The list of endorsements which will added to Journal | *(see below)*
####EndorsementId
Notice that from version **1.0-beta-18** the Endorsement object can represent both endorsements or quotations (in case of Motor policies).
When using the Endorsement in input methods and as real policy endorsement we will have to specify both *endorsementCode* and *policyCode*, whereas when using it as a Quotation we will only have to specify the "quotationCode".
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
endorsementCode | String | String | Required (for non Motor policies) | The code of the endorsement | 0438572362
policyCode | String | String | Required (for non Motor policies) | The code of the policy | 123456789
quotationCode | String | String | Required (for Motor policies) | The code of the quotation | 00194822
quotationPreviousPolicyCode | String | String | Optional | The old policy code of a renewal quotation | 11143542
###Output
Type | Description | Example
---- | ----------- | -------
Journal | The Journal data | *(see below)*
#### Journal
Field | Type | Description | Example
----- | ---- | ----------- | -------
code | String | The code of the Journal | 00232425
creationDate | Date | The date the Journal was created | 18/06/2014
daysToGetPaid Number | The days remaining to get paid | *(see below)*
premiumAmount | BigDecimal | The gross amount of the Journal | 237.5
netAmount | BigDecimal | The net amount of the Journ | 200.5
status | String *(possible values : OPEN, IN_PAYMENT)* | The status of the Journal | OPEN
distChannel | String | The Dist Channel code in the journal belongs | 00510
notes | String | The notes of the Journal | "New Policies Journal"
List[Endorsement] | Endorsement | A list with all the policies inside a journal | *(see above))*
###Example 1
Example for providing an empty Endorsement list
*Input*
```
00510
Web Service Test
```
*Output*
```
error
18
Η λίστα των Συναλλαγών πρέπει να κυμαίνεται μεταξύ 1-50.
true
```
###Example 2
Example for trying to persist an non unpaid endorsement
*Input*
```
00510
""
000000000
00915070
```
*Output*
```
error
5
/endorsementReceipts
Ο αριθμός προσφοράς 00915070 δεν βρίσκεται στην λίστα των απλήρωτων Print&Pay προσφορών.
false
```
###Example 3
Successful persistence for Quotations
*Input*
```
00510
""
000000000
00899967
000000000
00900060
```
*Output*
```
00771654
2015-10-01T00:00:00+03:00
97
00510
004662780
10865768
00899967
004662781
10866637
00900060
275.15
""
275.15
OPEN
```
##createPayment
Creates a payment consisting of one or multiple journal codes.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | Under which Dist Channel the payment will be created | 08000
journals | List[Journal] | Journal | The list of journals which will added to payment | *(see below)*
####Journal
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
journalCode | String | String | Required | The journal code| 00850560
###Output
Field | Description | Example
----- | ----------- | -------
amount| The payment amount | 132.15
creationDate| The creation date of payment |2015-10-13
diasPaymentCode |The dias payment code required for the bank payment |99911191006943475103
distChannelCode | The distribution channel code creates the payment| 08000
outstandingAmount | The outstanding amount |132.15
paymentCode |The payment code |10069434
status | The payment status | OPEN
###Example 1
*(Input)*
```
08000
00850560
00850561
```
*(Output)*
```
132.15
2015-10-13T00:00:00+03:00
99911191006943475103
08000
132.15
10069434
OPEN
```
##getPaymentStatus
Gets the status of the payment.
###Input
Field | Type | Value | Required/Optional | Description | Example
----- | ---- | ----- | ----------------- | ----------- | -------
distChannelCode | String | String | Required | The distChannel the payment belongs | 08000
paymentCode | String| String | Required | The code of the payment | *(see below)*
###Ouput
Field | Type | Value | Description | Example
----- | ---- | ----- | ----------- | -------
status | String | String | The payment status (OPEN, CLOSE) | *(see below)*
###Example 1
*(Input)*
```
08000
10073307
```
*(Output)*
```
OPEN
```
##Error Codes
Code | Description
------ | -----------
210 | The endorsement already exists inside in Journal
220 | The Dist Channel doesn't have outstand amount
230 | The Dist Channel doesn't have limits
300 | You have overcome the money limit
310 | You have overcome the day limit
350 | The endorsement is not the oldest of this policy
360 | The Journal have a minus journal amount