Retrieves a list of canceled subscriptions.
limit | integer [ 0 .. 1000 ] Limits the number of collection items to be returned. |
offset | integer >= 0 Specifies the starting point within the collection of items to be returned. |
filter | string Filters the collection items. This field requires
a special format. Use For more information, see Using filter with collections. |
sort | Array of strings Sorts and orders the collection of items. To sort in descending
order, prefix with |
List of cancelled subscriptions retrieved.
Unauthorized access. Invalid credentials used.
Access forbidden.
$service = new Rebilly\Sdk\CoreService($client); $cancellationsPaginator = $service->subscriptionCancellations()->getAllPaginator( filter: 'reason:' . Rebilly\Sdk\Model\SubscriptionCancellation::REASON_CONTRACT_EXPIRED, ); foreach ($cancellationsPaginator as $cancellationPage) { printf("Cancellations page %d/%d\n", $cancellationsPaginator->key() + 1, $cancellationsPaginator->count()); foreach ($cancellationPage as $cancellation) { printf( "Cancellation #%s (%s): %s\n", $cancellation->getId(), $cancellation->getStatus(), $cancellation->getSubscriptionId(), ); } } // OR $cancellations = $service->subscriptionCancellations()->getAll( filter: 'reason:' . Rebilly\Sdk\Model\SubscriptionCancellation::REASON_CONTRACT_EXPIRED, limit: 10, ); foreach ($cancellations as $cancellation) { printf( "Cancellation #%s (%s): %s\n", $cancellation->getId(), $cancellation->getStatus(), $cancellation->getSubscriptionId(), ); }
[- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "subscriptionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "proratedInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "appliedInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "canceledBy": "merchant",
- "reason": "did-not-use",
- "description": "string",
- "prorated": false,
- "status": "draft",
- "canceledTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z",
- "churnTime": "2019-08-24T14:15:22Z",
- "lineItems": [
- {
- "type": "debit",
- "description": "string",
- "unitPriceAmount": 49.95,
- "unitPriceCurrency": "USD",
- "quantity": 1,
- "periodStartTime": "2019-08-24T14:15:22Z",
- "periodEndTime": "2019-08-24T14:15:22Z",
- "createdTime": "2019-08-24T14:15:22Z",
- "updatedTime": "2019-08-24T14:15:22Z"
}
], - "lineItemSubtotal": 49.95,
- "_links": [
- {
- "href": "string",
- "rel": "self"
}
]
}
]