# Priceless Specials Webview ## Overview This documentation describe integration into Priceless Specials platform using few services provided by Verestro. We should highlight few main products: - Full SDK (called in document WEB SDK) - web based service, that allows to integrate Priceless Specials product into partners application. It can be embedded in the mobile application or provide service after redirect to it from partners web panel. - Goal widget - web based micro app, that can display selected reward and progress % for particular card info. - Company API - API that allows partner to interact with Priceless Specials product specific data e.g., *customer point adjustment.* The more information about API specifications is [here.](https://developer.verestro.com/books/priceless-specials/page/technical-documentation) ## API Domain All methods are available on below URL except initialization method. **Endpoint URLs:** Stage: [https://rpm-management.upaidtest.pl/](https://rpm-management.upaidtest.pl/), Prod: [https://rpm.secure-verestro.com/](https://rpm.secure-verestro.com/). ## Security and authentication For backend-backend communication, it is required to attach appropriate certificates to the requests sent. This applies to: - Registration process - /company/enroll, company/add\_card, - Endpoints described in Chapter 6. Method issuer/initialize\_sdk does not require certificate. ### Certificate generation process. First, the Partner needs generate a CSR (Certificate Signing Request). The command to generate the CSR: **openssl req -new -newkey rsa:4096 -keyout client.key -out client.csr -nodes -subj '/CN=bankname cert/emailAddress=rpm@bankname.pl'** Once the CSR is generated, it should be passed to Verestro. Verestro will sign the CSR and provide x509 certificates based on it: - certificate CERT.CRT – used for backend-backend communication, - certificate CA.CRT – (recommended) used for backend-backend communication, - certificate to sign the trustedIdentityToken (one of the payload parameters of initializeSdkToken). JWS tokens must have additional header:
**Name** | **Description** |
x5c | Parameter contains the X.509 certificates chain ([RFC7515#section-4.1.6](https://tools.ietf.org/html/rfc7515#section-4.1.6)) |
**Plaintext (HEX)** | **Hash** |
5555444433332222 | 4f64c445c859f7e53209e0091a5faef7e8b3ebbad899fbf8c74df09a6bfe5646 |
6984576897634895763948576 | 4b2eab65ab16183fa6ac8a8b12ad690890db98c5ce20e6d56aa037b723bbe84 |
someTestValue398048096859607 | 29596a78a7382e90159d8ec78a8d37baff57d05f676c0607dd7fb24b0396270ce |
**Name** | **Value** |
Accept | application/json |
Content-Type | application/json |
**Status, Body** | **Description** |
HTTP\_200, SUCCES { "termsAndCondition": true, "disclosureOfPersonalData": true, "processingPersonalData": true, "marketingInfoEmail": true, "marketingInfoPhone": true, "errorMessage": null } | Success. |
HTTP\_200, SUCCESS { "termsAndCondition": null, "disclosureOfPersonalData": null, "processingPersonalData": null, "marketingInfoEmail": null, "marketingInfoPhone": null, "errorMessage": "CARD\_IS\_INACTIVE" } | Card is inactive in MRS System. |
HTTP\_200, SUCCES { "termsAndCondition": true, "disclosureOfPersonalData": true, "processingPersonalData": true, "marketingInfoEmail": true, "marketingInfoPhone": true, "errorMessage": "USER\_EMAIL\_NOT\_VERIFIED" } | User didn’t confirm email address. |
HTTP\_404 | The card does not exist in system. |
**Field** | **Required** | **Type** | **Additional information** | |
requestId | No | String | External User Identifier provided by client. It can be used as an identifier in system (in standard UUID4). | |
firstName | Yes | String | ||
lastName | Yes | String | ||
phoneNumber | No | String | Should be passed with prefix. | |
No | String | |||
zipCode | No, recommended | String, optional | format: NN-NNN. | |
birthDate | No, recommended | String, optional | format: YYYY-MM-DD. | |
cards | Yes | Array | Array of Card Objects. | |
encryptedNumberCard | Yes | String | Encrypted PAN JWE. | |
programId | No | String | ||
programIdentifier | No | String | ||
termsAndCondition | Yes | Boolean | true or false. | |
disclosureOfPersonalData | Yes | Boolean | true or false. | |
processingPersonalData | Yes | Boolean | true or false. | |
marketingInfoEmail | Yes | Boolean | true or false. | |
marketingInfoPhone | Yes | Boolean | true or false. |
**Status, Body** | **Description** |
HTTP\_201, SUCCESS | Success (email/userId passed in a request). |
HTTP\_201, SUCCESS { ”requestId”: "123e4567-e89b-12d3-a456-426614174000" } | Success (email/userId passed in a request). requestid returned to add new cards if user does not verify email address. |
HTTP\_201, SUCCESS { "requestId": "123e4567-e89b-12d3-a456-426614174000", "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed card/cards failed during adding to MRS system. |
HTTP\_400: CARD\_ALREADY\_EXIST { "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed value is not unique in system. |
HTTP\_400: INVALID\_VALUE\_CARD | Passed Card value is invalid. |
HTTP\_400: INVALID\_VALUE\_EMAIL | Passed email is invalid. |
HTTP\_400: INVALID\_VALUE\_BIRTH\_DATE | Passed Birth date is invalid. |
HTTP\_400: CARDS\_LIMIT\_EXCEEDED | Too many passed Cards. Limit 10 cards. |
HTTP\_403: ACCESS\_DENIED | Method is not available. |
HTTP\_401: INVALID\_CERTIFICATE | Passed certificate is invalid. |
**Status, Body** | **Description** |
HTTP\_201, SUCCESS { “clientId”: “PXPYVJ2HZTW0CK0G4840K4WGGOWOKO” } | Success (email/userId passed in a request). |
HTTP\_201, SUCCESS { “clientId”:“PXPYVJ2HZTW0CK0G4840K4WGGOWOKO”, ”requestId”: "123e4567-e89b-12d3-a456-426614174000" } | Success (email/userId passed in a request). requestid returned to add new cards if user does not verify email address. |
HTTP\_201, SUCCESS { "clientId":"PXPYVJ2HZTW0CK0G4840K4WGGOWOKO ", "requestId": "123e4567-e89b-12d3-a456-426614174000", "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed card/cards failed during adding to MRS system. |
HTTP\_400: CARD\_ALREADY\_EXIST { "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed value is not unique in system. |
HTTP\_400: INVALID\_VALUE\_CARD | Passed Card value is invalid. |
HTTP\_400: INVALID\_VALUE\_EMAIL | Passed email is invalid. |
HTTP\_400: INVALID\_VALUE\_BIRTH\_DATE | Passed Birth date is invalid. |
HTTP\_400: CARDS\_LIMIT\_EXCEEDED | Too many passed Cards. Limit 10 cards. |
HTTP\_403: ACCESS\_DENIED | Method is not available. |
HTTP\_401: INVALID\_CERTIFICATE | Passed certificate is invalid. |
**Field** | **Required** | **Type** | **Additional information** | |
No | String | Email or userId is mandatory. | ||
userId | No | String | Email or userId is mandatory. | |
cards | Yes | Array | Array of Card Objects. | |
encryptedNumberCard | Yes | Sting | Encrypted PAN JWE. | |
programId | No | String | ||
programIdentifier | No | String | ||
termsAndCondition | Yes | Boolean | true or false. | |
disclosureOfPersonalData | Yes | Boolean | true or false. | |
processingPersonalData | Yes | Boolean | true or false. | |
marketingInfoEmail | Yes | Boolean | true or false. | |
marketingInfoPhone | Yes | Boolean | true or false. |
**Status, Body** | **Description** |
HTTP\_201, SUCCES | Success. |
HTTP\_201, SUCCESS { "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed card/cards failed during adding to MRS system. |
HTTP\_400: CARD\_ALREADY\_EXIST { "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed value is not unique in system. Request is rejected, no cards have been added to the system. |
HTTP\_400: INVALID\_VALUE\_CARD | Passed Card value is invalid. |
HTTP\_400: INVALID\_VALUE\_EMAIL | Passed email is invalid. |
HTTP\_400: INVALID\_VALUE\_USERID | Passed userId is invalid |
HTTP\_400: CARDS\_LIMIT\_EXCEEDED | Too many passed Cards. Limit 10 cards. |
HTTP\_403: ACCESS\_DENIED | Method is not available. |
HTTP\_401: INVALID\_CERTIFICATE | Passed certificate is invalid. |
**Status, Body** | **Description** |
HTTP\_200, SUCCES { “clientId” : “asdh-adss-sada-sadss” } | Success. |
HTTP\_200, SUCCESS { "clientId": "asdh-adss-sada-sadss", "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed card/cards failed during adding to MRS system. |
HTTP\_400: CARD\_ALREADY\_EXIST { "failedPanHashes": \[ { "panHash": "a7a89543br958437543bf984375bc3498nvuiey74783" } \] } | Passed value is not unique in system. Request is rejected, no cards have been added to the system. |
HTTP\_400: INVALID\_VALUE\_CARD | Passed Card value is invalid. |
HTTP\_400: INVALID\_VALUE\_EMAIL | Passed email is invalid. |
HTTP\_400: INVALID\_VALUE\_USERID | Passed userId is invalid |
HTTP\_400: CARDS\_LIMIT\_EXCEEDED | Too many passed Cards. Limit 10 cards. |
HTTP\_403: ACCESS\_DENIED | Method is not available. |
HTTP\_401: INVALID\_CERTIFICATE | Passed certificate is invalid. |
**Status, Body** | **Description** |
HTTP\_200, SUCCESS { ”publicKey” : "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUFwTS9IamdEZHlXUXVVRWhRNkV2MgpHVGx5SnlrcHBUdU1jODFxTSt1Mm03ZDFVdnpHNXdUT1k3OVZVWGdDdFBJMkNXZ05BcXo0aGk4Ymp4WjhOSi9UCjRoMzhya2xoSWh2anJqQ0w0NUlESUVqOTlmREt1R1IySzBkQlY4eDhjT2drL09jaUhqblFTVytoL05RTFRpTHIKTHkzbzV0dDhOaVNvWVJuTjlmZEo3cytaRjdFdU1kMkhuMm1iSkVOS2MwYXRXekZtZkFQbnM4SmRVWWdNWWQxSgpsbll0cXdXVWdGYUxnVUplaDhyZGRrd3lqeHdUZVZ5M0lFQ1hYMHNMcWIwTTZ2NURFWGk5Y1ZVV09PT0FUSG1pCng0a2dreUNESG9uN3FZNjFaZEhQdVlSOFRDbXoxaW9sOGpLNkJZTUdlZjFsb01Qem9XVTVPeHFRTjVCMUJrdVMKOWJJUFZTZFlUYTdRanB5aGRHbGhSeWRrNFNVYmFTR2d2cXc1N01VRXJkZ2NKOW4rV2hPNUorc0VOclpOSFZhdQo1czlCaytiRlZuQXltZEtldEdQZzVtZC94Ulo0NzVwQ1FPVXR5UUErNnduSitONTlWZlJnTlNvaDhKK2lnYkhRCmJ2YTNqcjFqKzA1dkw1V1JhNnR1SzRoeTBQQ29JRUtYZGNUTk1uZjdDa3dVUlFsaTlVdEJqOVo5bHozL0VBTy8KWll5cnlxOWJqN0J0cTRMU0llNFR2K2c2NDg4bXVXMENnSGlQRDJGV3NsWUdMcGQ2V3JvQlR0ZCtCajhhUk5jMQo5YXFmcE1DTmZBdUJIMm5Lc1ZITkxJRnlrbEY3TktVVGRxcm8vcnBKUEFidFJJb0YvK3JtcUtHUVh2L0duSWQyCjN3SzNhMDUrNnZZeXhmcXNldUtUWGNNQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=" } | Success. Base 64 encrypted. |
**Name** | **Value** |
Accept | application/json |
Content-Type | application/json |
**Name** | **Required** | **Type** | **Description** |
initializeSDKToken | yes | string | JWT token signed by private key delivered by Partner. |
redirect | no | bool | The default is redirect true. When you set it as false, you will receive a response 201. |
**Name** | **Required** | **Type** | **Description** |
trustedIdentityToken | yes | string | Trusted identity token. |
panHash | yes | string | PAN hash – described in 3.2. |
deviceId | yes | string | Unique ID of device. Base64 encoded. It is a string of numbers and letters that identifies every individual device. It is generated on the device and can be retrieved by any app session with the same way. It should be generated with various parameters like, serial number, os version, screen information, device build, device number, battery information, so it can provide uniquity from each device. |
os | yes | string | One of: "android", "ios", "linux", "macos", "windows". |
publicKey | no | string | This is public key from device biometrics authentication module. Base64 encoded. |
returnUrl | yes – for WEB integration | string | Url which will allow to return form RPM to External Issuer System. Recommended in web integration. |
errorUrl | no | string | Url which will allow to redirect, in case of any errors. Recommended in web integration. *Planned for the future.* |
logOutUrl | no | string | Url which will be triggered when log out will appear. Recommended in web integration. **If this parameter is not present, user will set default login page of program!** *Planned for the future.* |
keepSessionUrl | yes – for WEB integration | string | Value signed by EIS, it allows RPM to periodically extend user session in EIS. EIS should be able to validate if it is properly sign with their key. |
widgetType | yes | string | One of: "full", "goal". Default: "goal". This value tells which frontend should be loaded. "full" - Full SDK will be loaded, that allows you to use all functionalities. "goal" - Selected goal widget will be loaded. |
companyId | yes | string | For example: “citi”. |
exp | yes | String | Expiration time (seconds since unix epoch). |
additionalItems | no | array | Additional items for the particular cardholder. |
**Name** | **Required** | **Type** | **Description** |
id | yes | string | The ID of selected item type. (From GET /company/available\_item\_types). |
count | optional | int | The count, default: 1. |
*Android.showMessage(message);* |
*window.webkit.messageHandlers.payment.postMessage({ status: message });* |
Solution is prepared to open in webview and should be implemented in a way, where no iframe is used at all! Please make sure support for local storage and cookies is enabled. |
Only for WEB flow! |