Skip to end of metadata
Go to start of metadata

Payment Rule Service

A payment rule defines the terms by which a network pays one of its managed publishers. A network may have more than one set of payment terms with a publisher. For instance, traffic originating from certain geographic areas may have different revenue sharing agreement terms.

Targeting of advertisers, line items, or campaigns via the Placement Service will override any targeting of those objects via this service's optional profile_id.

On This Page

REST API

Note that publisher_code can be used in place of publisher_id, and payment_rule_code can be used in place of publisher_rule_id for all of the calls below.

Add a new payment rule:
POST https://api.appnexus.com/payment-rule?publisher_id=PUBLISHER_ID
(payment-rule JSON)

Modify an existing payment rule:
PUT https://api.appnexus.com/payment-rule?id=PAYMENT_RULE_ID&publisher_id=PUBLISHER_ID
(payment-rule JSON)

View all of the payment rules for a publisher:
GET https://api.appnexus.com/payment-rule?publisher_id=PUBLISHER_ID

View a specific payment rule for a publisher:
GET https://api.appnexus.com/payment-rule?id=PAYMENT_RULE_ID

View multiple payment rules by ID using a comma-separated list:
GET https://api.appnexus.com/payment-rule?id=1,2,3

Delete a payment rule:
DELETE https://api.appnexus.com/payment-rule?id=PAYMENT_RULE_ID

JSON Fields

Field

Type

Description

Default

Required On

id

int

The ID of this payment rule

 

PUT, in query string

code

string

A optional custom code you can use to reference this payment rule.

Null

 

name

string

A name used to describe this payment rule.

None

POST

state

enum

The state of this payment rule. Possible values: "active" or "inactive".

"active"

 

description

string

An optional description.

 

 

start_date

timestamp

Start date for this rule.

Immediately

 

end_date

timestamp

End date for this rule.

Indefinitely

 

pricing_type

enum

Possible values:

  • "revshare" - The publisher gets paid a percentage of ad revenue.
  • "cpm" - The publisher is paid a flat fee per ad served.
  • "dynamic" - The payment terms are defined by a min and max revshare and a target eCPM

"revshare"

POST

cost_cpm

double

If pricing_type is "cpm", this is the CPM fee the publisher is paid.

 

POST, if pricing_type is "cpm"

revshare

double

If pricing_type is "revshare", this is the percentage paid to the publisher. If pricing type is"dynamic", this is the minimum revshare percentage paid to the publisher, with the maximum defined by max_revshare. The percentage should be expressed as a number between 0 and 1 (inclusive), where 1 is 100%.

 

POST, if pricing_type is "revshare" or "dynamic"

profile_id

int

An optional profile_id is used to determine when to apply a payment rule. A profile is a generic set of rules for targeting inventory, and certain payment rules may only apply to certain slices of inventory. (See the Profile Service for details.)

 

 

priority

int

You can optionally provide a priority which defines the level at which this rule should that be applied relative to other payment rules.

5

 

timezone

string

The timezone used to calculate pricing data. For a list of timezones, see API Timezones.

'EST5EDT'

 

last_modified

timestamp

The time of the last modification to this payment rule.

 

 

filtered_advertisers

array of objects

A list of advertisers that you'd like to apply the action specified by demand_filter_action to. See Filtered Advertisers below.

 

 

filtered_line_items

array of objects

A list of line items that you'd like to apply the action specified by demand_filter_action to. See Filtered Line Items below.

 

 

filtered_campaigns

array of objects

A list of campaigns that you'd like to apply the action specified by demand_filter_action to. See Filtered Campaigns below.

 

 

buyer_type

enum

Which buyer types to apply this payment rule to.
Possible values:

  • "direct": your own, managed inventory
  • "external": 3rd party, managed inventory
  • "both"

"both"

 

max_revshare

double

If pricing_type is "dynamic", this is the maximum revshare percentage paid to the publisher.

 

POST, if pricing_type is "dynamic".

apply_cost_on_default

boolean

Whether or not the publisher is paid even if the auction defaults.

 

 

demand_filter_action

enum

Decide whether to include or exclude the advertisers, line items and/or campaigns listed in the filtered_advertisers, filtered_line_items, or filtered_campaigns arrays.
Possible values:

  • "include"
  • "exclude"
  • "default"

 

 

Filtered Advertisers

Field

Type

Description

id

int

The ID of the advertiser.

name

string

The name of the advertiser.

Filtered Line Items

Field

Type

Description

id

int

The ID of the line item.

name

string

The name of the line item.

Filtered Campaigns

Field

Type

Description

id

int

The ID of the campaign.

name

string

The name of the campaign.

Examples

Create a payment rule
Read a single payment rule
Read all of a publisher's payment rules
Update a payment rule
Delete a payment rule