InPlayer API (2.0.0)

Download OpenAPI specification:Download

INTRODUCTION

InPlayer equips you to run a detailed subscription business model, to build and grow your consumer base, and drive significant revenues. Our paywall supports recurring payments and billing cycles, consumer acquisition, subscriber lifecycle management, and provides you with consumer retention CRM tools.

Once you create an InPlayer Merchant Account, you are entitled to using our InPlayer dashboard for publishing, managing, and selling your premium content. Moreover, you can always integrate with our APIs for a full custom integration.

INPLAYER API

The InPlayer API follows the REST architectural style and uses standard HTTP response codes to indicate success requests (2xx) or API errors (4xx, 5xx). Each of the InPlayer Core Resources (Accounts & Authentication, Asset & Access, Payments & Subscriptions, Vouchers & Promotions, Branding, Restrictions & Rules, Reporting, Analytics, and Features) has their own URL and each of the operations involved (POST, PUT, PATCH, GET, and DELETE) carries a specific meaning like creating, updating, fetching, deleting data, and much more.

All API requests should contain Content-Type:application/x-www-form-urlencoded header. The responses are always returned in JSON object(s), both for the successful requests and the failed attempts (errors).

DOCS TERMINOLOGY

The following section defines the domain language used across our platform. Proceed reading to introduce yourself to the terms employed for each of our Core Resources before you start working on your custom integration.

Reporting

Term Explanation
report type The type of report a Merchant can generate. We support 4 types of reports that you can generate - reports regarding your Audience, Payments, Subscriptions, and Asset Access.

API ENVIRONMENTS

To make the API as explorable as possible, we have two different environments for production related and testing purposes. There is no switch for changing between modes, so just refer to the URL you need.

ERRORS

InPlayer uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with InPlayer's servers.

Not all errors map cleanly onto HTTP response codes, however. For instance, when a request is valid but does not complete successfully (e.g. if asset access is not found), we return a 402 error code.

List of status codes

Status code Explanation
200 OK Everything worked as expected.
201 Created The resource has been created.
202 Accepted The request has been accepted for processing but the processing has not been completed.
204 No Content The server has fulfilled the request but does not need to return an entity-body.
400 Bad Request The request was unacceptable, often due to omission of a required parameter.
401 Unauthorized No valid access token provided.
402 Request Failed The parameters were valid but the request failed.
404 Not Found The requested resource does not exist.
409 Conflict The request conflicts with another request.
429 Too Many Requests Too many requests have been sent to the API in a short amount of time. We recommend using exponential backoff for your requests.
500, 502, 503, 504 Server Errors Something went wrong on InPlayer's end.

V1

All operations related to payments & subscriptions

Get Reports By Period of time

Returns reports by period time.

Authorizations:
bearerAuth
path Parameters
startDate
required
string
Example: datetime

The start date for the report

endDate
required
string
Example: datetime

The end date for the report

groupBy
string
Example: string

Group by accsessFeeId or price

Responses

Request samples

curl https://staging-v2.inplayer.com/reporting \
-H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "numberOfRegisteredusers": 0,
  • "numberOfPayments": 0,
  • "numberOfCreatedSubscriptions": 0,
  • "numberOfCancelledSubscriptions": 0,
  • "topFiveCustomers": [
    ],
  • "topFiveAssets": [
    ]
}

Get Reports By Report Type

Returns reports by report type.

Authorizations:
bearerAuth
path Parameters
report_type
required
string
Example: subscription

The type for the report

query Parameters
merchantID
required
number
Example: merchantID=23434

The ID of the merchant

Responses

Request samples

curl https://staging-v2.inplayer.com/reporting/report/{report_type} \
-H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "message": "Generating report. Please wait."
}

Get Reports By Report Type

Returns reports by report type.

Authorizations:
bearerAuth
path Parameters
report_type
required
string
Example: subscription

The type for the report

query Parameters
merchantID
required
number
Example: merchantID=23434

The ID of the merchant

Responses

Request samples

curl https://staging-v2.inplayer.com/reporting/reports/{report_type} \
-H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "reports": [
    ]
}

Get Subscriptions By Period of time

Returns subscriptions by period time.

Authorizations:
bearerAuth
path Parameters
startDate
required
string
Example: datetime

The start date for the subscriptions

endDate
required
string
Example: datetime

The end date for the subscriptions

interval
string
Example: string

The interval for the subscriptions

groupBy
string
Example: string

Group by accsessFeeId or price

Responses

Request samples

curl https://staging-v2.inplayer.com/reporting/subscriptions/count \
-H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "created": { },
  • "canceled": { }
}

V2

Rename Report

Endpoint for renaming reports.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
file_name
required
string

The report file's name

new_file_name
required
string

The report file's new name

Responses

Request samples

curl -X PUT https://staging-v2.inplayer.com/v2/reporting/rename/{report_type} \
-H "Authorization:Bearer <token>" \
-d file_name="file name" \
-d new_file_name="new file name"

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "File is renamed successfully."
}

Create Merchant Analytics/ Access Codes/ Commercial Setup report

Create report of a specific type.

Request Body schema: application/x-www-form-urlencoded
One of
start_date
required
string <date-time>

Start date for the report range in the format 2019-11-12T11:45:26.371Z (RFC3339)

end_date
string <date-time>

End date for the report range in the format 2019-11-12T11:45:26.371Z (RFC3339), default is current time if not specified

currency
string <date-time>

Currency for the merchant total revenue data, default is USD if not specified

Responses

Request samples

curl -X POST https://staging-v2.inplayer.com/v2/reporting/report/{report_type} \
-H "Authorization:Bearer <token>" \
-d start_date_=2021-02-22 22:22:22 \
-d end_date=2022-02-22 22:22:22 \
-d currency=EUR

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully started generating report"
}

List scheduled/recurrent reports

Lists all scheduled/recurrent reports that are scheduled for execution.

Authorizations:
bearerAuth
query Parameters
report_type
string
Enum: "transactions" "gift-payments" "subscriptions" "audience" "access" "account-logins" "paying-customers" "canceled-subscribers" "registered-only-customers" "merchant-analytics" "donation" "access-codes"

Report type to filter reports by given type.

Responses

Request samples

curl https://staging-v2.inplayer.com/v2/reporting/schedule \
-H "Authorization:Bearer <token>"

Response samples

Content type
application/json
[
  • {
    }
]

Create Scheduled/Recurrent Report

Creates scheduled or recurrent report.

Request Body schema: application/x-www-form-urlencoded
One of
scheduled_at
required
string <date-time>

Date for when the report is scheduled in the format 2019-11-12T11:45:26.371Z (RFC3339)

start_date_resolution
required
string
Enum: "week" "month" "year"

Type of the frequency for included report data.

start_date_resolution_before
required
integer <number>

Positive value for the frequency type for included report data.

report_fields
Array of arrays

Fields to be included in the report.

access_status
string

Additional data for access reports.

access_type
string

Additional data for access reports.

exclude
string

Additional data for transaction report.

action_type
string

Additional data for transaction and subscription reports.

range_by
string

Additional data for subscription report.

export_type
string

Additional data for audience, transaction and subscription reports.

paying_customers
string

Additional data for audience report.

role
string
Default: "consumer"

The role of the user requesting report.

unique
boolean

Additional data for account-logins, transaction and subscription reports.

Responses

Request samples

curl -X POST https://staging-v2.inplayer.com/v2/reporting/schedule/{report_type} \
-H "Authorization:Bearer <token>" \
-d scheduled_at=2022-02-22 22:22:22 \
-d start_date_resolution=month \
-d start_date_resolution_before=1 \
-d scheduled_resolution=week \
-d scheduled_resolution_before=3 \
-d report_fields[]=Customer name \
-d report_fields[]=Created At

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Report is scheduled for execution"
}

Delete scheduled/recurrent reports

Stop scheduled/recurrent reports from execution.

Authorizations:
bearerAuth
path Parameters
report_id
required
integer <number>
Example: 23434

The ID of the report.

Responses

Request samples

curl https://staging-v2.inplayer.com/v2/reporting/schedule/delete/{report_id} \
-H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Scheduled report is deleted successfully"
}