MarginManager

Margin management API

GraphViz

Schema

The considered APS type (download) extends the Resource APS type(s) and looks as follows:

{
  "name": "MarginManager",
  "id": "http://com.odin.rating/margin-manager/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "global": true
  },
  "operations": {
    "checkMarginConfigurationAvailability": {
      "path": "checkMarginConfigurationAvailability",
      "verb": "GET",
      "response": {
        "type": "MarginConfigurationAvailability"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "planUUID": {
          "kind": "query",
          "type": "string"
        },
        "resaleAccountUUID": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getMarginInfo": {
      "path": "marginInfo",
      "verb": "GET",
      "response": {
        "type": "MarginInfo"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "planUUID": {
          "kind": "query",
          "type": "string"
        },
        "resaleAccountUUID": {
          "kind": "query",
          "type": "string"
        }
      }
    }
  },
  "structures": {
    "MarginConfigurationAvailability": {
      "type": "object",
      "properties": {
        "available": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "MarginRestrictions": {
      "type": "object",
      "properties": {
        "canCreate": {
          "type": "boolean"
        },
        "canSetPriceModel": {
          "type": "boolean"
        },
        "canManageAttributes": {
          "type": "boolean"
        },
        "canSetTotal": {
          "type": "boolean"
        }
      }
    },
    "MarginInfo": {
      "type": "object",
      "properties": {
        "restrictions": {
          "type": "MarginRestrictions",
          "required": true
        },
        "configuredPriceModel": {
          "type": "string",
          "enum": [
            "COS",
            "MSRP"
          ]
        },
        "margin": {
          "type": "http://aps-standard.org/types/margin/1.0"
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

checkMarginConfigurationAvailability

GET

/checkMarginConfigurationAvailability

Checks whether margin or markup can be configured for service plan {@code planUUID} and account {@code resaleAccountUUID}.

getMarginInfo

GET

/marginInfo

Returns information about margin or markup configuration for the service plan {@code planUUID} and account {@code resaleAccountUUID}. The returned information includes the list of restrictions and maximum values for the BSS resource margins or markups, which are based on margins or markups for this service plan and its place in the service plan chain.

checkMarginConfigurationAvailability

HTTP Request

GET /aps/2/resources/{aps-id}/checkMarginConfigurationAvailability

Description

Checks whether margin or markup can be configured for service plan {@code planUUID} and account {@code resaleAccountUUID}.

Parameters

PARAMETER

TYPE

DESCRIPTION

planUUID

String

The APS ID of the service plan to check its margin or markup configuration ability.

resaleAccountUUID

String

The APS ID of the account to check availability of its specific margin or markup configuration. If it is not configured, availability of the default margin or markup configuration for the service plan {@code planUUID} is checked.

Returns

getMarginInfo

HTTP Request

GET /aps/2/resources/{aps-id}/marginInfo

Description

Returns information about margin or markup configuration for the service plan {@code planUUID} and account {@code resaleAccountUUID}. The returned information includes the list of restrictions and maximum values for the BSS resource margins or markups, which are based on margins or markups for this service plan and its place in the service plan chain.

Parameters

PARAMETER

TYPE

DESCRIPTION

planUUID

String

The APS ID of the service plan to get its margin or markup information.

resaleAccountUUID

String

The APS ID of the account to check its margin or markup configuration information. If it is not configured, information about the default margin or markup configuration for the service plan {@code planUUID} is returned.

Returns

Structures

MarginConfigurationAvailability

Information about margin or markup configuration availability.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

available

Boolean

Not Required

True if there is margin or markup configuration available, otherwise false.

reason

String

Not Required

Contains the reason why margin or markup configuration is not available. These are the possible reason codes: <ul> <li>DEFAULT_MARGIN_IS_NOT_CREATED - the default margin is not created for the service plan. </li> <li>MARGIN_OF_PARENT_PLAN_IS_NOT_CREATED - there is no margin configured for the parent service plan.</li> </ul>

MarginRestrictions

Margin or markup restrictions based on margins or markups of the plan chain.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

canCreate

Boolean

Not Required

True if margin or markup does not exist.

canSetPriceModel

Boolean

Not Required

True if it is possible to select the price model. Applicable only to the first service plan in a service plan chain in case there is no Margin for this plan.

canManageAttributes

Boolean

Not Required

True if it is possible to manage margin attributes. Applicable only to the first service plan in a service plan chain.

canSetTotal

Boolean

Not Required

True if it is possible to set total margin. Applicable only to the first service plan in a service plan chain.

MarginInfo

Information about margin or markup configuration that includes the list of restrictions and maximum values for the BSS resource margins, which are based on margins or markups for this service plan and its place in the service plan chain.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

restrictions

MarginRestrictions

Required

Restrictions.

configuredPriceModel

Enum

Not Required

The price model configured for the Margin resource of the first service plan in the service plan chain. <br> All Margin resources must have the same price model. <br> Null values are allowed only for the first service plan in the service plan chain, provided that the Margin resource was not created for this service plan.

margin

Margin

Not Required

The Margin resource containing margins or markups for all resources of a service plan as well as all margins or markups for attributes. Each margin or markup of a BSS resource has its maximum value defined in the {code totalMargin} property. Depending on the place of the service plan in the service plan chain, this value can be different.

Examples

Since the considered APS type contains custom operations, refer to Custom Operations for the general explanation of their structure and examples of operation calls.