DiscountInformation

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.3",
  "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
        },
        "model": {
          "type": "string",
          "enum": [
            "FLAT",
            "TIERED",
            "VOLUME_SUBSCRIPTION",
            "VOLUME_ORDER"
          ]
        },
        "fee": {
          "type": "Currency"
        },
        "salesFee": {
          "type": "Currency"
        },
        "msrp": {
          "type": "Currency"
        },
        "discount": {
          "type": "Discount"
        },
        "regularFee": {
          "type": "Currency"
        },
        "salesDiscount": {
          "type": "Discount"
        },
        "exchangeRate": {
          "type": "number"
        },
        "quantity": {
          "type": "number",
          "description": "Deprecated"
        },
        "lowerLimit": {
          "type": "number"
        },
        "ratingAttribute": {
          "type": "string"
        },
        "priceLevelHint": {
          "type": "string"
        }
      }
    },
    "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"
          }
        },
        "currency": {
          "type": "string"
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getSubscriptionResourceDiscountInfo

GET

/discounts/resource-discount

DiscountInfo instance

Gets discount id and percent for specific resources of subscription

getDealsForPlans

POST

/deals/get-for-plans

getDealsPerUnit

POST

/deals

getSubscriptionResourceDiscountInfo

HTTP Request

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

Description

Gets discount id and percent for specific resources of subscription

Parameters

PARAMETER

TYPE

DESCRIPTION

accountUuid

String

Account uuid of subscription owner

subscriptionUuid

String

Subscription uuid

resourceUuid

String

Uuid of subscription resource for which discount should be found

Returns

DiscountInfo instance

getDealsForPlans

HTTP Request

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

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

includeParentPlanDiscountConditions

Boolean

accountId

String

resellerId

String

plans

Array

Returns

getDealsPerUnit

HTTP Request

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

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

providerCosts

Boolean

accountId

String

resellerId

String

plans

Array

Returns

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.

model

Enum

Not Required

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.

regularFee

Currency

Not Required

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.

ratingAttribute

String

Not Required

priceLevelHint

String

Not Required

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.

currency

String

Not Required

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.