Click or drag to resize
Infosoft Logo

Ordering a new subscription

This document describes how to create a new customer and subscription and authorise the customer immediately.

Order Subscription and Authorise
Figure 1: Outline of the presented process

Order new subscription and authorise it for use immediately

  1. Prepare information for the customer and the subscription and call the OrderSubscription method.

  2. Use the customer number returned in the OrderSubscriptionResponse to request a new login session using the method VerifyCustomerNumberExtended

  3. Get the subscriptions for the desired period using GetSubscriptionElements and determine if one exists within the time frame your interested in (usually today). Consider looking for product, term and title code if you need to verify access to a specific product or title. Refer to the section on subscription authorisation for variations on how to verify access.

Now a customer and a subscription has been ordered, and the customer have been granted access to whatever resource he was interested in. The order now needs to be imported for it to be effective. Refer to the non-technical documentation for what this entails.

Example

A simple C# example portraying the outlined process.

string titleCode = "IS"; // Use your title code here

SubscriptionOrderServiceClient serviceClient = new SubscriptionOrderServiceClient();
OrderSubscriptionRequest orderRequest = new OrderSubscriptionRequest();

// Assign parameters to order request based on user input and configurations

OrderSubscriptionResponse orderResponse = serviceClient.OrderSubscription(orderRequest);

// A minimal registration of a new customer and subscription
orderRequest.CustomerParameters = new CustomerExchange()
{
    Lastname = "Doe",
};

orderRequest.AddressParameters = new AddressExchange()
{
    Streetname = "TestingStreet",
    CountryCode = "NO",
    ZipCode = "1234",
    HouseNumber = 1
};

orderRequest.SubscriptionParameters = new SubscriptionExchange()
{
    StartDate = DateTime.Today.AddDays(1),
    TitleCode = titleCode,
    TermCode = "01",
    ProductCode = "P1"
};

if (orderResponse != null)
{
    // Subscription order was registered proceed to authorisation
    // See the separate subject on authorising a subscription for information on how to do that.
}
Robust Programming

Remember to handle exceptions and error codes so the end user is not shown a cryptic error message, but at the least is told something went wrong and he/she should consider contacting customer services.

See Also