listCustomerLibrary()


Using that method you can list offers purchased by selected customer.

Parameters:

Name Type Description
publisherToken string You can find your publisher token at api-keys page.
customerEmail string Set customer email for which you want to list library.
offset integer Integer, from which element you want to get results.
limit integer Integer, how many elements you want to get
criteria object No description
-dateFrom stringFrom when (unix time stamp) you want to get the list
-dateTo integerTill when (unix time stamp) you want to get the list

- required parameter


Request:

[
    {
        "method": "listCustomerLibrary",
        "params": {
            "publisherToken": "bwP8yUKHZWAmN4HFNEV0N1vOrzF9SyCKNbiG_QdGGTJLirqO",
            "customerEmail": "tszad+fsfsdf@cleeng.com",
            "offset": "0",
            "limit": "10",
            "criteria": []
        },
        "jsonrpc": "2.0",
        "id": 1
    }
]

Response:

[
    {
        "result": {
            "items": [
                {
                    "transactionId": "T123123123",
                    "transactionDate": 1397830774,
                    "transactionPrice": 9.99,
                    "transactionCurrency": "USD",
                    "transactionExternalData": "",
                    "publisherName": "John's Blog",
                    "publisherSiteUrl": "http:\/\/blog.johns.org",
                    "offerId": "E123123123_US",
                    "offerType": "event",
                    "offerTitle": "Super Event",
                    "offerDescription": "Super Event description",
                    "offerUrl": "http:\/\/superevent.cleeng.com\/super-event\/E123123213_US",
                    "invoicePrice": 9.99,
                    "invoiceCurrency": "USD",
                    "expiresAt": "0",
                    "cancelled": false
                },
                {
                    "transactionId": "T321321321",
                    "transactionDate": 1397828588,
                    "transactionPrice": 0,
                    "transactionCurrency": "USD",
                    "transactionExternalData": "",
                    "publisherName": "John's Blog",
                    "publisherSiteUrl": "http:\/\/blog.johns.org",
                    "offerId": "E321321321_US",
                    "offerType": "event",
                    "offerTitle": "Super Event 2",
                    "offerDescription": "",
                    "offerUrl": "http:\/\/dev-tomek1.cleeng.com\/super-event-2\/E321321321_US",
                    "invoicePrice": 9.99,
                    "invoiceCurrency": "USD",
                    "expiresAt": "0",
                    "cancelled": false
                }
            ],
            "totalItemCount": "2"
        },
        "id": "1",
        "error": null,
        "jsonrpc": "2.0"
    }
]

Example:

<?php
                            
    $api = new Cleeng_Api();
    $api->setPublisherToken('publisher_token');

    $customerEmail = 'customer@email.com';
    $criteria = array(
    'dateTo' => '1398344397',
    'dateFrom' => '1298344397',
    );
    $customerLibrary = $api->listCustomerLibrary($customerEmail,$criteria,0,10);
    
?>

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

Back to Customer API