Docs/Admin API/Subscriptions/Get

Get a subscription

GET/admin/v1/subscriptions/{subscriptionId}

Retrieves specified subscription.

path parameters

  • subscriptionId

    string

    Required

    The identifier of the subscription.

query parameters

  • organizationId

    string

    Restrict by organization identifier.

  • userId

    string

    Restrict by user identifier.

Returns

  • id

    string

    The system-assigned identifier of the subscription.

  • state

    enum

    The status of the subscription.

    Possible values:
    CREATINGTRIALINGCHECKOUT_ISSUEACTIVEPAST_DUEPAUSEDCANCELED
  • stateReason

    string

    The code that best describes the reason for the state.

  • connection

    Connection

    The billing connection.

  • externalId

    string

    The external identifier of the subscription.

  • plan

    Plan

    The plan.

  • currencyCode

    string

    The currency code for the subscription (e.g. USD).

  • items

    SubscriptionItem[]

    The subscription items.

  • seats

    SubscriptionSeatInfo[]

    The seat information.

  • paymentMethod

    PaymentMethod

    The payment method.

  • cancelPeriodEnd

    boolean

    Whether the subscription is scheduled to be canceled at the end of the current billing period.

  • anchorTime

    date-time

    The anchor time for the billing cycle.

  • startTime

    date-time

    The time the subscription started.

  • endTime

    date-time

    The time the subscription ends/ended.

  • trial

    SubscriptionTrial

    The trial information for the subscription.

  • currentPeriod

    SubscriptionCurrentPeriod

    The current billing period for the subscription.

  • organization

    Organization

    The organization owner of the subscription.

    The ID field of this object must be populated if if user isn't specified.

  • user

    User

    The user owner of the subscription.

    The ID field of this object must be populated if if organization isn't specified.

  • default

    boolean

    Whether the subscription is the default for the account.

  • pullTime

    date-time

    The last time the subscription was pulled from the connection.

  • pushTime

    date-time

    The last time the subscription was pushed to the connection.

  • createTime

    date-time

    The creation time of the subscription.

  • updateTime

    date-time

    The last update time of the subscription.

curl https://api.userhub.com/admin/v1/subscriptions/sub_UBUqH64iKRBdCD \
  -H "Authorization: Bearer $USERHUB_ADMIN_KEY"
Response bodyJSON
{
  "id": "sub_UBUqH64iKRBdCD",
  "state": "ACTIVE",
  "connection": {
    "id": "conn_4HdRKnTvPmmjYK",
    "displayName": "Stripe",
    "state": "ACTIVE",
    "type": "STRIPE",
    "delegate": null,
    "providers": [],
    "createTime": "2024-11-15T13:00:00Z",
    "updateTime": "2024-11-15T13:00:00Z"
  },
  "externalId": "sub_1PGhMaI1Zx1mDKAzigGeR4s9",
  "plan": {
    "id": "pg_2wnGzPMSrDBYK5:ukfHizos:monthly:usd",
    "displayName": "Pro",
    "description": "The pro plan.",
    "currencyCode": "USD",
    "billingInterval": {
      "quantity": 1,
      "unit": "MONTH"
    },
    "tags": [
      "default"
    ],
    "items": [
      {
        "product": {
          "id": "pd_2REaagW3GbMEg1",
          "uniqueId": "pro",
          "displayName": "Pro",
          "description": "The pro plan.",
          "committed": true,
          "archived": false,
          "productConnections": [],
          "createTime": "2024-11-15T13:00:00Z",
          "updateTime": "2024-11-15T13:00:00Z"
        },
        "price": {
          "id": "pr_3UU7HrzjM1MmYA",
          "connection": null,
          "externalId": "price_1O2TMUGZpdmtrghCKPNMTH4L",
          "state": "ACTIVE",
          "currencyCode": "USD",
          "billingMode": "FIXED_TERM",
          "interval": {
            "quantity": 1,
            "unit": "MONTH"
          },
          "product": {
            "id": "pd_2REaagW3GbMEg1",
            "uniqueId": "pro",
            "displayName": "Pro",
            "description": "The pro plan.",
            "committed": true,
            "archived": false,
            "productConnections": [],
            "createTime": "2024-11-15T13:00:00Z",
            "updateTime": "2024-11-15T13:00:00Z"
          },
          "archived": false,
          "pullTime": null,
          "pushTime": null,
          "createTime": "2024-11-15T13:00:00Z",
          "updateTime": "2024-11-15T13:00:00Z",
          "fixed": {
            "amount": "10",
            "transformQuantity": null
          }
        },
        "type": "PLAN"
      },
      {
        "product": {
          "id": "pd_3fNK5BXs9C1Fdc",
          "uniqueId": "pro-seat",
          "displayName": "Pro seat",
          "description": "The pro seat.",
          "committed": true,
          "archived": false,
          "productConnections": [],
          "createTime": "2024-11-15T13:00:00Z",
          "updateTime": "2024-11-15T13:00:00Z"
        },
        "price": {
          "id": "pr_HFULbg4GRQEkV6",
          "connection": null,
          "externalId": "price_1O2TVHGZpdmtrghCgwyfbNIx",
          "state": "ACTIVE",
          "currencyCode": "USD",
          "billingMode": "FIXED_TERM",
          "interval": {
            "quantity": 1,
            "unit": "MONTH"
          },
          "product": {
            "id": "pd_3fNK5BXs9C1Fdc",
            "uniqueId": "pro-seat",
            "displayName": "Pro seat",
            "description": "The pro seat.",
            "committed": true,
            "archived": false,
            "productConnections": [],
            "createTime": "2024-11-15T13:00:00Z",
            "updateTime": "2024-11-15T13:00:00Z"
          },
          "archived": false,
          "pullTime": null,
          "pushTime": null,
          "createTime": "2024-11-15T13:00:00Z",
          "updateTime": "2024-11-15T13:00:00Z",
          "fixed": {
            "amount": "5",
            "transformQuantity": null
          }
        },
        "type": "SEAT"
      }
    ]
  },
  "currencyCode": "USD",
  "items": [
    {
      "id": "si_2iLgfJvq",
      "product": {
        "id": "pd_2REaagW3GbMEg1",
        "uniqueId": "pro",
        "displayName": "Pro",
        "description": "The pro plan.",
        "committed": true,
        "archived": false,
        "productConnections": [],
        "createTime": "2024-11-15T13:00:00Z",
        "updateTime": "2024-11-15T13:00:00Z"
      },
      "price": {
        "id": "pr_3UU7HrzjM1MmYA",
        "connection": null,
        "externalId": "price_1O2TMUGZpdmtrghCKPNMTH4L",
        "state": "ACTIVE",
        "currencyCode": "USD",
        "billingMode": "FIXED_TERM",
        "interval": {
          "quantity": 1,
          "unit": "MONTH"
        },
        "product": {
          "id": "pd_2REaagW3GbMEg1",
          "uniqueId": "pro",
          "displayName": "Pro",
          "description": "The pro plan.",
          "committed": true,
          "archived": false,
          "productConnections": [],
          "createTime": "2024-11-15T13:00:00Z",
          "updateTime": "2024-11-15T13:00:00Z"
        },
        "archived": false,
        "pullTime": null,
        "pushTime": null,
        "createTime": "2024-11-15T13:00:00Z",
        "updateTime": "2024-11-15T13:00:00Z",
        "fixed": {
          "amount": "10",
          "transformQuantity": null
        }
      },
      "quantity": 1
    }
  ],
  "seats": [
    {
      "product": {
        "id": "pd_3fNK5BXs9C1Fdc",
        "uniqueId": "pro-seat",
        "displayName": "Pro seat",
        "description": "The pro seat.",
        "committed": true,
        "archived": false,
        "productConnections": [],
        "createTime": "2024-11-15T13:00:00Z",
        "updateTime": "2024-11-15T13:00:00Z"
      },
      "currentPeriodQuantity": 0,
      "assignedQuantity": 0,
      "unassignedQuantity": 0,
      "totalQuantity": 0
    }
  ],
  "paymentMethod": null,
  "anchorTime": "2024-11-15T13:00:00Z",
  "startTime": "2024-11-15T13:00:00Z",
  "endTime": null,
  "trial": null,
  "currentPeriod": {
    "startTime": "2024-11-15T13:00:00Z",
    "endTime": "2024-12-15T13:00:00Z"
  },
  "organization": {
    "id": "org_28seyVGVL1got6",
    "state": "ACTIVE",
    "displayName": "Acme Inc",
    "email": "[email protected]",
    "emailVerified": true,
    "imageUrl": "https://example.com/acme.jpg",
    "address": null,
    "accountConnections": [],
    "subscription": null,
    "signupTime": "2024-11-15T13:00:00Z",
    "memberCount": 0,
    "createTime": "2024-11-15T13:00:00Z",
    "updateTime": "2024-11-15T13:00:00Z"
  },
  "user": null,
  "default": true,
  "pullTime": "2024-11-15T13:00:00Z",
  "pushTime": "2024-11-15T13:00:00Z",
  "createTime": "2024-11-15T13:00:00Z",
  "updateTime": "2024-11-15T13:00:00Z"
}
PreviousList subscriptions
NextUsers

Build software thatmonetizes
$

Subscribe to monthly product updates

© 2025 UserHub

Integrations

    UserHub & Auth0UserHub & Stripe BillingUserHub & Google CloudUserHub & FirebaseUserHub & custom auth