2

I am trying to do a full integration of a solution into IBM Marketplace. (The one using AppDirect). There are many metering items available (Users, MBs, ...) but I can use none of them. Let's say, for example, we use "Places". I have checked the option "Allow custom metered usage" but that won't allow me to add this "Places" metering item in my pricing option. How can I achieve this?

Note: IBM has discontinued it's Marketplace. Probably this question is of no use anymore but I decided not to delete it as we never know if they will enable it back. Also... before the discontinuation announce, I manage to get a reply from IBM stating that they don't allow the custom unit types and I was invited to use the generic "Item".

icordoba
  • 1,834
  • 2
  • 33
  • 60

1 Answers1

2

If you are billing a custom usage unit, the request looks like:

{
    "account": {
        "accountIdentifier": "{UUID}"
    },
    "items": [{
        "quantity": 5,
        "customUnit": "Places",
        "price": 2.99,
        "description": "some cool places"
    }]
}

Custom units use a different field name than the predefined "units"- I'm not sure which error you were getting back when attempting to bill usage, but that might explain the error if you were getting back a dump of expected unit values.

And1
  • 113
  • 6
  • Thanks a lot! What would be the URL endpoint to post that JSON? I can't find info on that on IBM Marketplace or linked AppDirect docs. Also, IBM Marketplace does not allow me to use my own customUnit, where can I define that "Places" unit type? I can only use "Users", "MBs", ... in Unit Type input at "Price per unit" panel. – icordoba Mar 03 '17 at 23:29
  • 1
    The endpoint is POST `{base marketplace URL}/api/integration/v1/billing/usage` found via https://docs.appdirect.com/developer/billing/api-full-reference/metered-usage When you define your edition, there is a checkbox that says "Allow custom metered usage" that unlocks the ability to send a payload with a customUnit like what I posted in my answer. If IBM doesn't let you do this and you want to have your desired unit in the accepted "units" field list you'll need to reach out to IBM to ask them to add "Places" as a unit for you. – And1 Mar 04 '17 at 14:58
  • I will definitely need to contact IBM as the missing unit type is not for metered usage but recurring fixed cost (number of "Places" in my case). I also will be posting metered usage for "unique user sessions". thanks for your help. – icordoba Mar 04 '17 at 15:16