Program Terms API
Program Term API Reference
Endpoint: https://programs.api.cj.com/query
The Program Terms API is a GraphQL API available to publishers to access all Program Term commission rates for Pending, Active, and Expired Program Terms. This API is useful for publishers who need to access commission rates for their existing or previous advertiser relationships. The Program Terms API includes all available commission rates in a Program Term, including Situations, Item Lists, and Promotional Properties commission rates.
This API does not include contract information for advertisers where the publisher does not have a relationship. Advertiser details like name, program URL, EPC, and others can be found in CJ's Advertiser Lookup API. The Advertiser Lookup API also includes some commission rate information, but does not include Situations or Promotional Properties commission rates, so it is recommended to use the Program Terms API to access commission rate information.
Sample Query and Response
Sample Query
{
publisher {
contracts(
publisherId: "1234",
limit: 1,
filters: { advertiserId: "5678" }
) {
totalCount
count
resultList {
startTime
endTime
status
advertiserId
programTerms {
id
name
specialTerms {
name
body
}
isDefault
actionTerms {
id
actionTracker {
id
name
description
type
}
referralPeriod
referralOccurrences
lockingMethod {
type
durationInDays
}
performanceIncentives {
threshold {
type
value
}
reward {
type
commissionType
value
}
currency
}
commissions {
rank
situation {
id
name
}
itemList {
id
name
}
promotionalProperties {
id
name
}
isViewThrough
rate {
type
value
currency
}
}
}
}
}
}
}
}Sample curl Request
curl 'https://programs.api.cj.com/query' \
-H 'Authorization: Bearer <your-personal-access-token>' \
-H 'Content-Type: application/json' \
-d '{"query":"{ publisher { contracts(publisherId: \"1234\", limit: 1, filters: {advertiserId: \"5678\"}) { totalCount count resultList { startTime endTime status advertiserId programTerms { id name specialTerms { name body } isDefault actionTerms { id actionTracker { id name description type } referralPeriod referralOccurrences lockingMethod { type durationInDays } performanceIncentives { threshold { type value } reward { type commissionType value } currency } commissions { rank situation { id name } itemList { id name } promotionalProperties { id name } isViewThrough rate { type value currency } } } } } } } }","variables":null}'Sample Response
{
"data": {
"publisher": {
"contracts": {
"totalCount": 48,
"count": 1,
"resultList": [
{
"startTime": "2020-04-28T16:08:55Z",
"endTime": null,
"status": "ACTIVE",
"advertiserId": "5678",
"programTerms": {
"id": "266444",
"name": "Program Terms with PID",
"specialTerms": {
"name": null,
"body": null
},
"isDefault": false,
"actionTerms": [
{
"id": "723158",
"actionTracker": {
"id": "347167",
"name": "action tracker name",
"description": null,
"type": "item_sale"
},
"referralPeriod": 45,
"referralOccurrences": null,
"lockingMethod": {
"type": "FIXED_DURATION",
"durationInDays": 60
},
"performanceIncentives": [
{
"threshold": {
"type": "TOTAL_SALES_AMOUNT",
"value": 100000
},
"reward": {
"type": "INCREASE_COMMISSION_TO",
"value": 2
},
"currency": "USD"
}
],
"commissions": [
{
"rank": 0,
"situation": null,
"itemList": null,
"promotionalProperties": [],
"isViewThrough": false,
"rate": {
"type": "PERCENT",
"value": 1,
"currency": null
}
},
{
"rank": 1,
"situation": null,
"itemList": {
"id": "54",
"name": "item list 1"
},
"promotionalProperties": [],
"isViewThrough": false,
"rate": {
"type": "FIXED",
"value": 2,
"currency": "USD"
}
},
{
"rank": 3,
"situation": {
"id": "58094",
"name": "loyaltyearned is greater than or equal to 100"
},
"itemList": {
"id": "54",
"name": "item list 1"
},
"promotionalProperties": [],
"isViewThrough": false,
"rate": {
"type": "FIXED_PER_ORDER",
"value": 4,
"currency": "USD"
}
},
{
"rank": 5,
"situation": null,
"itemList": null,
"promotionalProperties": [
{ "id": "8067264", "name": "PID 1" },
{ "id": "100125586", "name": "PID 2" }
],
"isViewThrough": false,
"rate": {
"type": "PERCENT",
"value": 5,
"currency": null
}
}
]
}
]
}
}
]
}
}
}
}Pagination
The API returns up to 10 records by default. There is a limit of 100 records returned per request. To retrieve more, use the offset and limit arguments across multiple requests.
Example — paging through data 50 records at a time:
- First request:
(offset: 0, limit: 50) - Subsequent request:
(offset: 50, limit: 50) - Continue incrementing
offsetbylimituntil all records are retrieved.
Errors
Authentication / Authorization Errors
- Ensure you are including a valid Personal Access Token in the
Authorizationheader. - Ensure you have included the correct
publisherIdargument and that your token has permission to query on behalf of that company.
Enums
ActionTrackerType
Action Tracker type.
| Value | Description |
|---|---|
item_sale | Item Sale action tracker |
item_lead | Item Lead action tracker |
sim_lead | Simple Lead action tracker |
sim_sale | Simple Sale action tracker |
click | Click action tracker |
imp | Impression action tracker |
CommissionRateType
Commission type.
| Value | Description |
|---|---|
FIXED_PER_ORDER | Fixed per order commission |
FIXED | Fixed per item commission |
PERCENT | Percent commission |
ContractStatus
Status of a contract.
| Value | Description |
|---|---|
PENDING_REVERSION | Pending reversion contract |
PENDING_OFFER | Pending publisher accept contract |
CANCELLED | Cancelled contract |
EXPIRED | Expired contract |
ACTIVE | Active contract |
LockingMethodType
Determines how actions will be locked.
| Value | Description |
|---|---|
FIXED_DURATION | Actions will be locked the specified number of days after event date |
OPEN_ENDED | Actions will be locked by advertisers |
FIXED_DATE | Actions will be locked after the 10th of the month |
IMMEDIATE | Actions will be locked as soon as they are posted or otherwise determined by CJ |
PerformanceIncentiveRewardCommissionType
Type of commission associated to the performance incentive.
| Value | Description |
|---|---|
FIXED | When adjusted commission is expressed as a fixed amount, either increase to or bonus |
PERCENT | When adjusted commission is expressed as a percent |
PerformanceIncentiveRewardType
Type of reward associated to the performance incentive.
| Value | Description |
|---|---|
ONE_TIME_BONUS | One time bonus applied on top of existing commission |
INCREASE_COMMISSION_TO | New value of commission after applying performance incentive |
PerformanceIncentiveThresholdType
Type of threshold associated to the performance incentive.
| Value | Description |
|---|---|
TOTAL_SALES_AMOUNT | Threshold is based on amount of sales in given currency |
TOTAL_COMMISSIONS | Threshold is based on amount of commission in given currency |
NUMBER_OF_ACTIONS | Threshold is based on number of actions |
Scalars
| Name | Description |
|---|---|
BigDecimal | Signed fractional values with arbitrary precision. |
Boolean | Represents true or false. |
ID | Unique identifier, often used to refetch an object or as a cache key. Appears as a String in JSON; accepts string or integer input. |
ISODateTime | ISO 8601 datetime. e.g. 1999-12-31T23:59:59Z |
Int | Non-fractional signed whole numeric values. Range: -(2^31) to 2^31 - 1. |
Long | Non-fractional signed whole numeric values. Range: -(2^63) to 2^63 - 1. |
String | Textual data represented as UTF-8 character sequences. |
Updated 9 days ago
