Calculate a video payout
Prices specific videos of a creator at terms of their own, outside any billing window — for deals that differ per video. terms come from a campaign (source: "campaign"; a campaign without creators works as a rate card), are sent inline in the campaign spec's payouts vocabulary (source: "inline"), or are a fixed amount (source: "fixed"). Rule-based terms must price single videos: base payout per video, per-video CPM and per-video bonuses. Every video must sit on one of the creator's own tracked accounts. The payout buys views from the videos' publish day through yesterday, the last complete day; a repeat payout continues the day after the last one. When the creator is assigned to a campaign that would pay the same videos, campaignRelation is required: "instead_of" takes the videos out of every later campaign calculation for the creator, "on_top" is a bonus. Returns the signed context and calculation, default lineItems, notices, and the integrityToken for POST /payouts/videos/initiate; the calculation expires after 24 hours. A request that cannot be priced is a 400 VIDEO_PAYOUT_INVALID whose data.issues name the path and the reason.
Request
- Base URL: https://viral.app/api/v1
- URL: https://viral.app/api/v1/payouts/videos/calculate
- Auth: API key in header x-api-key
Request body
Example request
{
"videos": [
{
"platform": "facebook"
}
],
"terms": {
"campaignId": "orgcamp_RwmraAffhMt9"
}
}Response
OK
Example response
{
"context": {
"videos": [
{
"platform": "facebook"
}
],
"coveringCampaignId": "orgcamp_RwmraAffhMt9",
"termsCampaignId": "orgcamp_RwmraAffhMt9"
},
"calculation": {
"metrics": {
"perVideo": {
"items": [
{
"platform": "facebook"
}
]
},
"perCategory": [
{
"items": [
{
"platform": "facebook"
}
]
}
],
"manuallyExcludedVideos": [
{
"platform": "facebook"
}
],
"conditionMisses": [
{
"items": [
{
"platform": "facebook",
"creative": {
"by": {
"platform": "facebook"
}
}
}
]
}
],
"carriedVideos": [
{
"items": [
{
"platform": "facebook"
}
]
}
],
"mergedCopies": [
{
"items": [
{
"platform": "facebook",
"into": {
"platform": "facebook"
}
}
]
}
]
},
"settlement": {
"separatelyPaidVideos": [
{
"platform": "facebook"
}
],
"placedVideos": [
{
"platform": "facebook"
}
],
"includedVideos": [
{
"platform": "facebook"
}
],
"carriedVideos": [
{
"platform": "facebook"
}
],
"priorCarriedVideos": [
{
"platform": "facebook"
}
],
"timeZone": "UTC"
},
"engine": {
"factTraces": [
{
"requirement": {
"platformFilter": {
"include": [
"facebook"
],
"exclude": [
"facebook"
]
}
},
"billingWindow": {
"timeZone": "UTC"
}
}
],
"engineEvents": [
{
"factTrace": {
"requirement": {
"platformFilter": {
"include": [
"facebook"
],
"exclude": [
"facebook"
]
}
},
"billingWindow": {
"timeZone": "UTC"
}
}
}
],
"accountSnapshot": {
"accounts": [
{
"platform": "facebook",
"platformAccountId": "7123456789012345678"
}
]
}
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.