Setup Monetization

Not applicable

As part of our proof of concept exercise we are trying to explore monetization offered by Apigee. We have so far done following steps as part of our effort to test this feature out:

- Setup an API proxy with monetization enabled. It looks like

2866-apiproxy.jpg

- The monetization policy is setup as:

2867-monetizelimitcheckpolicyconfig.jpg

- Then we created a product and the transaction record policy for that:

2868-transactionrecordingpolicy.jpg

- Then we created a package and added a rate plan for that:

2870-monetizationpackagerateplan.jpg

- Then we added Limits:

2873-monetizelimit2.jpg

Now After this if I do a quick test to do more than 1000 transactions for the developer then it should show quota voilation. But right now I am stuck because it doesnt seem to work for a single transaction. Its always showing:

<error>

<messages>

<message>Exceeded developer limit configuration -</message>
<message>Is Developer Suspended - false</message>
</messages>

</error>

Is there any additional setup we have to do to do a quick test on monetization policy??

Solved Solved
1 10 519
1 ACCEPTED SOLUTION

10 REPLIES 10

Configuration looks good -

1) you have a Fees only rate plan, so your developer 'Monetize Tester' should have bought this plan from the portal to use this API. have you done this step?

[I guess, this might be the reason for the error you are seeing]

2) In Transaction recording policy - you have set a response header 'status'. Now this policy will expect a response header named 'status' with a value 'success' to record that transaction for monetization. You could add a AssignMessage policy to set the 'status' header in the response

[The significance of this is - your API calls won't get monetized and hence you might observe limits not getting enforced - i.e, after you pass the step 1]

a) For traffic to flow into monetization you have to make sure Transaction Recording policy is giving 'true'.

For your specific example Response header should be set like this:

status:success

This i believe is not happening.

Try to set is exactly like this http://docs.apigee.com/monetization/content/create-transaction-recording-policy#createtranspol

b) After all this is done. Make sure developer accepts rate plan. Otherwise you will be getting that message. See http://docs.apigee.com/monetization/content/subscribe-published-rate-plan-using-api

c) If you use PREPAID developer and you have some Fees setup for the rate plan (anything > 0 ). Make sure the developer has balance in the system.

Would be great if you can capture the trace for at least single API call and upload it here.

HowTo : http://docs.apigee.com/api-services/content/using-trace-tool-0

Here's a Trace from an API call that I am making

monetizationtrace.txt

Also, I do have the developer who has bought the plan and accept terms and conditions for the specific rate plan.

There is some problem with Transaction Recording Policy

Looks like configuration issue.

    <Get value="exception while executing transaction recording policies : response message is not available for ExtractVariable: null" name="mint.tx.error_message"/>
      

I see in debug header look like

 <Header name="Status">Success</Header>

Try to use case sensitive Transaction Recording Policy and txProviderStatus == 'Success'

Right now i see the response

<error>
");"><messages>
");"><message>
Exceeded developer limit configuration - [e9a5313e-70ef-4c63-b5e6-28d27e9d5cf2, 0fe771ae-4d99-4bfd-8288-ca055fab367b]
</message>
<message>Is Developer Suspended - true</message>
</messages>
</error>

look like you hit the org limits

https://enterprise.apigee.com/platform/demo9/limits/e9a5313e-70ef-4c63-b5e6-28d27e9d5cf2

has 100 calls

and

https://enterprise.apigee.com/platform/demo9/limits/0fe771ae-4d99-4bfd-8288-ca055fab367b

Looks like somebody added them.

Going to expire those two limits and then we will try again

Also i added balance to your developer to avoid implicit limit

https://enterprise.apigee.com/platform/demo9/limits/0fe771ae-4d99-4bfd-8288-ca055fab367b

Thanks Akhmich, it works now. We are now trying to explore the different rate plans. I will update if there are any further questions