listCancellations()

Please, notice that cancellations are updating once per hour.

Parameters:

Name Type Description
publisherToken string You can find your publisher token at api-keys page.
offset integer From which offer you want to get results. Helpful in pagination.
limit integer Number of results you want to retrieve. E.g. if you want to display 10 offers per page, and you are on third, just set limit to 10 and offset to 20.
criteria object
-   associateEmail string Set an email address of the associate, to get the list of offers created by associate.
-   offerId string Choose, cancellations of which offer you want to list e.g. A_123456789_FR
-   dateFrom string From when you want to get cancellations, leave empty if you want to get all of them. Format: Unix Timestamp
-   dateTo string Until when you want to get cancellations, leave empty if you want to get all of them. Format: Unix Timestamp
- required parameter

Request:

    [
    {
    "method": "listCancellations",
    "params": {
    "publisherToken": "YOUR_PUB_TOKEN",
    "offset": "0",
    "limit": "2",
    "criteria": {
    "dateFrom": "1182950514",
    "dateTo": "1482950514"
    }
    },
    "jsonrpc": "2.0",
    "id": 1
    }
    ]

Response:

    [
    {
    "result": {
    "items": [
    {
    "cancellationId": "455752321",
    "offerId": "R123456789_US",
    "cancellationDate": "1366121174",
    "cancellationReason": "-",
    "cancellationType": "refund",
    "cancelledRevenue": "4.9900",
    "cancellationCurrency": "USD",
    "cancellationFee": "1.0000",
    "reversedTransactionId": "T321321321",
    "offerTitle": "OfferTitle",
    "customerEmail": "somecustomer@email.com",
    "cancelledRevenueDistributor": null,
    "cancellationRevenueCurrencyDistributor": null,
    "cancellationFeeCurrency": null,
    "publisherSiteName": null
    },
    {
    "cancellationId": "632427542",
    "offerId": "R123456789_US",
    "cancellationDate": "1366121174",
    "cancellationReason": "-",
    "cancellationType": "refund",
    "cancelledRevenue": "4.9900",
    "cancellationCurrency": "USD",
    "cancellationFee": "1.0000",
    "reversedTransactionId": "T123123123",
    "offerTitle": "OfferTitle",
    "customerEmail": "customer@email.com",
    "cancelledRevenueDistributor": null,
    "cancellationRevenueCurrencyDistributor": null,
    "cancellationFeeCurrency": null,
    "publisherSiteName": null
    }
    ],
    "totalItemCount": 15
    },
    "id": "1",
    "error": null,
    "jsonrpc": "2.0"
    }
    ]

Example:

<?php
    $cleengApi = new Cleeng_Api();
    $cleengApi->setPublisherToken('PUBLISHER_TOKEN');

    $offerList = $cleengApi->listCancellations(
    array(//criteria
    'associateEmail' => 'associate@email.com',
    'offerId' => 'R123456789_FR'
    ),
    0,//offset
    5 //limit
    );
    

Remember! you can always check it by yourself using API Console - listCancellations()

Back to Reporting