Application Packaging Standard

Last updated 18-Mar-2019

Update Fees

Once the service plan fees are assigned to SKUs, the management system can update the fees by sending the updateRates request as explained in the SKU Operations section.

../../../_images/price-step-init.png ../../../_images/price-step-get.png ../../../_images/price-step-update-b.png ../../../_images/price-step-sync.png

Prepare New Fees

The updateRates operation requires the id, price, and msrp properties and it updates the price and msrp in all fees that the SKUs with the specified id are assigned.

Let us focus on the SKU #2 and #5 that you got in the previous step for plan #4 (with non-zero prices) and for plan #5 (with zero prices):

SKU ID Plan ID Price MSRP SKU name
2 4 4.25 null user-management-1month-recurring
2 5 0.0 null user-management-1month-recurring
5 4 1.5 null user-management-resource-PremiumProfile-recurring
5 5 0.0 null user-management-resource-PremiumProfile-recurring

Let us change all fees bound with the SKU #2 and #5 to the values presented in the following table:

SKU ID Price MSRP
2 4.25 4.25
5 1.5 1.5

Now you have all necessary data - SKU dispatcher APS ID, vendor APS ID, and the new fees.

Update Specified Fees

The following request for update sends the new values to all fees assigned to the SKUs whose IDs are specified in the request body:

PUT /aps/2/services/sku-manager/vendor/0ab950d1-abc9-4433-a87d-8ba009bf4bce/rates

[
   {
      "id": 2,
      "price": {
         "value": 4.25,
         "code": "USD"
      },
      "msrp": {
         "value": 4.25,
         "code": "USD"
      }
   },
   {
      "id": 5,
      "price": {
         "value": 1.5,
         "code": "USD"
      },
      "msrp": {
         "value": 1.5,
         "code": "USD"
      }
   }
]

In case of success, the response is:

HTTP/1.1 200 OK

Verify Updates

To verify the result, use the same read operation as in the previous Get Fees step:

GET /aps/2/services/sku-manager/vendor/0ab950d1-abc9-4433-a87d-8ba009bf4bce/rates

In the response, the updated structures must look as follows:

HTTP/1.1 200 OK

[
   {
      "id": 2,
      "feeTypes": [
         "RECURRING"
      ],
      "price": {
         "value": "4.25",
         "code": "USD"
      },
      "msrp": {
         "value": "4.25",
         "code": "USD"
      },
      "name": "user-management-1month-recurring",
      "description": { ... },
      "plans": [
         "4",
         "5"
      ]
   },
   {
      "id": 5,
      "feeTypes": [
         "RECURRING"
      ],
      "price": {
         "value": "1.5",
         "code": "USD"
      },
      "msrp": {
         "value": "1.5",
         "code": "USD"
      },
      "name": "user-management-resource-PremiumProfile-recurring",
      "description": { ... },
      "plans": [
         "4",
         "5"
      ],
      "resources": [
         "1000112",
         "1000107"
      ]
   },

]

Notice the following in the response as compared with the previous Get Fees step:

  • The SKUs are not duplicated since all the fees assigned to a SKU have the same values now.
  • Both plans where a SKU is used are presented in the plans array.
  • The SKU assigned to the resource recurring fee contains the resource IDs from both plans in the resources array.

Conclusion

In this step, you have successfully updated the fees and MSRP in the BSS plans.