Home
Tutorials
Getting started
Understanding the API
Buy Button
Custom checkout styling
Cleeng Sandbox
Getting started with Cleeng Core
Getting started with PHP SDK
Getting started with JAVA SDK
Getting started with iOS and tvOS
Getting started with Roku
Getting started with Webhooks
Identity & Access Management
Registration and login on mobiles and TV boxes via Middleware
Registration and login on the web
Entitlements using tags (Access control)
Payment processing
Payments on Apple iOS and tvOS
Payments on Android
Payments on Roku
Payments on Amazon Fire
My Account & User profile
My Account widget
Server-side account functions
Custom myaccount styling
Product & Offer management
Tagging products
Full demo app example
Subscription VOD web app - full example
Webstore SDK - flexible purchase process example
API Reference
Introduction to API
Entitlements
JAVASCRIPT
CleengApi.getAccessStatus
SERVER-SIDE
getAccessStatus
getAccessStatusForDevice
getAccessibleTags
registerSubscription
isTrialAllowed
Authorization & payments
JAVASCRIPT
CleengApi.checkout
CleengApi.autologin
CleengApi.logout
SERVER-SIDE
getPrice
getMultiCurrencyPrice
calculateSwitchPrice
extendTokenExpiration
registerCustomer
generateCustomerTokenFromPassword
listPaymentDetails
deletePaymentDetails
getConsentDefinitions
getViewerConsents
submitConsent
updateConsentDefinition
Customer & support
JAVASCRIPT
CleengApi.getCustomer
CleengApi.myAccount
SERVER-SIDE
getCustomer
getCustomerEmail
requestPasswordReset
updateCustomerEmail
updateCustomerPassword
updateCustomerSubscription
listCustomerLibrary
listCustomerSubscriptions
fetchCaptureQuestions
fetchCaptureStatus
saveCaptureQuestions
setCaptureEnabled
fetchBroadcasterSpecificPersonalDataWithCaptureAnswers
updateBroadcasterSpecificPersonalDataWithCaptureAnswers
Reporting
JAVASCRIPT
CleengApi.trackOfferImpression
SERVER-SIDE
listTransactions
listCancellations
listSubscribers
listCustomers
SSO integration
SERVER-SIDE
getLocaleDataFromIp
prepareRemoteAuth
generateCheckoutUrl
generateCustomerToken
updateCustomerEmail
updateCustomerPassword
generateMyAccountUrl
TV, Roku and console
SERVER-SIDE
getAccessStatusForDevice
generateCustomerTokenFromTransactionId
Offer management
SERVER-SIDE
Event Offers
getEventOffer
listEventOffers
createEventOffer
updateEventOffer
cancelEventOffer
Single Offers
getSingleOffer
listSingleOffers
createSingleOffer
updateSingleOffer
deactivateSingleOffer
createMultiCurrencySingleOffer
updateMultiCurrencySingleOffer
Rental Offers
getRentalOffer
listRentalOffers
createRentalOffer
updateRentalOffer
deactivateRentalOffer
createMultiCurrencyRentalOffer
updateMultiCurrencyRentalOffer
Subscriptions
getSubscriptionOffer
listSubscriptionOffers
createSubscriptionOffer
updateSubscriptionOffer
deactivateSubscriptionOffer
createMultiCurrencySubscriptionOffer
updateMultiCurrencySubscriptionOffer
Pass offers
getPassOffer
listPassOffers
createPassOffer
updatePassOffer
deactivatePassOffer
createMultiCurrencyPassOffer
updateMultiCurrencyPassOffer
VOD offers
getVodOffer
listVodOffers
createVodOffer
updateVodOffer
deactivateVodOffer
Webhooks
DOCS
Available webhook events
API METHODS
subscribeToWebhookEvent
unsubscribeFromWebhookEvent
listWebhookSubscriptions
Release Notes
Cleeng Developers
| Developers
  • Products
    • Cleeng Core
      Cleeng Core
      Video subscriber management
    • Merchant
      Merchant
      Payment & checkout optimisation
    • ChurnIQ
      ChurnIQ
      Smart & predictive churn analytics
    • Hi5
      Hi5
      Professional customer care staffing
    • Live Pay-Per-View
      Live Pay-Per-View
      Turnkey live event solution
  • Solutions
  • Developers API
  • Resources
  • Blog

Roku payments

Home
Tutorials
Getting started
Understanding the API
Buy Button
Custom checkout styling
Cleeng Sandbox
Getting started with Cleeng Core
Getting started with PHP SDK
Getting started with JAVA SDK
Getting started with iOS and tvOS
Getting started with Roku
Getting started with Webhooks
Identity & Access Management
Registration and login on mobiles and TV boxes via Middleware
Registration and login on the web
Entitlements using tags (Access control)
Payment processing
Payments on Apple iOS and tvOS
Payments on Android
Payments on Roku
Payments on Amazon Fire
My Account & User profile
My Account widget
Server-side account functions
Custom myaccount styling
Product & Offer management
Tagging products
Full demo app example
Subscription VOD web app - full example
Webstore SDK - flexible purchase process example
API Reference
Introduction to API
Entitlements
JAVASCRIPT
CleengApi.getAccessStatus
SERVER-SIDE
getAccessStatus
getAccessStatusForDevice
getAccessibleTags
registerSubscription
isTrialAllowed
Authorization & payments
JAVASCRIPT
CleengApi.checkout
CleengApi.autologin
CleengApi.logout
SERVER-SIDE
getPrice
getMultiCurrencyPrice
calculateSwitchPrice
extendTokenExpiration
registerCustomer
generateCustomerTokenFromPassword
listPaymentDetails
deletePaymentDetails
getConsentDefinitions
getViewerConsents
submitConsent
updateConsentDefinition
Customer & support
JAVASCRIPT
CleengApi.getCustomer
CleengApi.myAccount
SERVER-SIDE
getCustomer
getCustomerEmail
requestPasswordReset
updateCustomerEmail
updateCustomerPassword
updateCustomerSubscription
listCustomerLibrary
listCustomerSubscriptions
fetchCaptureQuestions
fetchCaptureStatus
saveCaptureQuestions
setCaptureEnabled
fetchBroadcasterSpecificPersonalDataWithCaptureAnswers
updateBroadcasterSpecificPersonalDataWithCaptureAnswers
Reporting
JAVASCRIPT
CleengApi.trackOfferImpression
SERVER-SIDE
listTransactions
listCancellations
listSubscribers
listCustomers
SSO integration
SERVER-SIDE
getLocaleDataFromIp
prepareRemoteAuth
generateCheckoutUrl
generateCustomerToken
updateCustomerEmail
updateCustomerPassword
generateMyAccountUrl
TV, Roku and console
SERVER-SIDE
getAccessStatusForDevice
generateCustomerTokenFromTransactionId
Offer management
SERVER-SIDE
Event Offers
getEventOffer
listEventOffers
createEventOffer
updateEventOffer
cancelEventOffer
Single Offers
getSingleOffer
listSingleOffers
createSingleOffer
updateSingleOffer
deactivateSingleOffer
createMultiCurrencySingleOffer
updateMultiCurrencySingleOffer
Rental Offers
getRentalOffer
listRentalOffers
createRentalOffer
updateRentalOffer
deactivateRentalOffer
createMultiCurrencyRentalOffer
updateMultiCurrencyRentalOffer
Subscriptions
getSubscriptionOffer
listSubscriptionOffers
createSubscriptionOffer
updateSubscriptionOffer
deactivateSubscriptionOffer
createMultiCurrencySubscriptionOffer
updateMultiCurrencySubscriptionOffer
Pass offers
getPassOffer
listPassOffers
createPassOffer
updatePassOffer
deactivatePassOffer
createMultiCurrencyPassOffer
updateMultiCurrencyPassOffer
VOD offers
getVodOffer
listVodOffers
createVodOffer
updateVodOffer
deactivateVodOffer
Webhooks
DOCS
Available webhook events
API METHODS
subscribeToWebhookEvent
unsubscribeFromWebhookEvent
listWebhookSubscriptions
Release Notes

Tutorial: Roku In-App Purchase

Prerequisites

For Roku in-app purchases to be connected to Cleeng's system, the following steps must be completed:

  1. Create a Roku customer account

  2. Enroll as a Roku developer

  3. Register for Roku Partner Payouts Program

  4. Configure in-app products for your Roku channel app

    • Note: Each Roku Product ID should match its Cleeng Offer ID with one minor exception: becasue the _ (underscore) character is not supported, you must use a - (dash) instead:

      Cleeng Offer ID | Roku Product ID
      ----------------|-------------------
      S123123123_US   | S123123123-US
  5. Set your Roku push notification URL to this Cleeng endpoint: https://cleeng.com/roku/push-notification/publisher_id

    push-notification-url
  6. Contact Cleeng to finalize Roku in-app purchase setup.

Purchase Flow

The Roku channel app is responsible for displaying the “buy" button to initiate the payment. Once successful payment is completed through Roku Billing, the Cleeng receipt endpoint must be notified.

Receipt Endpoint

Endpoints:

* Production URL: `https://cleeng.com/roku/payment`
* Sandbox URL: `https://sandbox.cleeng.com/roku/payment`

Request:

  1. Request method: POST
  2. Required headers:

    • Content-Type: application/json
    • X-Publisher-Token: publisher_token
  3. Json payload example:
{
    "customerToken": "4pHxQda1-aoxvYIyaWdo487XsWBsM6UJSmnJVS6Oqr4r3HNg",
    "offerId": "S598742062_US",
    "order": {
    "amount": amount_number,
    "code": "product_code",
    "purchaseId": "purchase_id",
    "qty": qunatity,
    "total": total_amount,
    },
    "ipAddress": "192.168.1.1"
}
  1. Parameters describe

    • customerToken - Cleeng customer token. generateCustomerToken can be used for it.
    • offerId - identifier for Cleeng offer (eg E123123123_US)
    • amount - Price of each purchased item
    • code - Product code, this corresponds to the product identifier that the developer assigns to the specific in-app purchase product
    • purchaseId - Contains the unique transaction ID of the transaction, channels often use this value to entitle users to purchased subscriptions, etc. in their back end systems
    • qty - Quantity of the specific product purchased
    • total - Total purchase amount (including taxes) in the local currency
    • ipAddress - viewer ip address, optional parameter
  2. Example json response:

{
    "message": "OK"
}
  1. Response describe

    • message - processing result
  2. HTTP status codes

    • 400 - Invalid parameters
    • 401 - Invalid authentication // broadcaster and viewer
    • 422 - Unprocessable entity
    • 200 - OK
    • 500 - Internal Server Error

Validate Access

Payment processing is asynchronous and may take up to 1-2 minutes between purchase and validation in Cleeng. Because of this, the app should grant temporary access to the user while the transaction is processed. However, every time after the inital purchase, the middleware will be the source of truth to check the user's access status.

Note: If this is not completed within 1-2 minutes, the app should assume that the payment failed and notify the user.

roku-purchase-flow

End User Registration and In-App Purchase Diagram

roku-registration-and-purchase
Follow us
Products
  • Subscriber management system
  • Checkout optimization tool
  • Churn management system
  • Customer support system
  • Cleeng Live PPV
  • OTT Flow SVOD Extension
About
  • Company
  • Press & Media
  • Blog
  • Partners
  • Jobs
  • Industry events
Developer
  • API Reference
  • Sandbox
  • Tutorials
  • Releases
Broadcasters
  • My Dashboard
  • FAQ & Support
Viewer
  • Who is Cleeng?
  • Get Support
Copyright © 2019 Cleeng | All Rights Reserved | Terms & Conditions | Privacy
We use cookies to ensure that we provide you the best service and website experience. Read our Cookie policy for more details.