DiscountInformation

The platform exposes APS type that allow external management systems receive deals from the platform.

GraphViz

Schema

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

{
  "name": "DiscountInformation",
  "id": "http://www.odin.com/oa/billing/discount-management/1.2",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "public": true
  },
  "operations": {
    "getSubscriptionResourceDiscountInfo": {
      "path": "/discounts/resource-discount",
      "verb": "GET",
      "response": {
        "type": "DiscountInfo"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "accountUuid": {
          "kind": "query",
          "type": "string"
        },
        "subscriptionUuid": {
          "kind": "query",
          "type": "string"
        },
        "resourceUuid": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getDealsForPlans": {
      "path": "/deals/get-for-plans",
      "verb": "POST",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "includeParentPlanDiscountConditions": {
          "kind": "query",
          "type": "boolean"
        },
        "accountId": {
          "kind": "query",
          "type": "string"
        },
        "resellerId": {
          "kind": "query",
          "type": "string"
        },
        "plans": {
          "kind": "body",
          "type": "array",
          "required": true
        }
      }
    },
    "getDealsPerUnit": {
      "path": "/deals",
      "verb": "POST",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "public": true
      },
      "parameters": {
        "providerCosts": {
          "kind": "query",
          "type": "boolean"
        },
        "accountId": {
          "kind": "query",
          "type": "string"
        },
        "resellerId": {
          "kind": "query",
          "type": "string"
        },
        "plans": {
          "kind": "body",
          "type": "array",
          "required": true
        }
      }
    }
  },
  "structures": {
    "DiscountInfo": {
      "type": "object",
      "properties": {
        "discountId": {
          "type": "integer"
        },
        "discountPercent": {
          "type": "number"
        }
      }
    },
    "PeriodDeals": {
      "type": "object",
      "properties": {
        "period": {
          "type": "Period",
          "required": true
        },
        "parentPlanDiscountCondition": {
          "type": "ParentPlanDiscountCondition"
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "ResourceDeals"
          }
        },
        "effectiveFees": {
          "type": "array",
          "items": {
            "type": "EffectiveFees"
          }
        }
      }
    },
    "Period": {
      "type": "object",
      "properties": {
        "unit": {
          "type": "string",
          "enum": [
            "MONTHS",
            "YEARS"
          ]
        },
        "duration": {
          "type": "integer"
        }
      }
    },
    "ParentPlanDiscountCondition": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "planPeriod": {
          "type": "Period"
        }
      }
    },
    "ResourceDeals": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "required": true
        },
        "effectiveFees": {
          "type": "array",
          "items": {
            "type": "EffectiveFees"
          }
        },
        "effectiveCosts": {
          "type": "array",
          "items": {
            "type": "EffectiveCosts"
          }
        },
        "model": {
          "type": "enum"
        }
      }
    },
    "EffectiveFees": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "required": true
        },
        "fee": {
          "type": "Currency"
        },
        "salesFee": {
          "type": "Currency"
        },
        "msrp": {
          "type": "Currency"
        },
        "discount": {
          "type": "Discount"
        },
        "salesDiscount": {
          "type": "Discount"
        },
        "exchangeRate": {
          "type": "number"
        },
        "quantity": {
          "type": "number",
          "description": "Deprecated"
        },
        "lowerLimit": {
          "type": "number"
        }
      }
    },
    "Currency": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        },
        "code": {
          "type": "string"
        }
      }
    },
    "Discount": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "PERCENT",
            "FIXED"
          ]
        },
        "value": {
          "type": "number"
        },
        "amount": {
          "type": "number"
        },
        "amountCode": {
          "type": "string"
        }
      }
    },
    "EffectiveCosts": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "required": true
        },
        "cost": {
          "type": "Currency"
        },
        "lowerLimit": {
          "type": "number"
        }
      }
    },
    "PlanDeals": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "periodDeals": {
          "type": "array",
          "required": true,
          "items": {
            "type": "PeriodDeals"
          }
        }
      }
    },
    "Plan": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "periods": {
          "type": "array",
          "items": {
            "type": "Period"
          }
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getSubscriptionResourceDiscountInfo

GET

/discounts/resource-discount

getDealsForPlans

POST

/deals/get-for-plans

Deals for provided plan periods

Deprecated. Gets collection of deals for a plan period. Every deal value contains plan period cost/price details. If a plan has resource rates configured, deal values for them will be returned too.

getDealsPerUnit

POST

/deals

Deals for provided plan periods

Gets collection of deals for a plan period. Every deal value contains plan period cost/price details for a one resource unit. If a plan has resource rates configured, deal values for them will be returned too. If resource rate has configured tiered prices, a lower limit will be returned for each tiered level.

getSubscriptionResourceDiscountInfo

HTTP Request

GET /aps/2/resources/{aps-id}/discounts/resource-discount

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

accountUuid

String

subscriptionUuid

String

resourceUuid

String

Returns

getDealsForPlans

HTTP Request

POST /aps/2/resources/{aps-id}/deals/get-for-plans

Description

Deprecated. Gets collection of deals for a plan period. Every deal value contains plan period cost/price details. If a plan has resource rates configured, deal values for them will be returned too.

Parameters

PARAMETER

TYPE

DESCRIPTION

includeParentPlanDiscountConditions

Boolean

Boolean flag whether include PlanDeals with ParentPlanDiscountConditions

accountId

String

resellerId

String

plans

Array

Collection of plans with periods to gets deals for

Returns

Deals for provided plan periods

getDealsPerUnit

HTTP Request

POST /aps/2/resources/{aps-id}/deals

Description

Gets collection of deals for a plan period. Every deal value contains plan period cost/price details for a one resource unit. If a plan has resource rates configured, deal values for them will be returned too. If resource rate has configured tiered prices, a lower limit will be returned for each tiered level.

Parameters

PARAMETER

TYPE

DESCRIPTION

providerCosts

Boolean

accountId

String

resellerId

String

plans

Array

Collection of plans with periods to gets deals for

Returns

Deals for provided plan periods

Structures

DiscountInfo

Discount Information.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

discountId

Integer

Not Required

Discount id.

discountPercent

Number

Not Required

Discount percent.

PeriodDeals

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

period

Period

Required

Service plan period.

parentPlanDiscountCondition

ParentPlanDiscountCondition

Not Required

Discount condition.

resources

Array of ResourceDeals

Not Required

Resource deals by service plan period.

effectiveFees

Array of EffectiveFees

Not Required

Effective fees for service plan periods.

Period

Resource identification structure.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

unit

Enum

Not Required

duration

Integer

Not Required

ParentPlanDiscountCondition

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

Parent service plan APS ID.

planPeriod

Period

Not Required

Parent service plan period.

ResourceDeals

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

resourceId

String

Required

Resource APS ID.

effectiveFees

Array of EffectiveFees

Not Required

Effective fees for the service plan resources.

effectiveCosts

Array of EffectiveCosts

Not Required

model

Enum

Not Required

EffectiveFees

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

name

String

Required

Fee name.

fee

Currency

Not Required

Fee value.

salesFee

Currency

Not Required

Sales Fee value.

msrp

Currency

Not Required

Manufacturer’s Suggested Retail Price.

discount

Discount

Not Required

Applicable discount.

salesDiscount

Discount

Not Required

Applicable discount in sales currency.

exchangeRate

Number

Not Required

Exchange rate from sales to billing currency.

quantity

Number

Not Required

Deprecated property. Quantity of resource units for which fee is indicated

lowerLimit

Number

Not Required

Lower limit for tiered price.

Currency

Basic currency structure.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

value

String

Not Required

Amount.

code

String

Not Required

Currency Code

Discount

The structure of applicable discount.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

type

Enum

Not Required

Specifies the discount type.

value

Number

Not Required

The discount value.

amount

Number

Not Required

The discount amount.

amountCode

String

Not Required

EffectiveCosts

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

name

String

Required

Fee name.

cost

Currency

Not Required

Cost value.

lowerLimit

Number

Not Required

Lower limit for tiered price.

PlanDeals

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

Service plan APS ID.

periodDeals

Array of PeriodDeals

Required

Plan period deals. See PeriodDeals.

Plan

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

Service plan APS ID.

periods

Array of Period

Not Required

Service plan periods.

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.