Monetization - Transaction Record Policy

Not applicable

Hi , followed the tutorial about Monetization.

I have created a transaction record policy that u can see as printscreen attached. I have configured

Transaction Success Criteria Status=='Success'

But to be honest i dont' know if it is configured properly. Anyone can suggest me the proper way to configure it?

Thanks

Cosimo

0 8 1,344
8 REPLIES 8

Hi @Cosimo Can you please follow this thread to see if this answers your questions.

Not applicable

Hi sarthak, thank you i have applied the suggestion but still doesn't work. Please see the API Proxy and the trace session log attached to see what is happening if that can help to understand what i wrong.

Thank you in advance

Cosimo

Former Community Member
Not applicable

Please post a screen shot of the recording policy

Hi Cosimo,

Can you send a screen shot of your transaction recording policy - or post the response of

https://api.enteprise.apigee.com/v1/o/{orgname}/apiproducts/{productname}

In your trace check for this -

<Get value="200" name="mint.tx.status"/>

The value needs to be 'success' - so i suspect transaction recording policy or your resource configuration in API Product is not correct

What is your resource configuration in API product , is it ** or /** or /*? based on your proxy i guess, it needs to be /** -- can you paste a sample URL you use to test it?

A few more things to try, just to make extra sure you can get transactions to fire:

  • Reconfigure the transaction recording policy with: Status - Location: Response: Flow Variable Value: response.reason.phrase Transaction Success Criteria: txProviderStatus=='OK'

    657-tx-recording-policy-success.png

  • Consider temporarily modifying the resource on your API product to just ** (no slash). This ensures every call will get caught by the product.
  • Make sure you have the Verify API Key policy attached to the ProxyEndpoint request (like the PreFlow).
  • Make sure you have the Monetization Limits Check policy attached to the ProxyEndpoint request (after the Verify API Key policy).
  • Make sure you have a developer app associated with the product, and that you're using the app's API key in the call.
  • Start a trace session for the API proxy, and make the call. If the call is successful, in the Trace view click the last stage (AX icon) in the picture of the flow, and scroll to find the mint.tx.status variable. If it worked, the value should say "OK". You can also "Download Trace Session" on the Trace page, and in the file look for <ReasonPhrase>OK</ReasonPhrase>.
  • Note that unless the developer/app has a rate plan, you'll probably only be allowed one call. To make multiple calls, create a new package containing the updated product, create a rate plan, and purchase the rate plan in the developer portal for the developer. Also, if your org is configured for prepaid, be sure to top up the balance of the developer (associated with the developer app) using the management API call in this topic: http://apigee.com/docs/monetization/content/manage-prepaid-balances. That'll keep the developer from getting blocked by a zero prepaid balance.

Hi @Floyd, @makunda@apigee.com i have applied your suggestion but i stiil facing issue. Please see attached Monetization - 2.zip with API Proxy flow, trace log and the transaction policy record configured

Thanks

Cosimo

@jonesfloyd

I see that multiple flow variables can be added

  • response.status.code
  • target.ip

How is the status attribute going to be evaulated in this case when there are more than one flow variable? Will AND be applied between them?

that is

response.status.code AND target.ip 

to deduce the status attribute.

Please suggest.

Not applicable

Hi @Cosimo

I took a look at your upload and it looks like you are getting a server-side error. You are getting a 500 Server error response and the error message says "Device 'deviceYYY' not found".

Just to be clear, in your post call you are sending the following body:

{"transactionId":"1234567","deviceType":"ENGINE","eventType":"[\"telemetry_asset\"]","deviceId":"deviceYYY"}

It seems 'deviceYYY' does not exist, and seems to be the reason you are getting a 500 error.