Sponsored Ads
Documentation
Embed the NiPay Offerwall, connect your postback, and test your integration.
Ask AI about your integration
Copy the prompt and paste it into your preferred assistant. Keep your app secret and real user IDs private.
Getting started
- Sign in to NiPay and open Publisher Panel → Apps/Websites → Offerwall Publisher → Add New App.
- Enter your site domain, app type, currency, rounding and exchange rate. Set your postback URL.
- Open My Apps → Edit → Offerwall Integration for the API key, secret key and new-tab link code.
Website integration
Use your API key and a stable, URL-encoded user ID. The ID may contain up to 128 letters, digits, periods, underscores, at signs or hyphens. Add this link to your website to open the Offerwall in a new tab.
<a href="https://nipay.io/?page=offerwall&app=YOUR_API_KEY&subid=USER_ID" target="_blank" rel="noopener noreferrer">Open NiPay Offerwall</a>
For a mobile app, open the same URL in the system browser. Keep the secret key on your server.
Offerwall catalog API
Fetch the catalog from your backend and display it on your site as cards or a list. Use an approved app and a stable SubID for each user. Open each activity with its launch_url. NiPay verifies completions and sends the existing signed postback.
GET https://nipay.io/?page=offerwall-api&app=APP_KEY&subid=USER_ID&device=desktop&category=all
Use mobile or desktop for the user's device. When permitted, pass the user's IP as viewer_ip for targeting. Use an empty string in the signature when omitting it.
$expires = (string)(time() + 60);
$message = implode('|', ['catalog-v1', $appKey, $subId, $expires, $device, $viewerIp]);
$signature = hash_hmac('sha256', $message, $appSecret);
$headers = ['X-NiPay-Expires: ' . $expires, 'X-NiPay-Signature: ' . $signature];
Send both headers with the request and keep your app secret on your server. Use escaped text when rendering the JSON. Responses are specific to the user and should never be shared between users.
The response contains version and categories. Each category has a label, items, and next_after. The categories are ptc, video, shortlinks, banner, sponsored, tasks, and providers. For more items, request that category with after set to its next_after.
Items include a title, description, status, and launch URL. When applicable, reward is a formatted decimal string in the item's currency. Ads may also include duration_seconds and retry_at (Unix seconds). Show launch buttons for available activities. Hosted providers expose a provider card and launch link. A provider's own inventory opens with that provider.
S2S Postback
NiPay sends an application/x-www-form-urlencoded POST. Verify the HMAC-SHA256 signature over the original request body before the final &signature= parameter. Use the app secret exactly as displayed.
subId,transId- User ID and unique transaction ID. Use the transaction ID to prevent duplicate credits.
offer_name,offer_type- Activity label and category. The test uses
testas its category. reward,reward_name,reward_value,payout- Reward amount, currency, exchange rate and USD payout.
status,debug,signature- Test requests use
status=1anddebug=1. Verify them without updating a user balance.
<?php
$raw = file_get_contents('php://input');
if (!preg_match('/\A(.*)&signature=([a-f0-9]{64})\z/s', $raw, $parts)) {
http_response_code(400);
exit;
}
$secret = getenv('NIPAY_APP_SECRET');
if (!$secret || !hash_equals(hash_hmac('sha256', $parts[1], $secret), $parts[2])) {
http_response_code(403);
exit;
}
parse_str($parts[1], $event);
if (($event['debug'] ?? null) === '1') {
http_response_code(204);
exit; // Confirm the test without crediting a balance.
}
http_response_code(501); // Add your own live event handling here.
Testing and reports
In Test Postback, enter a test SubID and payout. Save an HTTPS callback on your registered domain or a subdomain using port 443 and a public IPv4 address. A successful callback returns a 2xx status.
Open Reports for campaign leads and failed postbacks. Test requests do not create earnings or campaign leads.