listCustomerSubscriptions()

Returns list of all your subscription offers purchased by the customer.

Parameters:

Name Type Description
publisherToken string You can find your publisher token at api-keys page.
customerEmail string Set customer email which you want to get subscription list from.
offset integer Integer, from which subscription you want to get get results.
limit integer Integer, how many results you want to get
- required parameter

Request:

    [
    {
    "method": "listCustomerSubscriptions",
    "params": {
    "publisherToken": "TeurE3xRXcFtF7gSbhYCXx_qC1IrvnDWGejDv114-OE0cdZ9",
    "customerEmail": "customer@email.com",
    "offset": "0",
    "limit": "10"
    },
    "jsonrpc": "2.0",
    "id": 1
    }
    ]

Response:

    [
    {
    "result": {
    "items": [
    {
    "offerId": "S123123123_US",
    "status": "active",
    "expiresAt": 1364146427,
    "paymentMethod": "Card"
    },
    {
    "offerId": "S321321321_US",
    "status": "paused",
    "expiresAt": 1364146123,
    "paymentMethod": "Card"
    },
    ],
    "totalItemCount": 2
    },
    "id": "1",
    "error": null,
    "jsonrpc": "2.0"
    }
    ]
    

Example:

<?php
    $customerEmail = 'customer@email.com';

    $cleengApi = new Cleeng_Api();
    $cleengApi->setPublisherToken('Y72a8Cr0KQciwzU7DbOcSXOFL1gT9a6gIYRb6hhOvCdPaxKW');

    $cleengApi->listCustomerSubscriptions($customerEmail, 0, 10);
    

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

Back to Customer API