LogoLogo
  • Welcome to Subscribe
    • Introduction to Subscribe
    • Subscribe Release Notes
      • 2025.1
      • 3.17.0 Major Release
        • 3.17.0.x Hotfixes
        • 3.17.1 Minor Release
          • 3.17.1.x Hotfixes
        • 3.17.2 Minor Release
      • 3.16.0
        • 3.16.0.X Hotfixes
        • 3.16.1 Minor Release
          • 3.16.1.X Hotfixes
        • 3.16.2 Minor Release
          • 3.16.2.X Hotfixes
        • 3.16.3 Minor Release
          • 3.16.3.x Hotfixes
      • 3.15.0 and 3.15+
      • 3.14 and 3.14+
      • 3.13.0 and 3.13+
      • 3.12
      • 3.11
      • 3.10
      • 2.X Releases
    • Coming Soon: What's On Your Way
    • NCS Circ Service Packs
      • 2018.5 Service Pack 1
      • 2018.5 Service Pack 2
      • 2018.5 Service Pack 3
      • 2018.5 Service Pack 4
      • 2020.2.0 Version
      • 2020.2.1 Version
      • 2020.2.2 Version
      • 2020.3.0 Version
      • 2020.4.0 Version
        • 2020.4.0 Version - Resolved Issues
        • 2020.4.0 - Enhancements
  • Naviga Applications and User Guides
    • Landing Application User Guide
      • Create a New User
      • Editing User Details
      • Exporting the Users
      • Password Settings
    • Solicitor Concierge User Guide
      • Solicitor Quickstart
      • Find your way around the Solicitor UI
      • Tutorials
        • Audit Trail
        • Configure available areas
        • Configure a sales product
        • Configure marketing text
        • Configure terms and conditions
        • Configure premiums
        • Configure an offer group
        • Configure an activation fee
        • Configure users, sales teams, and team members
          • Best practices for user accounts
          • Roles and permissions matrix
        • Import or Export Solicitor Data
        • Reference tables
    • CSR User Guide
      • Account information
      • Subscription Search
      • New Subscription Registration
      • Sending Invites
      • Create a new subscription
      • Digital Product Management
      • Disclaimer Management
      • Registration Management
      • NCS Only
        • Delivery Issues and Delivery Management
        • Billing and payment management
        • Address management
        • Update Solicitation Preference
        • Upgrades and downgrades management
        • Temporarily stop a subscription
        • Permanently stop a subscription
        • Create a vacation transfer
        • Redirect to classic portal
        • Restart a Subscription
      • Matrix Only
        • Billing and payment management
      • Show events and access events
    • Subscription Panel User Guide
      • Overview
      • Tutorials, how-tos, and reference documentation
        • Component Matrix
        • Create, edit, or remove component properties
          • Common properties quickstart
        • Create, edit, or delete a Presentation Template
        • Create, edit, delete, import or export Presentations
        • Preview a Presentation
        • Tutorials and Step-by-step guides
        • Reference documentation
          • Analytics
          • Presentation URLs
    • CMS User Guide
      • Overview
      • Tutorials, how-tos
        • How to Create a New Page
        • How to Manage Attributes
        • How to Manage Benefits
        • How to Manage Rewards
        • How to Manage Content and Pages
        • How to Manage the FAQ Section
        • How to Manage Images
        • How to Manage Slideshows
        • How to Manage Navigation: Links, Menu, Footer
        • How to Manage Notifications
        • How to Manage Newspapers (Divisions) And Newspaper Groups
  • Subscribe Features
    • New Starts and Restarts
      • Active Subscription Check
      • New starts
        • Complimentary (free-of-charge) subscriptions
        • 'Day Pass' Subscriptions (NCS Circ)
        • Gift Subscriptions (NCS Circ)
        • Lite Subscriptions
        • Trial-with-Payment subscriptions (NCS Circ)
        • Country-Only-Start Subscriptions (NCS Circ)
        • Auth0 Email Verification
      • Occupant creation/update during a new start (NCS Circ)
      • PurchaseAPI and failed starts reprocessing
      • Restarts (NCS Circ)
      • Restarts (Matrix)
    • Payment features (NCS Circ)
      • Tip: One-time and Recurring (NCS Circ)
      • Activation fees (NCS Circ)
      • One-time payment and Auto-renew (NCS circ)
      • Apple Pay: NCS Circ, Payway & Braintree
      • Google Pay: NCS Circ, Payway / Braintree
      • Variable Pricing (NCS Circ)
    • Upgrades and Downgrades
    • Stop Saver (NCS Circ)
    • Multicurrency (Vindicia only)
      • Multicurrency set up user guide
    • Occupant data update
  • ADDITIONAL RESOURCES
    • Subscribe APIs
      • Newsletter Widget API
      • InApp API (External Payments)
      • Newstart InApp (Webhooks)
      • Subscription API
      • Entitlements API Reference
      • Firefly
    • Workflows
      • Make a Payment Workflow
      • Auto-renew Workflows
      • NCS Only
        • eBill Workflows
        • Vacation Transfer Workflow
        • Permanent Stop Workflow
        • Temporary Stop Workflow
        • Solicitation Preference Workflow
        • Delivery Issues Workflow
        • Address Management Workflow
        • Restarts
        • Subscription Purchase Workflows
      • Matrix Only
        • New Start (Matrix)
      • CircPro Only
        • New start Workflow
        • Complaints Workflow
        • Update Payment Information Workflow
        • Switch to Invoice Workflow
        • One Time Payment Workflow
        • Temporary Stop Workflow
      • New Start Flow
      • Move Flow
    • Videos & Webinars
Powered by GitBook
On this page
  • Introduction
  • Before You Start
  • Client Implementation Steps
  • 1. Client-side Market Configuration
  • 2. Newstart InApp Subscription Endpoint
  • Newstart InApp Subscription Endpoint
  • 3. Naviga Implementation Steps
  • 3.1 Migration of data from External Payments DB to Subsvc DB
  • 3.2. MG2 Control DB
  • 3.3. Event Types Configuration
  • 3.4. Bearer Authentication
  • 3.5. Set up Hangfire with OnPremise API
  • 3.6. OnPremise API Website Configuration

Was this helpful?

Export as PDF
  1. ADDITIONAL RESOURCES
  2. Subscribe APIs

Newstart InApp (Webhooks)

DISCLAIMER

Product Information contained within this document, including technical information and functional specifications, is subject to change without notice. Naviga reserves the right to make any changes to the information in this document at any time without notice. Naviga makes no warranty, representation, or guarantee regarding the suitability of its products and services for any particular purpose.

Introduction

New subscriptions that have been created through InApp marketplaces rather than through the Naviga Subscribe platform are referred to as "Newstart InApp" subscriptions. This page provides an overview of the steps that must be followed in order to successfully migrate a client from the previous External Payments system to the new Webhooks system.

This will allow the client to begin processing the new InApp Newstart that will be created from an external app using PurchaseAPI, as well as the Webhooks notification that will be created from the external markets using Webhooks API.

Before You Start

A minimum Subscribe version of 3.16.3.6 and above is required to use the new InApp endpoints.

Client Implementation Steps

1. Client-side Market Configuration

  • In order to make sure that the notifications have been correctly received, it will be necessary to set up the authentication credentials, such as API keys, access tokens, etc., that have been associated with the in-app market.

    Market
    Details

    Google

    Credentials should be in JavaScript Object Notation (JSON) format.

    Apple V1

    Credentials should be in String format of 32 characters.

    Apple V2

    Credentials should be in JSON Web Token (JWT) format.

  • The URL of the Webhook has to be updated in the specific marketplace console (Google, Apple V1, Apple V2) in order to receive the notification status information in the new Webhooks flow.

    Market
    Details

    Google

    POST “Webhooks/Google/{MediaGroup}/{ClientCode}/{PaperCode}”

    Apple V1

    POST “Webhooks/Apple/V1/{MediaGroup}/{ClientCode}/{PaperCode}”

    Apple V2

    POST “Webhooks/Apple/V2/{MediaGroup}/{ClientCode}/{PaperCode}”


2. Newstart InApp Subscription Endpoint

For Newstarts InApp subscriptions, the new URL endpoints must be used along with the new bearer authentication.

Newstart InApp Subscription Endpoint

POST {SubscribeApiUrl}/Purchases/InApp

This endpoint is used to create a Newstart InApp subscription.

Note: The parameters marked with an asterisk (*) are mandatory and must be included in the input model.

Headers

Name
Type
Description

Authorization*

String

JSON Web Token used for security purposes

X-SourceSystem*

String

To identify the consumer or the Source System

X-ClientCode*

String

Client Code of the Tenant

X-PaperCode*

String

Paper Code of the Tenant

X-MediaGroupCode*

String

Media Group Code of the Tenant

Request Body

Name
Type
Description

CustomerRegistrationId*

String

Unique identifier of a customer in Naviga System

OfferId*

Integer

Unique identifier of the offer in Naviga System

OfferGroupId*

Integer

Unique identifier of the offer group in Naviga System

OfferCode

String

Unique code of the offer in Naviga System

AppleInfo.Receipt*

String

Receipt information for the Apple InApp market.

It is required only if it is an Apple InApp Newstart.

GoogleInfo.Receipt*

String

Receipt information for the Google InApp market.

It is required only if it is an Google InApp Newstart.

Subscriber.Email

String

Email of the subscriber

Subscriber.Country

String

Country of the subscriber

Subscriber.CompanyType

String

Company type of the subscriber

Subscriber.CompanyName

String

Company name of the subscriber

Subscriber.Title

String

Title of the subscriber

Subscriber.LastName

String

Last name of the subscriber

Subscriber.FirstName

String

First name of the subscriber

PaymentTypeId*

Integer

Unique identifier of the payment type in Naviga System

StartDate*

dateTime

Start date of the subscription

EmailAddress*

String

Email address of the subscriber

Subscriber.Phone

String

Phone of the subscriber

Product.MerchantProductId

String

Unique identifier of the merchant product

Product.ProductQuantity

Integer

Quantity of the product required

Product.ExternalProductId

String

Unique identifier of the external product

Products

Array

RegistrationId

Integer

Unique identifier of a registration in Naviga System

Product.ProductId

Integer

Unique identifier of the product

{
  "Code": 200,
  "Errors": [],
  "Result": {
    "EventId": 0,
    "AccountNumber": "string",
    "PaymentAuthorizationCode": "string",
    "TwoSteps": false
  },
  "SessionId": "string",
  "RequestId": "string"
}
{
    "error": "Authorization is missing."
}
{
    "error": "X-SourceSystem is missing."
}
{
    "error": "Invalid Source System."
}
{
    "error": "Something went wrong. Please try again later."
}
{
   "Code":400,
   "Errors":[
      {
         "Message":"Invalid Input.",
         "Code":"Subscriptions01",
         "Type":{
            "Id":0,
            "Code":"Validation"
         },
         "ErrorSource":null
      }
   ],
   "Result":null,
   "SessionId":"string",
   "RequestId":"string"
}
{
  "Code": 400,
  "Errors": [
    {
      "Message": "Failed To Add External Subscription",
      "Code": "Subscriptions422",
      "Type": {
        "Id": 0,
        "Code": "Validation"
      },
      "ErrorSource": null
    }
  ],
  "Result": null,
  "SessionId": null,
  "RequestId": null
}
{
  "Code": 400,
  "Errors": [
    {
      "Message": "Existing External Subscription",
      "Code": "Subscriptions421",
      "Type": {
        "Id": 0,
        "Code": "Validation"
      },
      "ErrorSource": null
    }
  ],
  "Result": null,
  "SessionId": null,
  "RequestId": null
}
{
  "Code": 400,
  "Errors": [
    {
      "Message": "Invalid Receipt Info",
      "Code": "Subscriptions420",
      "Type": {
        "Id": 0,
        "Code": "Validation"
      },
      "ErrorSource": null
    }
  ],
  "Result": null,
  "SessionId": null,
  "RequestId": null
}
{
  "Code": 400,
  "Errors": [
    {
      "Message": "Failed To Verify Receipt Info",
      "Code": "Subscriptions417",
      "Type": {
        "Id": 0,
        "Code": "Validation"
      },
      "ErrorSource": null
    }
  ],
  "Result": null,
  "SessionId": null,
  "RequestId": null
}
{
  "Code": 400,
  "Errors": [
    {
      "Message": "Invalid Apple Token Secret. Token secret cannot be null or empty",
      "Code": "Subscriptions435",
      "Type": {
        "Id": 0,
        "Code": "Validation"
      },
      "ErrorSource": null
    }
  ],
  "Result": null,
  "SessionId": null,
  "RequestId": null
}
{
  "Code": 400,
  "Errors": [
    {
      "Message": "The offer does not exist or it is not available.",
      "Code": "Subscriptions29",
      "Type": {
        "Id": 0,
        "Code": "Validation"
      },
      "ErrorSource": null
    }
  ],
  "Result": null,
  "SessionId": null,
  "RequestId": null
}
{
   "Code":400,
   "Errors":[
      {
         "Message":"The start date cannot be null",
         "Code":"Subscriptions451",
         "Type":{
            "Id":0,
            "Code":"Validation"
         },
         "ErrorSource":null
      }
   ],
   "Result":null,
   "SessionId":"string",
   "RequestId":"string"
}
{
    "error": "Invalid authorization."
}

3. Naviga Implementation Steps

3.1 Migration of data from External Payments DB to Subsvc DB

Naviga Implementation team should migrate the data for existing InApp subscriptions from the old External Payments database to the new tables in the Subsvc database.

3.2. MG2 Control DB

3.2.1. Market-based API Settings

Market
Setting name
Details

Google

Google.VerifyReceiptCredential

The client provides the credentials in JSON format. The value differs depending on the newspaper client.

Apple V1

Apple.VerifyUrl

The universal URL endpoint for verification of receipts. The value remains the same for all clients.

Apple V1

Apple.VerifySecret

The client provides the credentials in String format of 32 characters. The value differs depending on the newspaper client.

Apple V2

Apple.AppleTokenSecretWebhooksApi

The client provides the credentials in JWT format. The value differs depending on the newspaper client.

3.2.2. API Settings

Setting
Details

Flow.Purchase.InApp.Redirect

The value should be set for a specific client. The default value has been set to 1 (true).

  • If the value has been set to 0 (false), the Purchase API will process the Newstart subscription.

  • If the value has been set to 1 (true), the request will be redirected to the Subscriptions API to process the Newstart subscription.

InAppNotification.NotificationRetryLimitWebhooksApi

Whenever the system finds that the processed status of an InApp notification does not indicate "OK," it will attempt to process the notification again.

This setting determines the maximum number of times that the notification can be reprocessed.

3.3. Event Types Configuration

Set the following information in the [EventTypes] and [NewspaperEventProcessorAssignments] tables based on the specific market to be configured:

  • Set the configuration for the event type, GOOGLEVERIFYRECEIPT (1195), to have active = 1 (true) and triggers_post = 1 (true).

    • It should also be associated with NewspaperEventProcessorAssignments, with the 'EventProcessorId' value set to 41 (Google).

  • Set the configuration for the event type, APPLEVERIFYRECEIPT (1194), to have active = 1 (true) and triggers_post = 1 (true).

    • It should also be associated with NewspaperEventProcessorAssignments, with the 'EventProcessorId' value set to 43 (Apple).

3.4. Bearer Authentication

A new bearer authentication should be generated for the client. The bearer token should have PurchaseAPI resource added with the 'write' access.

3.5. Set up Hangfire with OnPremise API

Hangfire is integrated into the OnPremise API, which manages background jobs and scheduled tasks.

Prerequisites

  1. The below-listed MG2 Control API settings should be in place.

    Setting
    Details

    OnPremiseStorageConnectionString

    This setting is used to define the "DB Connection string" in order to designate a specific database as a repository for managing queue(s). Example value: Data Source=IP;Initial Catalog=MG2_Control;User Id=xxxxx;Password=xxxxx;

    SubConConnectionString

    This is a global setting that specifies the connection string for connecting to the Subsvc DB. Example value:

    Data Source=IP;Initial Catalog=subsvc_SomeClient_test;Persist Security Info=True;User ID=xxxxx;pwd=xxxxx;

    MG2API

    This setting is used as the base URL for calling the Subscribe APIs. Example value: http://aws-test.subscriberconcierge.com/

  2. Before configuring Hangfire, the following stored procedures must exist:

    • dbo.OnPremise_InAppRetryNotification_GetData

    • dbo.OnPremise_StopExternalSubscriptions_GetData

Hangfire Setup:

3.5.1. Retry Notification endpoint

Hangfire will generate a task cycle that will run every time as specified in the input model's instructions.

POST: https://aws-test.subscriberconcierge.com/Notifications/InApp/Retry/Configure

Sample Input Model:

{
  "RunEveryDayAtHour": 19, -> Hour Time UTC
  "RunEveryDayAtMinute": 30, ->  Minute Time UTC
  "TaskKey": "testKey1234" -> Unique Key
}

The task will retry failed market notifications by calling the Webhooks API Retry endpoint (POST: https://aws-test.subscriberconcierge.com/Notifications/{id}/Retry) with the same request Headers used in the request.

3.5.2. External Subscription endpoint

Hangfire will generate a task cycle that will run every time as specified in the input model's instructions.

POST: https://aws-test.subscriberconcierge.com/Notifications/InApp/Retry/Configure

Sample Input Model:

{
  "RunEveryDayAtHour": 19, -> Hour Time UTC
  "RunEveryDayAtMinute": 30, ->  Minute Time UTC
  "TaskKey": "testKey1234" -> Unique Key
}

This task searches the Subscribe database for external subscriptions with an active status (L) and a stop date prior to the current date (< today). It then calls the SubscriptionsAPI endpoint (POST: https://aws-test.subscriberconcierge.com/ExternalSubscription/{0}/Stop) with the same request Headers used in the request to stop each external subscription.

External markets such as GooglePlay or Apple may notify of an expiry date in the future; in this case, wait for this Hangfire task to be processed, which will stop the subscription at the appropriate time.

3.5.3. Remove Created Task

To remove a Notification or External Subscription task that has been created, call the Webhooks API endpoint mentioned below.

DELETE: https://aws-test.subscriberconcierge.com/Notifications/InApp/Retry/Remove/{taskKey}

Sample Input Model:

taskKey input parameter is nullable. If taskKey is null then taskKey = MediaGroupCode_ClientCode_PaperCode

3.6. OnPremise API Website Configuration

Hangfire is an open-source framework that helps to create and process background jobs, and the Hangfire server operates within the OnPremise API because this is an ASP.NET Framework web site hosted on IIS.

The Hangfire server is subject to the same events as a website (such as Application_Start, Application_End, etc.), causing it to simply shut down if the website becomes inactive.

PreviousInApp API (External Payments)NextSubscription API

Last updated 12 months ago

Was this helpful?

For detailed implementation steps of the Newstart InApp migration from the old ExternalPayments system to the new Webhooks system, please refer to the internal documentation.

For OnPremise API website configuration, please refer to the documentation.

Confluence
Confluence