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.1",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "public": true
  },
  "operations": {
    "getDealsForPlans": {
      "path": "/deals/get-for-plans",
      "verb": "POST",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "includeParentPlanDiscountConditions": {
          "kind": "query",
          "type": "boolean"
        },
        "plans": {
          "kind": "body",
          "type": "array",
          "required": true
        }
      }
    },
    "getDealsPerUnit": {
      "path": "/deals",
      "verb": "POST",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "plans": {
          "kind": "body",
          "type": "array",
          "required": true
        }
      }
    },
    "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"
        }
      }
    }
  },
  "structures": {
    "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"
          }
        }
      }
    },
    "EffectiveFees": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "required": true
        },
        "fee": {
          "type": "Currency"
        },
        "msrp": {
          "type": "Currency"
        },
        "discount": {
          "type": "Discount"
        },
        "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"
        }
      }
    },
    "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"
          }
        }
      }
    },
    "DiscountInfo": {
      "type": "object",
      "properties": {
        "discountId": {
          "type": "integer"
        },
        "discountPercent": {
          "type": "number"
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getDealsForPlans

POST

/deals/get-for-plans

getDealsPerUnit

POST

/deals

getSubscriptionResourceDiscountInfo

GET

/discounts/resource-discount

DiscountInfo instance

Gets discount id and percent for specific resources of subscription

getDealsForPlans

HTTP Request

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

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

includeParentPlanDiscountConditions

Boolean

plans

Array

Returns

getDealsPerUnit

HTTP Request

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

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

plans

Array

Returns

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

Structures

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

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

unit

Enum

Not Required

Period unit. Available values are “MONTHS” and “YEARS”.

duration

Integer

Not Required

Period duration.

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.

EffectiveFees

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

name

String

Required

Fee name.

fee

Currency

Not Required

Fee value.

msrp

Currency

Not Required

Manufacturer’s Suggested Retail Price.

discount

Discount

Not Required

Applicable discount.

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

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

type

Enum

Not Required

Discount type. Possible values are “PERCENT”, “FIXED”.

value

Number

Not Required

Discount value.

amount

Number

Not Required

Discount amount.

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.

DiscountInfo

Discount Information.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

discountId

Integer

Not Required

Discount id.

discountPercent

Number

Not Required

Discount percent.

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.