# give/4.16.9/src/API/REST/V3/Routes/Subscriptions/Actions/GetSubscriptionCollectionParams.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 68 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/API/REST/V3/Routes/Subscriptions/Actions/GetSubscriptionCollectionParams.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/API/REST/V3/Routes/Subscriptions/Actions/GetSubscriptionCollectionParams.php
- Modified: 2025-09-10T13:42:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/API/REST/V3/Routes/Subscriptions/Actions/GetSubscriptionCollectionParams.php#L10-L20`.

```php
<?php

namespace Give\API\REST\V3\Routes\Subscriptions\Actions;

use Give\Subscriptions\ValueObjects\SubscriptionStatus;

/**
 * @since 4.8.0
 */
class GetSubscriptionCollectionParams
{
    /**
     * @since 4.8.0
     */
    public function __invoke(): array
    {
        return [
            'sort' => [
                'description' => esc_html__('Sort field for subscription results', 'give'),
                'type' => 'string',
                'default' => 'id',
                'enum' => [
                    'id',
                    'createdAt',
                    'renewsAt',
                    'status',
                    'amount',
                    'feeAmountRecovered',
                    'donorId',
                    'firstName',
                    'lastName',
                ],
            ],
            'direction' => [
                'description' => esc_html__('Sort direction for subscription results', 'give'),
                'type' => 'string',
                'default' => 'DESC',
                'enum' => ['ASC', 'DESC'],
            ],
            'mode' => [
                'description' => esc_html__('Subscription mode (live or test)', 'give'),
                'type' => 'string',
                'default' => 'live',
                'enum' => ['live', 'test'],
            ],
            'status' => [
                'description' => esc_html__('Filter subscriptions by status', 'give'),
                'type' => 'array',
                'items' => [
                    'type' => 'string',
                    'enum' => ['any', ...array_values(SubscriptionStatus::toArray())],
                ],
                'default' => ['any'],
            ],
            'campaignId' => [
                'description' => esc_html__('Filter subscriptions by campaign ID', 'give'),
                'type' => 'integer',
                'default' => 0,
            ],
            'donorId' => [
                'description' => esc_html__('Filter subscriptions by donor ID', 'give'),
                'type' => 'integer',
                'default' => 0,
            ],
        ];
    }
}

```
