# getCloudPlusSubscription

`GET /apis/cra.diagrid.io/v1beta1/billing/subscription/plus`

Get the organization's Cloud Plus subscription: its phase, whether a cancellation is scheduled, the end of the current paid period, the monthly price, and a link to the latest invoice.

## Responses

### 200 — [OK](https://jsonapi.org/format/#fetching-resources-responses-200)

`application/json`

- `apiVersion` (string)
- `kind` (string)
- `metadata` (object)
  - `name` (string)
  - `uid` (string)
  - `resourceVersion` (integer)
  - `createdAt` (string)
  - `updatedAt` (string)
  - `deletedAt` (string)
  - `labels` (object<string, string>)
  - `annotations` (object)
- `spec` (object) — Required. PlanSubscriptionSpec is what the organization asked for.
  - `plan` (string) — Required. Plan is the paid plan subscribed to. The only value is plus. One of: `plus`.
  - `subscribed` (boolean) — Subscribed is whether the organization wants the plan. Subscribing sets it and unsubscribing clears it; an unsubscribe takes effect at the end of the period already paid for.
- `status` (object) — PlanSubscriptionStatus is the server-owned lifecycle state of the subscription.
  - `status` (string) — Status is the current processing status of the resource.
  - `updatedAt` (string) — UpdatedAt is the time of the last status update.
  - `messages` (object[]) — Messages contains any status messages, such as error details.
    - `message` (string)
  - `phase` (string) — Phase is the lifecycle state. pending: the first charge has not been confirmed yet. active: the latest invoice is paid. past_due: a renewal charge failed and is being retried; the plan stays in effect meanwhile. canceled: the subscription has ended. One of: `pending`, `active`, `past_due`, `canceled`.
  - `cancelAtPeriodEnd` (boolean) — CancelAtPeriodEnd reports a cancellation that is scheduled for currentPeriodEnd and has not taken effect yet. The plan stays in effect until then, and subscribing again before then withdraws the cancellation.
  - `currentPeriodEnd` (string) — CurrentPeriodEnd is the end of the billing period already paid for: the renewal date, or the last day of the plan while cancelAtPeriodEnd is set.
  - `activatedAt` (string) — ActivatedAt is when the first invoice of the subscription was paid.
  - `canceledAt` (string) — CanceledAt is when the subscription ended.
  - `amountCents` (integer) — AmountCents is the monthly price of the plan, in the smallest unit of currency.
  - `currency` (string) — Currency is the currency of amountCents.
  - `stripe` (object) — PlanSubscriptionStripe holds the Stripe references of a PlanSubscription.
    - `customerId` (string) — CustomerID is the Stripe customer the subscription bills.
    - `subscriptionId` (string) — SubscriptionID is the Stripe subscription.
    - `latestInvoiceId` (string) — LatestInvoiceID is the subscription's most recent Stripe invoice.
    - `latestInvoiceStatus` (string) — LatestInvoiceStatus is the Stripe status of that invoice, for example paid or open.
    - `hostedInvoiceUrl` (string) — HostedInvoiceURL is the Stripe page where that invoice can be viewed and paid.
  - `lastPaymentError` (string) — LastPaymentError is the reason the most recent charge failed. It is cleared once an invoice is paid.

### 404 — The organization has never subscribed to Cloud Plus.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### default — Unexpected error.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
