# Query subscription information

After your subscription is confirmed, you can query the following subscription information:

-   [Query subscription list](#1TqXo): You can query a list of subscriptions that match specific filter conditions through the [**inquireSubscriptionList**](https://docs.antom.com/ac/ams/inquire_sublist.md) API.
-   [Query subscription details](#5IZFS): You can call the [**inquireSubscription**](https://docs.antom.com/ac/ams/inquire_sub.md) API with _subscriptionId_ to get the details information of each subscription.
-   [Query subscription transactions](#pMR5K): You can call the [**inquireSubscriptionPayment**](https://docs.antom.com/ac/ams/inquire_subpayment.md) API with _subscriptionId_ to retrieve a list of payments for a subscription.

## Query subscription list Server-side

You can query a list of subscriptions that match specific filter conditions through the [**inquireSubscriptionList**](https://docs.antom.com/ac/ams/inquire_sublist.md) API. Upon a successful call, the API returns detailed information about each subscription, including its status, billing period, amount, and more. This helps you better manage and access their the subscription data. This API supports pagination.

The following code shows how to call the [**inquireSubscriptionList**](https://docs.antom.com/ac/ams/inquire_sublist.md) API:

```java
public static void inquireSubscriptionList() {
    AlipayInquireSubscriptionListRequest request = new AlipayInquireSubscriptionListRequest();
    request.setStartTimeFrom("2026-03-31T00:32:28+08:00");
    request.setStartTimeTo("2026-03-31T23:32:28+08:00");
    request.setStatuses(Arrays.asList(
            SubscriptionStatus.ACTIVE,
            SubscriptionStatus.CANCELLED,
            SubscriptionStatus.TERMINATED
    ));
    request.setPaymentMethodTypes(Arrays.asList("GCASH", "CARD"));
    request.setCurrencies(Arrays.asList("PHP", "USD", "SGD"));
    request.setPeriodTypes(Arrays.asList(PeriodType.YEAR));
    request.setCurrentPage(1);
    request.setPageSize(10);

    AlipayInquireSubscriptionListResponse response = null;
    try {
        response = CLIENT.execute(request);
    } catch (AlipayApiException e) {
        String errorMsg = e.getMessage();
        // handle error condition
    }
}
```

The following shows the sample code of a request:

> **Note**: The parameters _startTimeFrom_ and _startTimeTo_ are based on the initial subscription start time.

```json
{
    "startTimeFrom": "2026-03-31T00:32:28+08:00",
    "startTimeTo": "2026-03-31T23:32:28+08:00",
    "statuses": ["ACTIVE", "CANCELLED", "TERMINATED"],
    "paymentMethodTypes": ["GCASH", "CARD"],
    "currencies": ["PHP", "USD", "SGD"],
    "periodTypes": ["YEAR"],
  "currentPage": 1,
  "pageSize": 10
}
```

The following shows the sample code of a response:

```json
{
    "paginator": {
        "currentPage": 1,
        "pageSize": 10,
        "totalCount": 1,
        "totalPage": 1
    },
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "success.",
        "resultStatus": "S"
    },
    "subscriptions": [
        {
            "currentPeriodEndTime": "2027-03-31T02:27:09Z",
            "currentPeriodStartTime": "2026-03-31T02:27:10Z",
            "currentPhaseNo": 1,
            "description": "paysuccess",
            "paymentAmount": {
                "currency": "PHP",
                "value": "122"
            },
            "paymentMethod": {
                "paymentMethodType": "GCASH"
            },
            "periodCount": 1,
            "periodType": "YEAR",
            "status": "TERMINATED",
            "subscriptionEndTime": "2026-03-28T02:27:10Z",
            "subscriptionId": "202603261900000000000000E0000123529",
            "subscriptionStartTime": "2026-03-31T02:27:10Z"
        }
    ]
}
```

## Query subscription details Server-side

You can call the [**inquireSubscription**](https://docs.antom.com/ac/ams/inquire_sub.md) API with _subscriptionId_ to get the details information of each subscription, including their status, period, amount, etc. This helps you better manage and access each individual subscription information.

The following code shows how to call the [**inquireSubscription**](https://docs.antom.com/ac/ams/inquire_sub.md) API:

```java
public static void inquireSubscription() {
    AlipayInquireSubscriptionRequest request = new AlipayInquireSubscriptionRequest();
    // replace with your subscriptionId
    request.setSubscriptionId("202604061900000000000000E0000131591");

    AlipayInquireSubscriptionResponse response = null;
    try {
        response = CLIENT.execute(request);
    } catch (AlipayApiException e) {
        String errorMsg = e.getMessage();
        // handle error condition
    }
}
```

The following shows the sample code of a request:

```json
{
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "success.",
        "resultStatus": "S"
    },
    "subscription": {
        "currentPeriodEndTime": "2026-04-20T07:00:28Z",
        "currentPeriodStartTime": "2026-04-13T07:00:29Z",
        "currentPhaseNo": 2,
        "description": "Premium Annual Membership",
        "paymentAmount": {
            "currency": "USD",
            "value": "1"
        },
        "paymentMethod": {
            "paymentMethodType": "GOOGLEPAY"
        },
        "periodCount": 1,
        "periodType": "WEEK",
        "status": "ACTIVE",
        "subscriptionId": "202604061900000000000000E0000131591",
        "subscriptionStartTime": "2026-04-06T07:00:29Z"
    }
}
```

The following shows the sample code of a response:

```json
{
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "success.",
        "resultStatus": "S"
    },
    "subscription": {
        "currentPeriodEndTime": "2026-04-20T07:00:28Z",
        "currentPeriodStartTime": "2026-04-13T07:00:29Z",
        "currentPhaseNo": 2,
        "description": "Premium Annual Membership",
        "paymentAmount": {
            "currency": "USD",
            "value": "1"
        },
        "paymentMethod": {
            "paymentMethodType": "GOOGLEPAY"
        },
        "periodCount": 1,
        "periodType": "WEEK",
        "status": "ACTIVE",
        "subscriptionId": "202604061900000000000000E0000131591",
        "subscriptionStartTime": "2026-04-06T07:00:29Z"
    }
}
```

## Query subscription transactions Server-side

You can call the [**inquireSubscriptionPayment**](https://docs.antom.com/ac/ams/inquire_subpayment.md) API with _subscriptionId_ to retrieve a list of payments for a subscription such as transactions time, phase number, payment method, amount, etc. This API supports pagination.

The following code shows how to call the [**inquireSubscriptionPayment**](https://docs.antom.com/ac/ams/inquire_subpayment.md) API:

```java
public static void inquireSubscriptionPayment() {
    AlipayInquireSubscriptionPaymentRequest request = new AlipayInquireSubscriptionPaymentRequest();
    // replace with your subscriptionId
    request.setSubscriptionId("202604061900000000000000E000013****");
    request.setPaymentStatuses(Arrays.asList(PaymentStatus.SUCCESS));
    request.setCurrentPage(1);
    request.setPageSize(10);

    AlipayInquireSubscriptionPaymentResponse response = null;
    try {
        response = CLIENT.execute(request);
    } catch (AlipayApiException e) {
        String errorMsg = e.getMessage();
        // handle error condition
    }
}
```

The following shows the sample code of a request:

```json
{
    "subscriptionId": "202604061900000000000000E000013****",
 "paymentStatuses": ["SUCCESS"],
}
```

The following shows the sample code of a response:

```json
{
    "paginator": {
        "currentPage": 1,
        "pageSize": 10,
        "totalCount": 6,
        "totalPage": 1
    },
    "payments": [
        {
            "paymentAmount": {
                "currency": "USD",
                "value": "1"
            },
            "paymentId": "202604061940108001001880F0288069590",
            "paymentMethod": {
                "paymentMethodType": "GOOGLEPAY"
            },
            "paymentTime": "2026-04-06T07:16:00Z",
            "phaseNo": 6,
            "status": "SUCCESS"
        },
        {
            "paymentAmount": {
                "currency": "USD",
                "value": "1"
            },
            "paymentId": "202604061940108001001885C0287017432",
            "paymentMethod": {
                "paymentMethodType": "GOOGLEPAY"
            },
            "paymentTime": "2026-04-06T07:13:00Z",
            "phaseNo": 5,
            "status": "SUCCESS"
        },
        {
            "paymentAmount": {
                "currency": "USD",
                "value": "1"
            },
            "paymentId": "202604061940108001001881F0287544932",
            "paymentMethod": {
                "paymentMethodType": "GOOGLEPAY"
            },
            "paymentTime": "2026-04-06T07:10:01Z",
            "phaseNo": 4,
            "status": "SUCCESS"
        },
        {
            "paymentAmount": {
                "currency": "USD",
                "value": "1"
            },
            "paymentId": "202604061940108001001880E0286132632",
            "paymentMethod": {
                "paymentMethodType": "GOOGLEPAY"
            },
            "paymentTime": "2026-04-06T07:07:00Z",
            "phaseNo": 3,
            "status": "SUCCESS"
        },
        {
            "paymentAmount": {
                "currency": "USD",
                "value": "1"
            },
            "paymentId": "202604061940108001001883J0284535142",
            "paymentMethod": {
                "paymentMethodType": "GOOGLEPAY"
            },
            "paymentTime": "2026-04-06T07:04:00Z",
            "phaseNo": 2,
            "status": "SUCCESS"
        },
        {
            "paymentAmount": {
                "currency": "USD",
                "value": "1"
            },
            "paymentId": "202604061940108001001882H0286415444",
            "paymentMethod": {
                "paymentMethodType": "GOOGLEPAY"
            },
            "paymentTime": "2026-04-06T06:57:21Z",
            "phaseNo": 1,
            "status": "SUCCESS"
        }
    ],
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "success.",
        "resultStatus": "S"
    }
}
```