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

Exception:
Please note that underscore(_) is not supported in Roku, so you have to replace it by dash (-)
Example,

Cleeng Offer IDRoku Product ID
S123123123_USS123123123-US
  1. Set your Roku push notification URL to this Cleeng endpoint: https://cleeng.com/roku/push-notification/publisher_id

Push Notification URL
Please provide an URL to receive account activity notifications (eg, purchases, subscription cancellations, reversals, etc)
https://cleeng.com/checkout/roku/push_notifications_endpoint.php

  1. 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

📘

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

Request

  1. Request method: POST
  2. Required headers:

Content-Type: application/json
X-Publisher-Token: publisher_token

  1. Json payload example
{
    "customerEmail": "[email protected]",
    "offerId": "S598742062_US",
    "order": {
    "amount": amount_number,
    "code": "product_code",
    "purchaseId": "purchase_id",
    "qty": quantity,
    "total": total_amount,
    },
    "ipAddress": "192.168.1.1"
}
  1. Available Parameters

Parameters

Description

customerEmail

Customer email

offerId

an identifier for Cleeng offer (eg E123123123_US)

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

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

qty

Quantity of the specific product purchased

total

Total purchase amount (including taxes) in the local currency

ipAddress

viewer ip address, optional parameter

  1. Example Response,
{
  "message": "OK"
}
  1. Response Description

message - Processing result

  1. Error Codes

Code

Description

400

Invalid Parameters

401

Invalid Authentication (Broadcaster and Viewer)

422

Unprocessable Entity

200

OK

500

Internal Server Error

Validate Access

Payment processing is an asynchronous process. Even that most responses are within 4 seconds, it can take up to 30 seconds.
Our recommendation is that the application polls the Cleeng API using the getAccessStatus() or getAccessibleTags() method until the transaction is completed and access is granted.

The below flowchart shows the process:

Roku user registration flow

Updated 8 days ago


Roku


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.