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.4",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "global": true
  },
  "operations": {
    "getProductGroupList": {
      "path": "/productGroups",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "createProductGroup": {
      "path": "/productGroups",
      "verb": "POST",
      "response": {
        "type": "ProductGroupDTO"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "cloneProductGroup": {
      "path": "/productGroups/clone",
      "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"
        }
      }
    },
    "addResourceRatesToGroup": {
      "path": "/productGroups/{groupId}/resourceRates",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "resourceRates": {
          "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"
        }
      }
    },
    "getResourceRatesFromGroup": {
      "path": "/productGroups/{groupId}/resourceRates",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ResourceRateDTO"
        }
      },
      "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"
        }
      }
    },
    "removeResourceRatesFromGroup": {
      "path": "/productGroups/{groupId}/resourceRates",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "groupId": {
          "kind": "path",
          "type": "string"
        },
        "resourceId": {
          "kind": "query",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getDefaultPromoCodeTemplates": {
      "path": "/oneTimePromoCodes/templates/default",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "getLatestPromoCodeTemplate": {
      "path": "/oneTimePromoCodes/templates/latest",
      "verb": "GET",
      "response": {
        "type": "StringResponse"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "updateLatestPromoCodeTemplate": {
      "path": "/oneTimePromoCodes/templates/latest",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "template": {
          "kind": "body",
          "type": "string"
        }
      }
    },
    "getRandomPromoCodeForTemplate": {
      "path": "/oneTimePromoCodes/random",
      "verb": "GET",
      "response": {
        "type": "StringResponse"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "template": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    },
    "addPromoCodes": {
      "path": "/discounts/{discountId}/oneTimePromoCodes",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "promoCodesToAdd": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "generatePromoCodes": {
      "path": "/discounts/{discountId}/oneTimePromoCodes/generate",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "generatePromoCodesRequest": {
          "kind": "body",
          "type": "GenerateOneTimePromoCodesRequestDTO"
        }
      }
    },
    "importPromoCodes": {
      "path": "/discounts/{discountId}/oneTimePromoCodes/import",
      "verb": "POST",
      "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"
        }
      }
    },
    "addResourceRatesToDiscount": {
      "path": "/discounts/{discountId}/resourceRates",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "resourceRates": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "getPromoCodes": {
      "path": "/discounts/{discountId}/oneTimePromoCodes",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    },
    "getResourceRatesByDiscountId": {
      "path": "/discounts/{discountId}/resourceRates",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ResourceRateDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "removePromoCode": {
      "path": "/discounts/{discountId}/oneTimePromoCodes",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "promoCode": {
          "kind": "query",
          "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"
        }
      }
    },
    "removeResourceRatesFromDiscount": {
      "path": "/discounts/{discountId}/resourceRates",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "discountId": {
          "kind": "path",
          "type": "string"
        },
        "resourceId": {
          "kind": "query",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getApplicableDiscounts": {
      "path": "/applicableDiscounts",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ApplicableDiscountDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "accountId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "getEnabledFeatures": {
      "path": "/feature/enabledFeatures",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "getPromotions": {
      "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"
        }
      }
    },
    "getPromotionById": {
      "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"
        }
      }
    },
    "deletePromotionById": {
      "path": "/promotions/{promotionId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "addPromoCodesToPromotion": {
      "path": "/promotions/{promotionId}/oneTimePromoCodes",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promoCodesToAdd": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "generatePromoCodesForPromotion": {
      "path": "/promotions/{promotionId}/oneTimePromoCodes/generate",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "generatePromoCodesRequest": {
          "kind": "body",
          "type": "GenerateOneTimePromoCodesRequestDTO"
        }
      }
    },
    "importPromoCodesToPromotion": {
      "path": "/promotions/{promotionId}/oneTimePromoCodes/import",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "addPlansToPromotion": {
      "path": "/promotions/{promotionId}/plans",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotedPlansToAdd": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addParentPlansToPromotion": {
      "path": "/promotions/{promotionId}/parentPlans",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotedParentPlansToAdd": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "addResourcesToPromotion": {
      "path": "/promotions/{promotionId}/resources",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotedResourcesToAdd": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "getPromoCodesByPromotionId": {
      "path": "/promotions/{promotionId}/oneTimePromoCodes",
      "verb": "GET",
      "response": {
        "type": "array"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    },
    "updatePlansInPromotion": {
      "path": "/promotions/{promotionId}/plans",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotedPlansToUpdate": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "updateParentPlansInPromotion": {
      "path": "/promotions/{promotionId}/parentPlans",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotedParentPlansToUpdate": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "updateResourcesInPromotion": {
      "path": "/promotions/{promotionId}/resources",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promotedResourcesToUpdate": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "removePromoCodeFromPromotion": {
      "path": "/promotions/{promotionId}/oneTimePromoCodes",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "promoCode": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removePlanFromPromotion": {
      "path": "/promotions/{promotionId}/plans",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeParentPlanFromPromotion": {
      "path": "/promotions/{promotionId}/parentPlans",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "removeResourceFromPromotion": {
      "path": "/promotions/{promotionId}/resources",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "promotionId": {
          "kind": "path",
          "type": "string"
        },
        "planId": {
          "kind": "query",
          "type": "string"
        },
        "resourceId": {
          "kind": "query",
          "type": "string"
        }
      }
    }
  },
  "structures": {
    "ProductGroupDTO": {
      "type": "object",
      "properties": {
        "groupId": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "required": true
        },
        "description": {
          "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
        }
      }
    },
    "ResourceRateDTO": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "required": true
        },
        "planId": {
          "type": "string",
          "required": true
        },
        "period": {
          "type": "Period"
        }
      }
    },
    "StringResponse": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    },
    "OneTimePromoCodeDTO": {
      "type": "object",
      "properties": {
        "promoCode": {
          "type": "string",
          "required": true
        },
        "subscriptionId": {
          "type": "string"
        }
      }
    },
    "AccountDTO": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "required": true
        }
      }
    },
    "CustomerClassDTO": {
      "type": "object",
      "properties": {
        "classId": {
          "type": "string"
        }
      }
    },
    "ApplicableDiscountDTO": {
      "type": "object",
      "properties": {
        "plans": {
          "type": "array",
          "items": {
            "type": "PlanDTO"
          }
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "ResourceDTO"
          }
        }
      }
    },
    "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"
        }
      }
    },
    "PromotedPlanDTO": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "period": {
          "type": "Period"
        },
        "promotionPeriod": {
          "type": "Period"
        },
        "limitPerParentSubscription": {
          "type": "integer"
        },
        "setupFee": {
          "type": "PromotionFeeDTO",
          "required": true
        },
        "recurringFee": {
          "type": "PromotionFeeDTO",
          "required": true
        },
        "renewalFee": {
          "type": "PromotionFeeDTO",
          "required": true
        },
        "transferFee": {
          "type": "PromotionFeeDTO",
          "required": true
        }
      }
    },
    "PromotedParentPlanDTO": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "period": {
          "type": "Period"
        },
        "limitPerSubscription": {
          "type": "integer"
        }
      }
    },
    "PromotedResourceDTO": {
      "type": "object",
      "properties": {
        "planId": {
          "type": "string",
          "required": true
        },
        "resourceId": {
          "type": "string",
          "required": true
        },
        "period": {
          "type": "Period"
        },
        "setupFee": {
          "type": "PromotionFeeDTO",
          "required": true
        },
        "recurringFee": {
          "type": "PromotionFeeDTO",
          "required": true
        },
        "overuseFee": {
          "type": "PromotionFeeDTO",
          "required": true
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

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.

cloneProductGroup

POST

/productGroups/clone

Created ProductGroupDTO.

Clones 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.

addResourceRatesToGroup

PUT

/productGroups/{groupId}/resourceRates

Add list of resource rates 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.

getResourceRatesFromGroup

GET

/productGroups/{groupId}/resourceRates

List of ResourceRateDTO

Get list of resource rates 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.

removeResourceRatesFromGroup

DELETE

/productGroups/{groupId}/resourceRates

Remove resource rate from given Product Group.

getDefaultPromoCodeTemplates

GET

/oneTimePromoCodes/templates/default

Default actual promo code templates for all users, or none if they don’t exist

Get default promo code templates for all users <br> please, note, that there can be none, single or multiple such promo code templates

getLatestPromoCodeTemplate

GET

/oneTimePromoCodes/templates/latest

Latest actual promo code template or default template, if none is persisted

Get latest promo code template for current user <br> please, note, that there can be none, single or multiple promo code templates for user

updateLatestPromoCodeTemplate

PUT

/oneTimePromoCodes/templates/latest

Update latest promo code template for current user <br> please, note, that there can be none, single or multiple promo code templates for user

getRandomPromoCodeForTemplate

GET

/oneTimePromoCodes/random

Generate one random sample promo code for specified template

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.

addPromoCodes

POST

/discounts/{discountId}/oneTimePromoCodes

Add one-time promo codes to specified discount <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

generatePromoCodes

POST

/discounts/{discountId}/oneTimePromoCodes/generate

Generate one-time promo codes from template and add them to specified discount <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

importPromoCodes

POST

/discounts/{discountId}/oneTimePromoCodes/import

Parse multipart request containing file with list of one-time promo codes and add them to specified discount <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account <br> text or csv files for importing should contain promo codes, separated by new line, comma and semicolon. Escape character is ‘’. <br> All leading and trailing spaces of promo codes will be truncated, all other symbols will be a part of promo codes.

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.

addResourceRatesToDiscount

PUT

/discounts/{discountId}/resourceRates

Add list of resource rates to a discount.

getPromoCodes

GET

/discounts/{discountId}/oneTimePromoCodes

List of OneTimePromoCodeDTO

Get all one-time promo codes assigned to specified 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

getResourceRatesByDiscountId

GET

/discounts/{discountId}/resourceRates

List of ResourceRateDTO

Get list of resource rates for given discount

removePromoCode

DELETE

/discounts/{discountId}/oneTimePromoCodes

Remove promo code from specified discount <br> check if specified promo code exists and remove it from specified 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

removeResourceRatesFromDiscount

DELETE

/discounts/{discountId}/resourceRates

Remove resource rate from given discount

getApplicableDiscounts

GET

/applicableDiscounts

Get list of active discounts applicable for given account

getEnabledFeatures

GET

/feature/enabledFeatures

getPromotions

GET

/promotions

JpaResultWithTotal<PromotionDTO>

GetPromotionList.

createPromotion

POST

/promotions

PromotionDTO.

CreatePromotion.

getPromotionById

GET

/promotions/{promotionId}

PromotionDTO.

GetPromotion.

updatePromotion

PUT

/promotions

PromotionDTO.

UpdatePromotion.

updatePromotionWithId

PUT

/promotions/{promotionId}

PromotionDTO.

UpdatePromotion.

deletePromotionById

DELETE

/promotions/{promotionId}

DeletePromotion.

addPromoCodesToPromotion

POST

/promotions/{promotionId}/oneTimePromoCodes

Add one-time promo codes to specified promotion <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

generatePromoCodesForPromotion

POST

/promotions/{promotionId}/oneTimePromoCodes/generate

Generate one-time promo codes from template and add them to specified promotion <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

importPromoCodesToPromotion

POST

/promotions/{promotionId}/oneTimePromoCodes/import

Parse multipart request containing file with list of one-time promo codes and add them to specified promotion <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account <br> text or csv files for importing should contain promo codes, separated by new line, comma and semicolon. Escape character is ‘’. <br> All leading and trailing spaces of promo codes will be truncated, all other symbols will be a part of promo codes.

addPlansToPromotion

POST

/promotions/{promotionId}/plans

AddPlansToPromotion.

addParentPlansToPromotion

POST

/promotions/{promotionId}/parentPlans

AddParentPlansToPromotion.

addResourcesToPromotion

POST

/promotions/{promotionId}/resources

AddResourcesToPromotion.

getPromoCodesByPromotionId

GET

/promotions/{promotionId}/oneTimePromoCodes

List of OneTimePromoCodeDTO

Get all one-time promo codes assigned to specified promotion

getPlansByPromotionId

GET

/promotions/{promotionId}/plans

List<PlanDTO>

GetPlansByPromotionId.

getParentPlansByPromotionId

GET

/promotions/{promotionId}/parentPlans

List<PlanDTO>

GetParentPlansByPromotionId.

getResourcesByPromotionId

GET

/promotions/{promotionId}/resources

List<ResourceDTO>

GetResourcesByPromotionId.

updatePlansInPromotion

PUT

/promotions/{promotionId}/plans

UpdatePlansInPromotion.

updateParentPlansInPromotion

PUT

/promotions/{promotionId}/parentPlans

UpdateParentPlansInPromotion.

updateResourcesInPromotion

PUT

/promotions/{promotionId}/resources

UpdateResourcesInPromotion.

removePromoCodeFromPromotion

DELETE

/promotions/{promotionId}/oneTimePromoCodes

Remove promo code from specified promotion <br> check if specified promo code exists and remove it from specified promotion

removePlanFromPromotion

DELETE

/promotions/{promotionId}/plans

RemovePlanFromPromotion.

removeParentPlanFromPromotion

DELETE

/promotions/{promotionId}/parentPlans

RemoveParentPlansFromPromotion.

removeResourceFromPromotion

DELETE

/promotions/{promotionId}/resources

RemoveResourceFromPromotion.

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.

cloneProductGroup

HTTP Request

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

Description

Clones 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

addResourceRatesToGroup

HTTP Request

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

Description

Add list of resource rates to a Product Group.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

resourceRates

Array

List of ResourceRateDTO

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

getResourceRatesFromGroup

HTTP Request

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

Description

Get list of resource rates for given Product Group.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

Product Group Id

Returns

List of ResourceRateDTO

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

removeResourceRatesFromGroup

HTTP Request

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

Description

Remove resource rate from given Product Group.

Parameters

PARAMETER

TYPE

DESCRIPTION

groupId

String

resourceId

String

planId

String

Returns

getDefaultPromoCodeTemplates

HTTP Request

GET /aps/2/resources/{aps-id}/oneTimePromoCodes/templates/default

Description

Get default promo code templates for all users <br> please, note, that there can be none, single or multiple such promo code templates

Returns

Default actual promo code templates for all users, or none if they don’t exist

getLatestPromoCodeTemplate

HTTP Request

GET /aps/2/resources/{aps-id}/oneTimePromoCodes/templates/latest

Description

Get latest promo code template for current user <br> please, note, that there can be none, single or multiple promo code templates for user

Returns

Latest actual promo code template or default template, if none is persisted

updateLatestPromoCodeTemplate

HTTP Request

PUT /aps/2/resources/{aps-id}/oneTimePromoCodes/templates/latest

Description

Update latest promo code template for current user <br> please, note, that there can be none, single or multiple promo code templates for user

Parameters

PARAMETER

TYPE

DESCRIPTION

template

String

Latest actual promo code template to be persisted

Returns

getRandomPromoCodeForTemplate

HTTP Request

GET /aps/2/resources/{aps-id}/oneTimePromoCodes/random

Description

Generate one random sample promo code for specified template

Parameters

PARAMETER

TYPE

DESCRIPTION

template

String

Promo code template

Returns

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

addPromoCodes

HTTP Request

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

Description

Add one-time promo codes to specified discount <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount ID

promoCodesToAdd

Array

List of String values for one-time promo codes

Returns

generatePromoCodes

HTTP Request

POST /aps/2/resources/{aps-id}/discounts/{discountId}/oneTimePromoCodes/generate

Description

Generate one-time promo codes from template and add them to specified discount <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Promotion D

generatePromoCodesRequest

GenerateOneTimePromoCodesRequestDTO

Instance of GenerateOneTimePromoCodesRequestDTO, containing information about promo code template and number of promo codes that have to be generated with that template <br>rules of promo code template notation: <br> X = Uppercase letters (A - Z) <br> H = Hexadecimal digits (0 - 9, A - F) <br> 9 = Digits (0 - 9) <br> * = Uppercase letters or digits <br> = Escape character <br> for example: PROMO_CODE_XXX_***_HH\999

Returns

importPromoCodes

HTTP Request

POST /aps/2/resources/{aps-id}/discounts/{discountId}/oneTimePromoCodes/import

Description

Parse multipart request containing file with list of one-time promo codes and add them to specified discount <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account <br> text or csv files for importing should contain promo codes, separated by new line, comma and semicolon. Escape character is ‘’. <br> All leading and trailing spaces of promo codes will be truncated, all other symbols will be a part of promo codes.

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

addResourceRatesToDiscount

HTTP Request

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

Description

Add list of resource rates to a discount.

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

resourceRates

Array

List of ResourceRateDTO

Returns

getPromoCodes

HTTP Request

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

Description

Get all one-time promo codes assigned to specified discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount ID

Returns

List of OneTimePromoCodeDTO

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

getResourceRatesByDiscountId

HTTP Request

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

Description

Get list of resource rates for given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount Id

Returns

List of ResourceRateDTO

removePromoCode

HTTP Request

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

Description

Remove promo code from specified discount <br> check if specified promo code exists and remove it from specified discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

Discount ID

promoCode

String

Returns

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

removeResourceRatesFromDiscount

HTTP Request

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

Description

Remove resource rate from given discount

Parameters

PARAMETER

TYPE

DESCRIPTION

discountId

String

resourceId

String

planId

String

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

getEnabledFeatures

HTTP Request

GET /aps/2/resources/{aps-id}/feature/enabledFeatures

Description

Returns

getPromotions

HTTP Request

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

Description

GetPromotionList.

Returns

JpaResultWithTotal<PromotionDTO>

createPromotion

HTTP Request

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

Description

CreatePromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotion

PromotionDTO

Returns

PromotionDTO.

getPromotionById

HTTP Request

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

Description

GetPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

PromotionDTO.

updatePromotion

HTTP Request

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

Description

UpdatePromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotion

PromotionDTO

Returns

PromotionDTO.

updatePromotionWithId

HTTP Request

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

Description

UpdatePromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotion

PromotionDTO

Returns

PromotionDTO.

deletePromotionById

HTTP Request

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

Description

DeletePromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

addPromoCodesToPromotion

HTTP Request

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

Description

Add one-time promo codes to specified promotion <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Promotion ID

promoCodesToAdd

Array

List of String values for one-time promo codes

Returns

generatePromoCodesForPromotion

HTTP Request

POST /aps/2/resources/{aps-id}/promotions/{promotionId}/oneTimePromoCodes/generate

Description

Generate one-time promo codes from template and add them to specified promotion <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Promotion D

generatePromoCodesRequest

GenerateOneTimePromoCodesRequestDTO

Instance of GenerateOneTimePromoCodesRequestDTO, containing information about promo code template and number of promo codes that have to be generated with that template <br>rules of promo code template notation: <br> X = Uppercase letters (A - Z) <br> H = Hexadecimal digits (0 - 9, A - F) <br> 9 = Digits (0 - 9) <br> * = Uppercase letters or digits <br> = Escape character <br> for example: PROMO_CODE_XXX_***_HH\999

Returns

importPromoCodesToPromotion

HTTP Request

POST /aps/2/resources/{aps-id}/promotions/{promotionId}/oneTimePromoCodes/import

Description

Parse multipart request containing file with list of one-time promo codes and add them to specified promotion <br> please, note, that some preliminary validation checks can be made, to preserve uniqueness of promo codes for user account <br> text or csv files for importing should contain promo codes, separated by new line, comma and semicolon. Escape character is ‘’. <br> All leading and trailing spaces of promo codes will be truncated, all other symbols will be a part of promo codes.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Promotion ID

Returns

addPlansToPromotion

HTTP Request

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

Description

AddPlansToPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotedPlansToAdd

Array

Returns

addParentPlansToPromotion

HTTP Request

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

Description

AddParentPlansToPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotedParentPlansToAdd

Array

Returns

addResourcesToPromotion

HTTP Request

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

Description

AddResourcesToPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotedResourcesToAdd

Array

Returns

getPromoCodesByPromotionId

HTTP Request

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

Description

Get all one-time promo codes assigned to specified promotion

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Promotion ID

Returns

List of OneTimePromoCodeDTO

getPlansByPromotionId

HTTP Request

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

Description

GetPlansByPromotionId.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

List<PlanDTO>

getParentPlansByPromotionId

HTTP Request

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

Description

GetParentPlansByPromotionId.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

List<PlanDTO>

getResourcesByPromotionId

HTTP Request

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

Description

GetResourcesByPromotionId.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Returns

List<ResourceDTO>

updatePlansInPromotion

HTTP Request

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

Description

UpdatePlansInPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotedPlansToUpdate

Array

Returns

updateParentPlansInPromotion

HTTP Request

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

Description

UpdateParentPlansInPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotedParentPlansToUpdate

Array

Returns

updateResourcesInPromotion

HTTP Request

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

Description

UpdateResourcesInPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

promotedResourcesToUpdate

Array

Returns

removePromoCodeFromPromotion

HTTP Request

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

Description

Remove promo code from specified promotion <br> check if specified promo code exists and remove it from specified promotion

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

Promotion ID

promoCode

String

Returns

removePlanFromPromotion

HTTP Request

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

Description

RemovePlanFromPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

planId

String

Returns

removeParentPlanFromPromotion

HTTP Request

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

Description

RemoveParentPlansFromPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

planId

String

Returns

removeResourceFromPromotion

HTTP Request

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

Description

RemoveResourceFromPromotion.

Parameters

PARAMETER

TYPE

DESCRIPTION

promotionId

String

planId

String

resourceId

String

Returns

Structures

ProductGroupDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

groupId

String

Not Required

owner

String

Not Required

name

String

Required

description

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

ResourceRateDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

resourceId

String

Required

planId

String

Required

period

Period

Not Required

StringResponse

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

value

String

Not Required

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

OneTimePromoCodeDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

promoCode

String

Required

subscriptionId

String

Not Required

AccountDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

accountId

String

Required

CustomerClassDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

classId

String

Not Required

ApplicableDiscountDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

plans

Array of PlanDTO

Not Required

resources

Array of ResourceDTO

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

PromotedPlanDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

period

Period

Not Required

promotionPeriod

Period

Not Required

limitPerParentSubscription

Integer

Not Required

setupFee

PromotionFeeDTO

Required

recurringFee

PromotionFeeDTO

Required

renewalFee

PromotionFeeDTO

Required

transferFee

PromotionFeeDTO

Required

PromotedParentPlanDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

period

Period

Not Required

limitPerSubscription

Integer

Not Required

PromotedResourceDTO

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

planId

String

Required

resourceId

String

Required

period

Period

Not Required

setupFee

PromotionFeeDTO

Required

recurringFee

PromotionFeeDTO

Required

overuseFee

PromotionFeeDTO

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.