Skip to main content
GET
/
v1
/
customer
/
{customerId}
/
getSubscription
get subscription
curl --request GET \
  --url https://api.unprice.dev/v1/customer/{customerId}/getSubscription \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "projectId": "<string>",
  "createdAtM": 123,
  "updatedAtM": 123,
  "customerId": "<string>",
  "status": "active",
  "active": true,
  "planSlug": "<string>",
  "currentCycleStartAt": 123,
  "currentCycleEndAt": 123,
  "renewAt": 123,
  "endAt": 123,
  "timezone": "<string>",
  "metadata": {
    "reason": "payment_failed",
    "note": "<string>",
    "dates": {
      "lastChangeAt": 123,
      "cancelAt": 123
    }
  },
  "project": {
    "enabled": true
  },
  "customer": {
    "active": true
  },
  "activePhase": {
    "id": "<string>",
    "projectId": "<string>",
    "subscriptionId": "<string>",
    "planVersionId": "<string>",
    "paymentMethodId": "<string>",
    "billingAnchor": 123,
    "trialEndsAt": 123,
    "startAt": 123,
    "endAt": 123,
    "planVersion": {
      "id": "<string>",
      "projectId": "<string>",
      "createdAtM": 123,
      "updatedAtM": 123,
      "planId": "<string>",
      "description": "<string>",
      "latest": true,
      "title": "<string>",
      "tags": [
        "<string>"
      ],
      "active": true,
      "status": "draft",
      "publishedAt": 123,
      "publishedBy": "<string>",
      "archived": true,
      "archivedAt": 123,
      "archivedBy": "<string>",
      "paymentProvider": "stripe",
      "dueBehaviour": "cancel",
      "currency": "USD",
      "billingConfig": {
        "name": "<string>",
        "billingInterval": "month",
        "billingIntervalCount": 30,
        "billingAnchor": 16,
        "planType": "recurring"
      },
      "whenToBill": "pay_in_advance",
      "gracePeriod": 123,
      "collectionMethod": "charge_automatically",
      "trialUnits": 123,
      "autoRenew": true,
      "metadata": {
        "externalId": "<string>"
      },
      "paymentMethodRequired": true,
      "version": 123
    },
    "createdAtM": 123,
    "updatedAtM": 123,
    "trialUnits": 0,
    "metadata": {
      "note": "<string>",
      "reason": "payment_failed"
    },
    "items": [
      {
        "id": "<string>",
        "projectId": "<string>",
        "createdAtM": 123,
        "updatedAtM": 123,
        "units": 123,
        "featurePlanVersionId": "<string>",
        "subscriptionPhaseId": "<string>",
        "subscriptionId": "<string>"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

customerId
string
required

The customer ID

Example:

"cus_1H7KQFLr7RepUyQBKdnvY"

Response

The result of the get subscription

id
string
required
Maximum string length: 36
projectId
string
required
Maximum string length: 36
createdAtM
number
required
updatedAtM
number
required
customerId
string
required
Maximum string length: 36
status
enum<string>
required
Available options:
active,
trialing,
canceled,
expired,
past_due
active
boolean
required
planSlug
string
required
Minimum string length: 1
currentCycleStartAt
number
required
currentCycleEndAt
number
required
renewAt
number | null
required
endAt
number | null
required
timezone
string
required
Minimum string length: 1
metadata
object
required
project
object
required
customer
object
required
activePhase
object