Retrieve subscription order cancellations

Retrieves a list of subscription order cancellations.

SecurityAPI Key: SecretApiKey or HTTP: JWT
Request
query Parameters
limit
integer [ 0 .. 1000 ]

Limits the number of collection items to be returned.

offset
integer [ 0 .. 1000 ]

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 multiple allowed values. Use ; for multiple fields.

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 -. Multiple fields can be sorted by separating each with ,.

get
/subscription-cancellations
Request samples
$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(),
    );
}
Responses

200

List of cancelled subscription orders retrieved.

Response Headers
Pagination-Total
integer

Total number of items.

Example: 332
Pagination-Limit
integer

Maximum number of items per page.

Example: 100
Pagination-Offset
integer

Specifies the starting point within the collection of resource results. For example, a request with limit=20 retrieves and displays the first 20 results on a page. A following request with limit=20 and offset=20, retrieves the next page of 20 results.

Example: 2
Response Schema: application/json
Array
id
string <= 50 characters

ID of the cancellation.

subscriptionId
required
string <= 50 characters

ID of the canceled subscription order.

proratedInvoiceId
string or null <= 50 characters

ID of the invoice on which the cancellation proration is calculated.

appliedInvoiceId
string or null <= 50 characters

ID of the invoice on which the cancellation fees or credits are applied.

canceledBy
string
Default: "customer"

Specifies who initiated the cancellation.

Enum: "merchant" "customer" "rebilly"
reason
string
Default: "other"

Reason for the cancellation.

Enum: "did-not-use" "did-not-want" "missing-features" "bugs-or-problems" "do-not-remember" "risk-warning" "contract-expired" "too-expensive" "other" "billing-failure"
description
string <= 255 characters

Description of the cancellation reason in free form.

prorated
boolean
Default: false

Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.

status
string
Default: "confirmed"

Status of the subscription order.

Enum Value Description
draft

Creates a daft cancellation so that the cancellation and charge can be previewed.

confirmed

Confirms a subscription cancellation. Sets the subscription to cancel when the churnTime is reached.

completed

Marks a subscription cancellation as completed. This is a read-only status that is set when the churnTime is reached. The cancellation may not be changed or deleted when the status is completed.

revoked

Revokes a subscription cancellation.

canceledTime
string or null <date-time>

Date and time when a subscription is cancelled. By default, this occurs when status is confirmed, unless draft is specified.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

churnTime
string <date-time>

Date and time when the subscription is deactivated.

churnTimePolicy
required
string or null

Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.

Enum: "null" "now" "at-next-renewal"
Array of objects

Items to be added to the new invoice. Proration item is generated and added automatically.

object

Subtotal of the line items added after the subscription cancellation.

Array of objects (SelfLink)

Related links.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

Response samples
application/json
[ { "id": "ord_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "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", "churnTimePolicy": "null", } ]