DiscountManager

GraphViz

Schema

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

{
  "name": "DiscountManager",
  "id": "http://com.odin.marketing/discountmanager/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "global": true
  },
  "operations": {
    "getDiscountList": {
      "path": "/discounts",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "createDiscount": {
      "path": "/discounts",
      "verb": "POST",
      "response": {
        "type": "DiscountDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discount": {
          "kind": "body",
          "type": "DiscountDTO"
        }
      }
    },
    "getDiscount": {
      "path": "/discounts/{discountId}",
      "verb": "GET",
      "response": {
        "type": "DiscountDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "updateDiscount": {
      "path": "/discounts",
      "verb": "PUT",
      "response": {
        "type": "DiscountDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discount": {
          "kind": "body",
          "type": "DiscountDTO"
        }
      }
    },
    "updateDiscountWithId": {
      "path": "/discounts/{discountId}",
      "verb": "PUT",
      "response": {
        "type": "DiscountDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "discount": {
          "kind": "body",
          "type": "DiscountDTO"
        }
      }
    },
    "deleteDiscount": {
      "path": "/discounts/{discountId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "addAccounts": {
      "path": "/discounts/{discountId}/accounts",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "accounts": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addCustomerClasses": {
      "path": "/discounts/{discountId}/customerClasses",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "classes": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addPlansToDiscount": {
      "path": "/discounts/{discountId}/plans",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "plans": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addResourcesToDiscount": {
      "path": "/discounts/{discountId}/resources",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "resources": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "getAccounts": {
      "path": "/discounts/{discountId}/accounts",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "AccountDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "getCustomerClasses": {
      "path": "/discounts/{discountId}/customerClasses",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "CustomerClassDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "getPlansByDiscountId": {
      "path": "/discounts/{discountId}/plans",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "PlanDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "getResourcesByDiscountId": {
      "path": "/discounts/{discountId}/resources",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ResourceDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "removeAccounts": {
      "path": "/discounts/{discountId}/accounts",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "accountId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeCustomerClasses": {
      "path": "/discounts/{discountId}/customerClasses",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "classId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removePlansFromDiscount": {
      "path": "/discounts/{discountId}/plans",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeResourcesFromDiscount": {
      "path": "/discounts/{discountId}/resources",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "resourceId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getApplicableDiscounts": {
      "path": "/applicableDiscounts",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ApplicableDiscountDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "accountId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getProductGroupList": {
      "path": "/productGroups",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "createProductGroup": {
      "path": "/productGroups",
      "verb": "POST",
      "response": {
        "type": "ProductGroupDTO"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "getProductGroup": {
      "path": "/productGroups/{groupId}",
      "verb": "GET",
      "response": {
        "type": "ProductGroupDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "updateProductGroup": {
      "path": "/productGroups",
      "verb": "PUT",
      "response": {
        "type": "ProductGroupDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "productGroup": {
          "kind": "body",
          "type": "ProductGroupDTO"
        }
      }
    },
    "updateProductGroupWithId": {
      "path": "/productGroups/{groupId}",
      "verb": "PUT",
      "response": {
        "type": "ProductGroupDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "productGroup": {
          "kind": "body",
          "type": "ProductGroupDTO"
        }
      }
    },
    "deleteProductGroup": {
      "path": "/productGroups/{groupId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "addPlansToGroup": {
      "path": "/productGroups/{groupId}/plans",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "plans": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addResourcesToGroup": {
      "path": "/productGroups/{groupId}/resources",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "resources": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "getPlansFromGroup": {
      "path": "/productGroups/{groupId}/plans",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "PlanDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "getResourcesFromGroup": {
      "path": "/productGroups/{groupId}/resources",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ResourceDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "removePlansFromGroup": {
      "path": "/productGroups/{groupId}/plans",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeResourcesFromGroup": {
      "path": "/productGroups/{groupId}/resources",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "resourceId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getPromotionList": {
      "path": "/promotions",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "createPromotion": {
      "path": "/promotions",
      "verb": "POST",
      "response": {
        "type": "PromotionDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotion": {
          "kind": "body",
          "type": "PromotionDTO"
        }
      }
    },
    "getPromotion": {
      "path": "/promotions/{promotionId}",
      "verb": "GET",
      "response": {
        "type": "PromotionDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "updatePromotion": {
      "path": "/promotions",
      "verb": "PUT",
      "response": {
        "type": "PromotionDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotion": {
          "kind": "body",
          "type": "PromotionDTO"
        }
      }
    },
    "updatePromotionWithId": {
      "path": "/promotions/{promotionId}",
      "verb": "PUT",
      "response": {
        "type": "PromotionDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotion": {
          "kind": "body",
          "type": "PromotionDTO"
        }
      }
    },
    "deletePromotion": {
      "path": "/promotions/{promotionId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "addPlansToPromotion": {
      "path": "/promotions/{promotionId}/plans",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "plans": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addParentPlansToPromotion": {
      "path": "/promotions/{promotionId}/parentplans",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "plans": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addResourcesToPromotion": {
      "path": "/promotions/{promotionId}/resources",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "resources": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "getPlansByPromotionId": {
      "path": "/promotions/{promotionId}/plans",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "getParentPlansByPromotionId": {
      "path": "/promotions/{promotionId}/parentplans",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "getResourcesByPromotionId": {
      "path": "/promotions/{promotionId}/resources",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "removePlansFromPromotion": {
      "path": "/promotions/{promotionId}/plans",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeParentPlansFromPromotion": {
      "path": "/promotions/{promotionId}/parentplans",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeResourcesFromPromotion": {
      "path": "/promotions/{promotionId}/resources",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "resourceId": {
          "kind": "query",
          "type": "string"
        }
      }
    }
  },
  "structures": {
    "DiscountDTO": {
      "type": "object",
      "properties": {
        "discountId": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "required": true
        },
        "owner": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "required": true,
          "default": "ACCOUNT_OR_CUSTOMER_CLASS",
          "enum": [
            "ACCOUNT_OR_CUSTOMER_CLASS",
            "PROMO_CODE",
            "ONE_TIME_PROMO_CODE"
          ]
        },
        "status": {
          "type": "string",
          "default": "INACTIVE",
          "enum": [
            "ACTIVE",
            "INACTIVE"
          ]
        },
        "promoCodeMask": {
          "type": "string"
        },
        "discountRate": {
          "type": "number",
          "required": true
        },
        "forAllPlans": {
          "type": "boolean",
          "default": "false"
        },
        "forAllResources": {
          "type": "boolean",
          "default": "false"
        },
        "priority": {
          "type": "integer",
          "default": "1"
        },
        "applicationRule": {
          "type": "string",
          "default": "SUCCESSIVE_DISCOUNT",
          "enum": [
            "SUCCESSIVE_DISCOUNT",
            "ARITHMETIC_SUM"
          ]
        },
        "productGroupId": {
          "type": "string"
        }
      }
    },
    "AccountDTO": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "required": true
        }
      }
    },
    "CustomerClassDTO": {
      "type": "object",
      "properties": {
        "classId": {
          "type": "string"
        }
      }
    },
    "Period": {
      "type": "object",
      "properties": {
        "unit": {
          "type": "string",
          "enum": [
            "DAYS",
            "MONTHS",
            "YEARS"
          ]
        },
        "duration": {
          "type": "integer"
        }
      }
    },
    "PlanDTO": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "period": {
          "type": "Period"
        }
      }
    },
    "ResourceDTO": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "required": true
        }
      }
    },
    "ApplicableDiscountDTO": {
      "type": "object",
      "properties": {
        "plans": {
          "type": "array",
          "items": {
            "type": "PlanDTO"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "ResourceDTO"
          }
        }
      }
    },
    "ProductGroupDTO": {
      "type": "object",
      "properties": {
        "groupId": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "required": true
        },
        "description": {
          "type": "string"
        }
      }
    },
    "PromotionDTO": {
      "type": "object",
      "properties": {
        "promotionId": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "required": true
        },
        "owner": {
          "type": "string"
        },
        "targetType": {
          "type": "string",
          "enum": [
            "CUSTOMER",
            "RESELLER"
          ]
        },
        "type": {
          "type": "string",
          "enum": [
            "GLOBAL",
            "PARENT_PLAN",
            "PROMO_CODE",
            "ONE_TIME_PROMO_CODE"
          ]
        },
        "status": {
          "type": "string",
          "required": true,
          "enum": [
            "ACTIVE",
            "INACTIVE"
          ]
        },
        "promoCode": {
          "type": "string"
        },
        "condition": {
          "type": "string"
        },
        "availableFrom": {
          "type": "date",
          "format": "yyyy-MM-dd"
        },
        "availableUntil": {
          "type": "date",
          "format": "yyyy-MM-dd"
        },
        "applicableFrom": {
          "type": "date",
          "format": "yyyy-MM-dd"
        },
        "applicableUntil": {
          "type": "date",
          "format": "yyyy-MM-dd"
        },
        "applicableTo": {
          "type": "array",
          "required": true,
          "enum": [
            "SALES",
            "RENEWAL",
            "SWITCH_PLAN"
          ],
          "items": {
            "type": "string"
          }
        },
        "subscriptionsLimit": {
          "type": "integer"
        },
        "perCustomerLimit": {
          "type": "integer"
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getDiscountList

GET

/discounts

List of DiscountDTO.

Get list of discounts.
Support RQL operators.
Accept HTTP header “APS-Actor-Scope” with possible values “OWN” or “FULL”.

createDiscount

POST

/discounts

Created DiscountDTO.

Creates a discount.

getDiscount

GET

/discounts/{discountId}

Created DiscountDTO.

Get a discount by discount Id.

updateDiscount

PUT

/discounts

Updated DiscountDTO.

Update a discount.

updateDiscountWithId

PUT

/discounts/{discountId}

Updated DiscountDTO.

Update a discount with given Id.

deleteDiscount

DELETE

/discounts/{discountId}

Delete a discount with given Id.

addAccounts

PUT

/discounts/{discountId}/accounts

Add list of accounts to a discount.

addCustomerClasses

PUT

/discounts/{discountId}/customerClasses

Add list of customer classes to a discount.

addPlansToDiscount

PUT

/discounts/{discountId}/plans

Add list of plans to a discount.

addResourcesToDiscount

PUT

/discounts/{discountId}/resources

Add list of resources to a discount.

getAccounts

GET

/discounts/{discountId}/accounts

List of AccountDTO

Get list of accounts for given discount

getCustomerClasses

GET

/discounts/{discountId}/customerClasses

List of CustomerClassDTO

Get list of customer classes for given discount

getPlansByDiscountId

GET

/discounts/{discountId}/plans

List of PlanDTO

Get list of plans for given discount

getResourcesByDiscountId

GET

/discounts/{discountId}/resources

List of ResourceDTO

Get list of resources for given discount

removeAccounts

DELETE

/discounts/{discountId}/accounts

Remove account from given discount

removeCustomerClasses

DELETE

/discounts/{discountId}/customerClasses

Remove customer class from given discount

removePlansFromDiscount

DELETE

/discounts/{discountId}/plans

Remove plan or plan period from given discount

removeResourcesFromDiscount

DELETE

/discounts/{discountId}/resources

Remove resource from given discount

getApplicableDiscounts

GET

/applicableDiscounts

Get list of active discounts applicable for given account

getProductGroupList

GET

/productGroups

List of ProductGroupDTO

Get list of product groups.
Support RQL operators.
Accept HTTP header “APS-Actor-Scope” with possible values “OWN” or “FULL”.

createProductGroup

POST

/productGroups

Created ProductGroupDTO.

Creates a Product Group.

getProductGroup

GET

/productGroups/{groupId}

Created ProductGroupDTO.

Get a Product Group by Product Group Id.

updateProductGroup

PUT

/productGroups

Updated ProductGroupDTO.

Update a Product Group.

updateProductGroupWithId

PUT

/productGroups/{groupId}

Updated ProductGroupDTO.

Update a Product Group with given Id.

deleteProductGroup

DELETE

/productGroups/{groupId}

Delete a Product Group with given Id.

addPlansToGroup

PUT

/productGroups/{groupId}/plans

Add list of plans to a Product Group.

addResourcesToGroup

PUT

/productGroups/{groupId}/resources

Add list of resources to a Product Group.

getPlansFromGroup

GET

/productGroups/{groupId}/plans

List of PlanDTO

Get list of plans for given Product Group

getResourcesFromGroup

GET

/productGroups/{groupId}/resources

List of ResourceDTO

Get list of resources for given Product Group

removePlansFromGroup

DELETE

/productGroups/{groupId}/plans

Remove plan or plan period from given Product Group

removeResourcesFromGroup

DELETE

/productGroups/{groupId}/resources

Remove resource from given Product Group

getPromotionList

GET

/promotions

createPromotion

POST

/promotions

getPromotion

GET

/promotions/{promotionId}

updatePromotion

PUT

/promotions

updatePromotionWithId

PUT

/promotions/{promotionId}

deletePromotion

DELETE

/promotions/{promotionId}

addPlansToPromotion

PUT

/promotions/{promotionId}/plans

addParentPlansToPromotion

PUT

/promotions/{promotionId}/parentplans

addResourcesToPromotion

PUT

/promotions/{promotionId}/resources

getPlansByPromotionId

GET

/promotions/{promotionId}/plans

getParentPlansByPromotionId

GET

/promotions/{promotionId}/parentplans

getResourcesByPromotionId

GET

/promotions/{promotionId}/resources

removePlansFromPromotion

DELETE

/promotions/{promotionId}/plans

removeParentPlansFromPromotion

DELETE

/promotions/{promotionId}/parentplans

removeResourcesFromPromotion

DELETE

/promotions/{promotionId}/resources

getDiscountList

HTTP Request

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

Description

Get list of discounts.
Support RQL operators.
Accept HTTP header “APS-Actor-Scope” with possible values “OWN” or “FULL”.

Returns

List of DiscountDTO.

createDiscount

HTTP Request

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

Description

Creates a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discount

DiscountDTO

A DiscountDTO

Returns

Created DiscountDTO.

getDiscount

HTTP Request

GET /aps/2/resources/{aps-id}/discounts/{discountId}

Description

Get a discount by discount Id.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

Created DiscountDTO.

updateDiscount

HTTP Request

PUT /aps/2/resources/{aps-id}/discounts

Description

Update a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discount

DiscountDTO

DiscountDTO

Returns

Updated DiscountDTO.

updateDiscountWithId

HTTP Request

PUT /aps/2/resources/{aps-id}/discounts/{discountId}

Description

Update a discount with given Id.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

discount

DiscountDTO

DiscountDTO

Returns

Updated DiscountDTO.

deleteDiscount

HTTP Request

DELETE /aps/2/resources/{aps-id}/discounts/{discountId}

Description

Delete a discount with given Id.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

addAccounts

HTTP Request

PUT /aps/2/resources/{aps-id}/discounts/{discountId}/accounts

Description

Add list of accounts to a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

accounts

Array

List of AccountDTO

Returns

addCustomerClasses

HTTP Request

PUT /aps/2/resources/{aps-id}/discounts/{discountId}/customerClasses

Description

Add list of customer classes to a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

classes

Array

List of CustomerClassDTO

Returns

addPlansToDiscount

HTTP Request

PUT /aps/2/resources/{aps-id}/discounts/{discountId}/plans

Description

Add list of plans to a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

plans

Array

List of PlanDTO

Returns

addResourcesToDiscount

HTTP Request

PUT /aps/2/resources/{aps-id}/discounts/{discountId}/resources

Description

Add list of resources to a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

resources

Array

List of ResourceDTO

Returns

getAccounts

HTTP Request

GET /aps/2/resources/{aps-id}/discounts/{discountId}/accounts

Description

Get list of accounts for given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

List of AccountDTO

getCustomerClasses

HTTP Request

GET /aps/2/resources/{aps-id}/discounts/{discountId}/customerClasses

Description

Get list of customer classes for given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

List of CustomerClassDTO

getPlansByDiscountId

HTTP Request

GET /aps/2/resources/{aps-id}/discounts/{discountId}/plans

Description

Get list of plans for given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

List of PlanDTO

getResourcesByDiscountId

HTTP Request

GET /aps/2/resources/{aps-id}/discounts/{discountId}/resources

Description

Get list of resources for given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

List of ResourceDTO

removeAccounts

HTTP Request

DELETE /aps/2/resources/{aps-id}/discounts/{discountId}/accounts

Description

Remove account from given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

accountId

String

Account Id

Returns

removeCustomerClasses

HTTP Request

DELETE /aps/2/resources/{aps-id}/discounts/{discountId}/customerClasses

Description

Remove customer class from given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

classId

String

Customer class Id

Returns

removePlansFromDiscount

HTTP Request

DELETE /aps/2/resources/{aps-id}/discounts/{discountId}/plans

Description

Remove plan or plan period from given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

planId

String

Customer class Id

Returns

removeResourcesFromDiscount

HTTP Request

DELETE /aps/2/resources/{aps-id}/discounts/{discountId}/resources

Description

Remove resource from given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

resourceId

String

Resource Id

Returns

getApplicableDiscounts

HTTP Request

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

Description

Get list of active discounts applicable for given account

Parameters

PARAMETER

TYPE

DESCRIPTION

accountId

String

Account Id

Returns

getProductGroupList

HTTP Request

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

Description

Get list of product groups.
Support RQL operators.
Accept HTTP header “APS-Actor-Scope” with possible values “OWN” or “FULL”.

Returns

List of ProductGroupDTO

createProductGroup

HTTP Request

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

Description

Creates a Product Group.

Returns

Created ProductGroupDTO.

getProductGroup

HTTP Request

GET /aps/2/resources/{aps-id}/productGroups/{groupId}

Description

Get a Product Group by Product Group Id.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

Returns

Created ProductGroupDTO.

updateProductGroup

HTTP Request

PUT /aps/2/resources/{aps-id}/productGroups

Description

Update a Product Group.

Parameters

PARAMETER

TYPE

DESCRIPTION

productGroup

ProductGroupDTO

A ProductGroupDTO

Returns

Updated ProductGroupDTO.

updateProductGroupWithId

HTTP Request

PUT /aps/2/resources/{aps-id}/productGroups/{groupId}

Description

Update a Product Group with given Id.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

productGroup

ProductGroupDTO

A ProductGroupDTO

Returns

Updated ProductGroupDTO.

deleteProductGroup

HTTP Request

DELETE /aps/2/resources/{aps-id}/productGroups/{groupId}

Description

Delete a Product Group with given Id.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

Returns

addPlansToGroup

HTTP Request

PUT /aps/2/resources/{aps-id}/productGroups/{groupId}/plans

Description

Add list of plans to a Product Group.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

plans

Array

List of PlanDTO

Returns

addResourcesToGroup

HTTP Request

PUT /aps/2/resources/{aps-id}/productGroups/{groupId}/resources

Description

Add list of resources to a Product Group.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

resources

Array

List of ResourceDTO

Returns

getPlansFromGroup

HTTP Request

GET /aps/2/resources/{aps-id}/productGroups/{groupId}/plans

Description

Get list of plans for given Product Group

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

Returns

List of PlanDTO

getResourcesFromGroup

HTTP Request

GET /aps/2/resources/{aps-id}/productGroups/{groupId}/resources

Description

Get list of resources for given Product Group

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

Returns

List of ResourceDTO

removePlansFromGroup

HTTP Request

DELETE /aps/2/resources/{aps-id}/productGroups/{groupId}/plans

Description

Remove plan or plan period from given Product Group

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

planId

String

Customer class Id

Returns

removeResourcesFromGroup

HTTP Request

DELETE /aps/2/resources/{aps-id}/productGroups/{groupId}/resources

Description

Remove resource from given Product Group

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

resourceId

String

Resource Id

Returns

getPromotionList

HTTP Request

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

Description

Returns

createPromotion

HTTP Request

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

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotion

PromotionDTO

Returns

getPromotion

HTTP Request

GET /aps/2/resources/{aps-id}/promotions/{promotionId}

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

updatePromotion

HTTP Request

PUT /aps/2/resources/{aps-id}/promotions

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotion

PromotionDTO

Returns

updatePromotionWithId

HTTP Request

PUT /aps/2/resources/{aps-id}/promotions/{promotionId}

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotion

PromotionDTO

Returns

deletePromotion

HTTP Request

DELETE /aps/2/resources/{aps-id}/promotions/{promotionId}

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

addPlansToPromotion

HTTP Request

PUT /aps/2/resources/{aps-id}/promotions/{promotionId}/plans

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

plans

Array

Returns

addParentPlansToPromotion

HTTP Request

PUT /aps/2/resources/{aps-id}/promotions/{promotionId}/parentplans

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

plans

Array

Returns

addResourcesToPromotion

HTTP Request

PUT /aps/2/resources/{aps-id}/promotions/{promotionId}/resources

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

resources

Array

Returns

getPlansByPromotionId

HTTP Request

GET /aps/2/resources/{aps-id}/promotions/{promotionId}/plans

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

getParentPlansByPromotionId

HTTP Request

GET /aps/2/resources/{aps-id}/promotions/{promotionId}/parentplans

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

getResourcesByPromotionId

HTTP Request

GET /aps/2/resources/{aps-id}/promotions/{promotionId}/resources

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

removePlansFromPromotion

HTTP Request

DELETE /aps/2/resources/{aps-id}/promotions/{promotionId}/plans

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

planId

String

Returns

removeParentPlansFromPromotion

HTTP Request

DELETE /aps/2/resources/{aps-id}/promotions/{promotionId}/parentplans

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

planId

String

Returns

removeResourcesFromPromotion

HTTP Request

DELETE /aps/2/resources/{aps-id}/promotions/{promotionId}/resources

Description

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

resourceId

String

Returns

Structures

DiscountDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

discountId

String

Not Required

name

String

Required

owner

String

Not Required

type

Enum

Required

ACCOUNT_OR_CUSTOMER_CLASS

status

Enum

Not Required

INACTIVE

promoCodeMask

String

Not Required

discountRate

Number

Required

forAllPlans

Boolean

Not Required

false

forAllResources

Boolean

Not Required

false

priority

Integer

Not Required

1

applicationRule

Enum

Not Required

SUCCESSIVE_DISCOUNT

productGroupId

String

Not Required

AccountDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

accountId

String

Required

CustomerClassDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

classId

String

Not Required

Period

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

unit

Enum

Not Required

duration

Integer

Not Required

PlanDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

period

Period

Not Required

ResourceDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

resourceId

String

Required

ApplicableDiscountDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

plans

Array of PlanDTO

Not Required

resources

Array of ResourceDTO

Not Required

ProductGroupDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

groupId

String

Not Required

owner

String

Not Required

name

String

Required

description

String

Not Required

PromotionDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

promotionId

String

Not Required

name

String

Required

owner

String

Not Required

targetType

Enum

Not Required

type

Enum

Not Required

status

Enum

Required

promoCode

String

Not Required

condition

String

Not Required

availableFrom

Date

Not Required

availableUntil

Date

Not Required

applicableFrom

Date

Not Required

applicableUntil

Date

Not Required

applicableTo

Array of String

Required

subscriptionsLimit

Integer

Not Required

perCustomerLimit

Integer

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.