Subscription Resource Validation

Customers can change the number of resource units in a subscription via ActivePlatform. The Subscription Resource Validation notification URL allows a vendor service to validate the new resource quantity and allow or deny the change.

The general flow for the Subscription Resource Validation event includes the following steps:

  1. A customer creates an order of any type with a new resource quantity for a subscription via ActivePlatform.
  2. ActivePlatform calls the configured notification URL, passing the JSON with the details about the subscription.
  3. The vendor service validates the new resource quantity and allows or denies the change.
  4. ActivePlatform processes the operation with the subscription.
POST /subscription/resource_validation?ap_guid={ap_guid}&reseller_id={reseller_id}

Arguments

Name

Parameter type

Data type

Description

ap_guid

query

string

The auto-generated installation GUID (Globally Unique Identifier) used to identify the ActivePlatform installation called an entry point
reseller_idquerystringThe ID of the reseller who sold the subscription to the service plan via the ActivePlatform installation

Event body

Name

Data type

Description

external_idstringThe subscription GUID generated in the vendor service during the subscription provisioning
resellerobjectInformation about the reseller who sold the subscription to a service plan of a product via ActivePlatform (see Viewing and updating reseller general information in the Operator Comtrol Panel guide)

idintegerThe reseller ID

namestringThe reseller name

company_namestringThe company name

first_addressstringAddress line 1

second_addressstringAddress line 2

citystringCity

regionstringRegion

zipstringZip code

countrystringCountry code

company_phonestringThe company's phone number in the international format

company_email    stringThe company's email address

currencystringThe reseller currency code

attributesobjectThe list of the product attributes (key-value pairs) applied to the reseller (see Extending the reseller object and Product attributes):

core_attributesobjectThe list of public custom attributes (key-value pairs) applied to the reseller in ActivePlatform (see in the Viewing the list of attributes Operator Comtrol Panel guide):
  • {reseller_attribute_key} — the custom attribute key.
  • {reseller_attribute_value} — the custom attribute value.
distributorobject

Information about the distributor who sold the subscription. The distributor information is stored and managed in the ActivePlatform installation








idintegerThe distributor ID
namestringThe distributor name
regionstring

The distributor location: region

currencystring

The distributor currency code

attributesobjectThe list of the product attributes applied to a distributor (see Extending the distributor object and Product attributes):
plugin_connectorobject

Information about the plugin connector of the subscription


idintegerThe plugin connector ID
tenantobjectInformation about the account of the customer who ordered the subscription. The account information is stored and managed in the ActivePlatform installation



















idintegerThe account ID
company_namestringThe company name, if the customer is a legal entity
typestringThe account type in the ActivePlatform installation
contactobjectThe contact information for the account











first_namestringThe first name of the account contact person
last_namestringThe last name of the account contact person
zipstringThe account address: zip-code
citystringThe account address: city
statestringThe account address: state or region
countrystringThe account address: two-letter country code
phonestring

The contact phone number of the account:

  • + < country code > < city code or network code > < phone number >.
  • 00 < country code > < city code or network code > < phone number >.
emailstringThe contact email of the account
faxstring

The fax number of the account:

  • + < country code > < city code or network code > < phone number >.
  • 00 < country code > < city code or network code > < phone number >.
address_line_1stringThe account address (line 1)
address_line_2stringThe account address (line 2)
ownerobjectInformation about the account Owner



first_namestringThe first name of the account Owner
last_namestringThe last name of the account Owner
phonestring

The contact phone number of the account Owner:

  • + < country code > < city code or network code > < phone number >.
  • 00 < country code > < city code or network code > < phone number >.
planobjectInformation about the service plan ordered by the account. The service plan information is stored and managed in Vendor Portal











namestringThe service plan name in Vendor Portal
skustringThe stock keeping unit of the service plan in Vendor Portal
descriptionstringThe service plan description in Vendor Portal
resourcesarray of objectsInformation about the ordered resources of the service plan



keystringThe resource key in Vendor Portal
quantityintegerThe current number of the resource units
resulting_quantityintegerThe new number of the resource units to be validated
periodobjectInformation about the ordered period of the service plan


valueintegerThe plan period duration
typestring

The unit of measure of the period:

  • day
  • month
  • year
trialbool

Indicates whether the ordered plan period is trial:

  • true — the ordered plan period is trial (free).
  • false — the ordered plan period is commercial (paid).

endlessbool

Indicates whether the ordered plan period is endless:

  • true — the ordered plan period is endless (ignore value and type).
  • false — the ordered plan period is not endless (use value and type).

subscriptionobjectInformation about the ordered subscription. The subscription information is stored and managed in the ActivePlatform installation


idstringThe subscription ID

trialbool

Indicates whether the subscription is trial:

  • true — the subscription is trial (free).
  • false — the subscription is commercial (paid).


expiration_datestringThe subscription expiration date (YYYY-MM-DD)

attributesobject

The list of additional subscription attributes required for the subscription provisioning (see Extending the subscriptions object):

  • key — the attribute key in Vendor Portal.
  • value — the attribute value.

You can add the attributes in the Attributes section of Vendor Portal if you need to receive additional information during subscription provisioning

attributesobject

The list of additional order attributes required for the subscription provisioning (see Order Attributes. Attributes Validation):

  • key — the attribute key in Vendor Portal.
  • value — the attribute value.

plugin_provisioning_paramsobjectThe plugin provisioning parameters

applicationintegerThe application instance ID
order_typeobjectThe order type

Response model

If the new resource quantity is valid, the vendor service returns the 200 HTTP code status.

Otherwize, the vendor service returns:

  1. HTTP code status.
  2. JSON with the text message of the occurred error.
  3. Optionally, the available resource quantity.

Event example

POST /subscription/resource_validation?ap_guid=test-server.new-guid&reseller_id=1
{
  "external_id": "0000fff2-00c8-9d6e-0ecc-3a083b9e736a",
  "distributor": {
    "id": 211,
    "name": "Dev Acc",
    "region": "Region",
    "currency": "USD",
    "attributes": {
      "certificate_password": "[FILTERED]"
    }
  },
  "plugin_connector": {
    "id": 685
  },
  "reseller": {
    "id": 2,
    "name": "Root",
    "company_name": "Dev acc",
    "first_address": "Street building",
    "second_address": "",
    "city": "City",
    "region": "Region",
    "zip": "220000",
    "country": "US",
    "company_phone": "+123555456",
    "company_email": "email@example.com",
    "currency": "USD",
    "attributes": {
      "reseller_public_id": "********"
    },
    "core_attributes": {
      "pin": "********"
    }
  },
  "tenant": {
    "id": 199,
    "company_name": "John GS",
    "type": "Business",
    "contact": {
      "first_name": "John",
      "last_name": "GS",
      "zip": "220000",
      "city": "Quinsk",
      "state": "Quinsk",
      "country": "AQ",
      "phone": "+123 55 1111111",
      "email": "test@example.com",
      "fax": "+123 55 1111111",
      "address_line_1": "Quinsk",
      "address_line_2": ""
    },
    "owner": {
      "first_name": "John",
      "last_name": "GS",
      "phone": "+123 55 1111111"
    }
  },
  "plan": {
    "name": "Cloud User 50-99 WKS/FS",
    "sku": "KLMN1234OMG",
    "description": "",
    "resources": [
      {
        "key": "quantity",
        "quantity": 50,
        "resulting_quantity": 30
      }
    ],
    "period": {
      "value": 1,
      "type": "month",
      "trial": false,
      "endless": false
    },
    "attributes": {}
  },
  "subscription": {
    "id": 3002619,
    "trial": false,
    "expiration_date": "2024-01-05",
    "attributes": {}
  },
  "attributes": {},
  "plugin_provisioning_params": {
    "application": 1881
  },
  "order_type": "change_order"
}