General setting

To start using our API, please get your API Key from your DaCast account. You will find it in the PREFERENCES section, under API. It will be composed of your account number followed by an underscore and 20 characters (e.g. 76193_31e81a0269bb44d16dd9). You will need to enter it as a query string parameter (...?apikey=76193_31e81a0269bb44d16dd9) when trying any API call of this documentation.

When defining the inputs of an endpoint, we will always specify where to insert your data: either in the query string parameters or in the request body. The input signatures will be written in typescript-like interfaces telling you the type and name of each member. Sometimes a member can have different values, this will be indicated with a | or OR.

Even query string parameters are defined in that way, this mean if you see:

Query string parameters:

{
    type: 'price' | 'salesgroup',
    contentId: string
}

You still have to provide the data in the query string parameters such as: ...?type=price&contentId=12445_f_123234

Finally, the hostname is https://monetization.dacast.com/ip.

API Reference

/prices

GET

List prices on an asset.

Input

Query string parameters:

{
    type: 'price' | 'salesgroup',
    contentId: string
}

Output

{   
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    priceId: number,
    price: {
        description: string
        value: number
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    }
}[]

OR

{
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week'| 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    priceId: number,
    price: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    }
}

DELETE

Delete a price.

Input

Body:

{
    priceId: number
}

POST

Create a price on an asset.

Input

Query string parameters:

{
    contentId: string
}

Body:

{
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    prices: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    }
}

OR

{
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour'| 'day' | 'week'| 'month'
    },
    startDate?: {
        value: string,
        timezone: number
    },
    endDate?: {
        value: string,
        timezone: number
    },
    prices: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    }
}

Output

{
    type: 'subscription',
    priceId: number,
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    price: {
        description: string,
        value: number,
        currency: string
    }
}

OR

{
    type: 'payperview'
    priceId: number,
    duration: {
        value: number,
        unit: 'hour'| 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    price: {
        description: string,
        value: number,
        currency: string
    }
}

PUT

Update a price.

Input

Query string parameters:

{
    contentId: string
}

Body:

{
    type: 'subscription',
    priceId: number,
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    }
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    price: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    }
}

OR

{
    type: 'payperview'
    priceId: number,
    duration: {
        value: number,
        unit: 'hour'| 'day' | 'week' | 'month'
    },
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    price: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    }
}

Output

{
    type: 'subscription',
    priceId: number,
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    price: {
        description: string,
        value: number,
        currency: string
    }
}

OR

{
    type: 'payperview'
    priceId: number,
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    price: {
        description: string,
        value: number,
        currency: string
    }

/prices/presets

GET

List the presets on an asset.

Output

{
    code: string,
    discountPercent: number, 
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription'
    assignedToSalesgroups: number[],
    name: string
}[]

DELETE

Delete a preset.

Input

Body:

{
    broadcasterId: number
    presetId: string
}

POST

Define a template of prices.

Input

Body:

{
    broadcasterId: number,
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    prices:{
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    name: string
}

OR

{
    broadcasterId: number
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    prices:{
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    name: string
}

Output

{
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    prices: {
        description: string,
        value: number,
        currency: string
    },
    name: string,
    presetId: string
}

OR

{
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    prices:{
        description: string,
        value: number,
        currency: string
    },
    name: string,
    presetId: string
}

PUT

Update a preset.

Input

Body:

{
    broadcasterId: number
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week'| 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    prices:{
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    name: string,
    presetId: string
}

OR

{
    broadcasterId: number
    type: 'subscription',
    recurrence: {
        value: number,
        unit: {
            day | week | month
        }
    },
    prices:{
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    name: string,
    presetId: string
}

Output

{
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    prices: {
        description: string,
        value: number,
        currency: string
    },
    name: string,
    presetId: string
}

OR

{
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    prices: {
        description: string,
        value: number,
        currency: string
    },
    name: string,
    presetId: string,
}

/promocodes

GET

List the promocodes on your account.

Input

Query string parameters:

{
    page: number,
    perpage: number
}

Output

{
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    assignedTo: string[],
    promocodeId: number
}[]

DELETE

Input

Body:

{
    promocodeId: number
}

POST

Create a promocode.

Input

Body:

{
    broadcasterId: number
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    assignedTo: string[],
}

Output

{
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    assignedTo: string[],
    promocodeId: number
}

PUT

Update a promocode.

Input

Body:

{
    broadcasterId: number
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    assignedTo: string[],
    promocodeId: number
}

Output

{
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    assignedTo: string[],
    promocodeId: number
}

/promocodes/presets

GET

List the promocode presets.

Output

{ 
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    name: string
}

DELETE

Input

Body:

{
    broadcasterId: number
    presetId: string
}

Output

None  

POST

Define a template of promocode.

Input

Body:

{
    broadcasterId: number
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate:{
    value: string,
    timezone: number
    },
    endDate: {
        value: string,
        timezone: number
        },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    name: string
}

Output

{
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    name: string,
    presetId: string
}

PUT

Update a promocode preset.

Input

Body:

{
    broadcasterId: number
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    name: string,
}

Output

{
    code: string,
    discountPercent: number, 
    maxUsageLimit: number,
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    discountPeriod: 'once' | 'forever',
    applicableTo: 'payperview' | 'subscription',
    assignedToSalesgroups: number[],
    name: string,
    presetId: string
}

/salesgroup

GET

List the salesgroups.

Input

Query string parameters:

{
    page: string,
    perpage: string
}

Output

{
    name: string,
    prices: {
        description: string,
        value: number,
        currency: string
    },
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    groupId: number,
    assignedTo: string[]
}[]

OR

{
    name: string,
    prices: {
        description: string,
        value: number,
        currency: string
    },
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    groupId: number,
    assignedTo: string[]
}[]

DELETE

Delete a salesgroup.

Input

Body:

{
    groupId: number
}

POST

Define a prices that will be applied to a group of content, buying access to a salesgroup provides access to all the contents in the salesgroup.

Input

Body:

{
    broadcasterId: number
    name: string,
    prices: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    assignedTo: string[]
}

OR

{
    broadcasterId: number
    name: string,
    prices: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    type: 'payperview',
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    assignedTo: string[]

}

Output

{
    name: string
    prices: {
        description: string,
        value: number,
        currency: string
    },
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    groupId: number,
    assignedTo: string[] 
}

OR

{
    name: string
    prices: {
        description: string,
        value: number,
        currency: string
    },
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week' | 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    groupId: number,
    assignedTo: string[] 
}

PUT

Update a salesgroup.

Input

Body:

{
    name: string,
    prices: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    groupId: number,
    assignedTo: string[]
}

OR

{
    broadcasterId: number
    name: string,
    prices: {
        description: string,
        value: number,
        currency: 'USD' | 'EUR' | 'NZD' | ... //any supported currency here
    },
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week'| 'month'
    },
    startDate: {
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    groupId: number,
    assignedTo: string[]
}

Output

{
    name: string,
    prices: {
        description: string,
        value: number,
        currency: string
    },
    type: 'subscription',
    recurrence: {
        value: number,
        unit: 'day' | 'week' | 'month'
    },
    groupId: number,
    assignedTo: string[]
}

OR

{
    name: string,
    prices: {
        description: string,
        value: number,
        currency: string
    },
    type: 'payperview'
    duration: {
        value: number,
        unit: 'hour' | 'day' | 'week'| 'month'
    },
    startDate:{
        value: string,
        timezone: number
    },
    endDate: {
        value: string,
        timezone: number
    },
    groupId: number,
    assignedTo: string[]
}

/preview

GET

Get the currently set preview video of a content.

Input

Query string parameters:

{
    contentId: string
}

Output

{
    contentId: number | null
}

DELETE

Remove the preview video from a content.

Input

Query string parameters:

{
    contentId: string
}

POST

Set the preview video of a content.

Input

Query string parameters:

{
    contentId: string
}

Body:

{
    referredVodId: number,
}

/info/enable

POST

Enable the paywall for this content.

Input

Query string parameters:

{
    contentId: string
}

Body:

{
    paywallEnabled: boolean
}

/themes

GET

List the paywall themes on your account.

Output

{
    name: string,
    enableLogo: boolean,
    previewButtonBgColor: string,
    previewButtonTextColor: string,
    formButtonColor: string,
    primaryColor: string,
    logoBackgroundColor: string,
    themeId: number
}[]

DELETE

Delete a paywall theme.

Input

Body:

{
    themeId: number
}

POST

Create a paywall theme.

Input

Body:

{
    name: string,
    enableLogo: boolean,
    previewButtonBgColor: string,
    previewButtonTextColor: string,
    formButtonColor: string,
    primaryColor: string,
    logoBackgroundColor: string
}

Output

{
    name: string,
    enableLogo: boolean,
    previewButtonBgColor: string,
    previewButtonTextColor: string,
    formButtonColor: string,
    primaryColor: string,
    logoBackgroundColor: string,
    themeId: number
}

PUT

Update a paywall theme.

Input

Body:

{
    name: string,
    enableLogo: boolean,
    previewButtonBgColor: string,
    previewButtonTextColor: string,
    formButtonColor: string,
    primaryColor: string,
    logoBackgroundColor: string,
    themeId: number
}

Output

{
    name: string,
    enableLogo: boolean,
    previewButtonBgColor: string,
    previewButtonTextColor: string,
    formButtonColor: string,
    primaryColor: string,
    logoBackgroundColor: string,
}

GET

Get the currently linked paywall theme for a content.

Input

Query string parameters:

{
    contentId: string
}

Output

{
    number | null
}

DELETE

Unlink the currently linked paywall theme from an asset

Input

Query string parameters:

{
    contentId: string
}

POST

Link a paywall theme to an asset.

Input

Query string parameters:

{
    contentId: string
}

Body:

{
    themeId: number
}

/bankstatement

POST

Change the seller name on the credit card statement.

Input

Body:

{
    bankStatement: string
}

GET

Get the currently set seller name on the credit card statement.

Output

{
    bankStatement: string
}

DELETE

Remove the currently set seller name on the credit card statement.


/paymentmethod

GET

Get the allowed payment methods.

Output

{
    allowPaypal: boolean,
    allowStripe: boolean
}

POST

Set the allowed payment methods.

Input

Body:

{
    allowPaypal: boolean,
    allowStripe: boolean
}

/balance

GET

Get your account balance.

Input

Body:

{
    broadcasterId: number
}

Output

{
    balance: number as string | 'calculating'
}

/lines

GET

List the viewer purchases.

Input

Query string parameters:

Body:

{
    page: string,
    perpage: string
    keyword?: string
    noteFilter: string
    actionType: 'payperview' | 'subscription' | 'refund'
    startDate: string
    endDate: string
}

Output

{
    pageCount: number,
    nextPage: number,
    results: {
        type: 'unknown' | 'dacast' | 'inplayer',
        description: string,
        timestamp: number,
        amountInAccountCurrency: string,
        accountCurrency: string,
        deducedFee: string,
        viewerCurrency: string,

        paymentMethod?: string,
        consumerEmail?: string,
        contentId?: string,
        amountInViewerCurrency?: string,
        conversionRateToAccountCurrency?: string,
        contentTitle?: string | null
    }[]
}

/lines/all

GET

List all the viewer purchases.

Input

Query string parameters:

{
    keyword: string
    noteFilter: string
    actionType: 'payperview' | 'subscription' | 'refund'
    startDate: string
    endDate: string
}

Output

{
    type: 'unknown' | 'dacast' | 'inplayer',
    description: string,
    timestamp: number,
    amountInAccountCurrency: string,
    accountCurrency: string,
    deducedFee: string,
    viewerCurrency: string
}[]

/tos

GET

Get currently set custom terms of service.

Output

{
    TOSUrl: string | null
}

POST

Customize your terms of service.

Input

Body:

{
    TOSUrl: string | ''
}