Table Of Contents

Application Packaging Standard

Last updated 18-Mar-2019

Create Customer

Scenario

A management system needs to add a client company to the platform in order to subscribe it later to some cloud services.

../../../_images/sys-user-step-customer-b.png ../../../_images/sys-user-step-staff.png ../../../_images/sys-user-step-user.png ../../../_images/sys-user-step-subscription.png ../../../_images/sys-user-step-service.png

Source Data

To create a customer, you need to consider the following.

  • Security aspect - to create a customer, you need the provider’s permission. That is why, use the provider admin’s token in the request.
  • APS type - you should usually specify one from the Absctract Types or OSS Types. Since we are going to use the account management service provided by the platform, select the platform specific PAAccount type.
  • Set of properties - the following table illustrates a list of required properties.
Property Type Sample value Notes
aps.type URI http://parallels.com/aps/types/pa/account/1.2 Exact match with the ID specified in the PAAccount APS type.
type String enum “CLIENT” This creates a customer account.
personal Boolean false Creating a company, not a person.
companyName String “ISV One” Assign a name to the customer company.
addressPostal Structure {“streetAddress”:”11, ISVone”, “locality”:”Herndon”, “region”:”VA”, “countryName”:”us”, “postalCode”:”12345”} Enter full postal address as specified by the http://aps-standard.org/types/core/contact/1.1#Address structure in the Account type.
adminContact Structure {“email”:”isv1@aps.test”, “givenName”:”Mike”, “familyName”:”Wilson”, “telVoice”:”1(888)1234567”} Enter the administrative contacts.
billingContact Structure {“email”:”isv1@aps.test”, “givenName”:”Mike”, “familyName”:”Wilson”, “telVoice”:”1(888)1234567”} Enter the billing contacts.
techContact Structure {“email”:”isv1@aps.test”, “givenName”:”Mike”, “familyName”:”Wilson”, “telVoice”:”1(888)1234567”} Enter the technical contacts.

Note

Some properties, for example, companyName and addressPostal, are inherited from the standard account APS type.

Preliminary Inspection

Before you start creating a new account, verify if there is an account with similar properties. The following examples provide typical use cases that narrow a list of requested objects by adding an RQL filter to a request.

  • Get a list of all customers:

    GET /aps/2/resources?implementing(http://parallels.com/aps/types/pa/account/1.2),eq(type,CLIENT)
    
  • Get a list of accounts whose company name or contact mail address match the respective properties of the new customer.

    GET /aps/2/resources?implementing(http://parallels.com/aps/types/pa/account/1.2),or(eq(companyName,ISV%20one),eq(adminContact.email,isv1@aps.test))
    

If there is a match with some properties of the new customer you are going to create, you can preliminary modify the properties that you want to be unique.

Creating Object

The following procedure is valid for the case when the platform does not contain the BSS (business support system).

To create a customer with required properties, use a POST request with the source data similar to the following:

POST /aps/2/resources/

{ "aps":{
      "type":"http://parallels.com/aps/types/pa/account/1.2"
   },
   "type":"CLIENT",
   "personal":false,
   "companyName":"ISV one",
   "addressPostal":{
      "countryName":"us",
      "locality":"Herndon",
      "postalCode":"12345",
      "region":"VA",
      "streetAddress":"11, ISVone ave."
   },
   "adminContact":{
      "email":"isv1@aps.test",
      "givenName":"Mike",
      "familyName":"Wilson",
      "telVoice":"1(888)1234567"
   },
   "billingContact":{
      "email":"isv1@aps.test",
      "givenName":"Mike",
      "familyName":"Wilson",
      "telVoice":"1(888)1234567"
   },
   "techContact":{
      "email":"isv1@aps.test",
      "givenName":"Mike",
      "familyName":"Wilson",
      "telVoice":"1(888)1234567"
   }
}

In case of success, the response looks as follows:

HTTP/1.1 200 OK

{
   "aps": {
      "type": "http://parallels.com/aps/types/pa/account/1.2",
      "id": "e489cb96-e988-475a-854b-0d0a67a18aed",
      "status": "aps:ready",
      "revision": 4,
      "modified": "2016-09-29T10:15:26Z",
      "package": {
         "id": "e86ef200-5751-4c2c-b342-e65483ede6d0",
         "href": "/aps/2/packages/e86ef200-5751-4c2c-b342-e65483ede6d0"
      },
   },
   "addressPostal": {
      "countryName": "us",
      "locality": "Herndon",
      "postalCode": "12345",
      "region": "VA",
      "streetAddress": "11, ISVone ave."
   },
   "adminContact": {
      "email": "isv1@aps.test",
      "familyName": "Wilson",
      "givenName": "Mike",
      "locale": "en_US",
      "middleName": "",
      "organizationName": "",
      "telVoice": "+18881234567"
   },
   "billingContact": {
      "email": "isv1@aps.test",
      "familyName": "Wilson",
      "givenName": "Mike",
      "locale": "en_US",
      "middleName": "",
      "organizationName": "",
      "telVoice": "+18881234567"
   },
   "companyName": "ISV one",
   "id": 10,
   "locked": false,
   "personal": false,
   "techContact": {
      "email": "isv1@aps.test",
      "familyName": "Wilson",
      "givenName": "Mike",
      "locale": "en_US",
      "middleName": "",
      "organizationName": "",
      "telVoice": "+18881234567"
   },
   "type": "CLIENT",
   "accounts": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/accounts"
      }
   },
   "brands": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/brands"
      }
   },
   "domains": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/domains"
      }
   },
   "subscriptions": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/subscriptions"
      }
   },
   "templates": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/templates"
      }
   },
   "users": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/users"
      }
   }
}

Similarly, you can add more customers.

Conclusion

You have successfully created one or more customers whom you can subscribe to services. You can use additional verification of their existence:

  • Use the REST requests described in the Preliminary Inspection to find the difference.
  • Find the new customers in the provider control panel (PCP). For this aim, log in to PCP and navigate to Operations > Customers to get a list of all customers. Use filters and sort the list by columns to identify the new customers.

Note

The new customer does not have staff members (administrators) yet.