Setting a Transaction Success Criteria in Monetization

Not applicable

Hi, I'm trying to test the Monetization quota that was set. We have a package that has been published and developers that are associated to various rate plans. A rate card has been set for these rate plans (i.e. bundle size set to >0 up to 2,000).

I've reached the quota but the Monetization Limits Check policy is not throwing an error when it should... I suspect it's because I don't have the Transaction Success Criteria set properly.

Basically if the request returns a 200 OK, I would like it to count as a transaction. I've tried various combinations but am unable to get this to work. What should I put in the Status and/or Transaction Success Criteria?

I've also read about creating Limits, but it seems like this isn't necessary? The bundles set in the Rate Card should be all that's necessary?

Thanks.

Solved Solved
1 6 1,176
1 ACCEPTED SOLUTION

Hi @Kumiko Yamazaki

Firstly on the response side you need to add a Assign Message policy which should have a segment like this :

<Add>
      <Headers>
        <Header name="status">success</Header>
      </Headers>

So basically you are stating on response that if the backend responds anything set a header called status and set a value called success

So when the Transaction recording policy is executed it will look for a Header called Status and if the value is set to success then the Transaction recording policy will count.

In your Transaction Recording policy for the particular product you should have something like :

          "Transaction Success CriteriatxProviderStatus=='success' " 

added under Attribute type Header

So the Transaction Recording Policy should look something like this :

414-transaction-recording-policy.png

Now that is the basic setup . Beyond that you can add any generic conditions in the AssignMessage Policy . For example you can have a condition like

message.status.code == 200

for executing the AssignMessage policy. And you can apply any condition like this .

This is the simplest flow which I have described but there are many advanced configurations which can be done depending on your needs.

View solution in original post

6 REPLIES 6

Hi @Kumiko Yamazaki

Firstly on the response side you need to add a Assign Message policy which should have a segment like this :

<Add>
      <Headers>
        <Header name="status">success</Header>
      </Headers>

So basically you are stating on response that if the backend responds anything set a header called status and set a value called success

So when the Transaction recording policy is executed it will look for a Header called Status and if the value is set to success then the Transaction recording policy will count.

In your Transaction Recording policy for the particular product you should have something like :

          "Transaction Success CriteriatxProviderStatus=='success' " 

added under Attribute type Header

So the Transaction Recording Policy should look something like this :

414-transaction-recording-policy.png

Now that is the basic setup . Beyond that you can add any generic conditions in the AssignMessage Policy . For example you can have a condition like

message.status.code == 200

for executing the AssignMessage policy. And you can apply any condition like this .

This is the simplest flow which I have described but there are many advanced configurations which can be done depending on your needs.

Thanks for getting back to me, @sarthak. I set the Transaction Attribute similar to what you have above. It doesn't seem to save properly though. If I refresh the page, the "Transaction Success Criteria" is there, but the "Transaction Attribute" is blank every time.

Former Community Member
Not applicable

@Kumiko Yamazaki can you post an image of what exactly you are seeing?

Sure, this is what I am saving:

434-transaction-attribute.png

Looks ok after hitting Save. But once I refresh the page, it looks like this with my Transaction Attribute missing:

435-transaction-attribute-refresh.png

Ok I see what is happening. I didn't have any Resources set, which is why they weren't showing up in the Transaction Recording Policy. This is apparently a requirement and will fail silently through the UI if this is not set properly.

@sarthak if I have 2 headers in the Value column, then how is the Status attribute evalauted. Please suggest .