NodeRings Docs

Subscribe

POST
/v1/plans/{planId}:subscribe
Authorization<token>

Bearer token

In: header

X-Organization-ID<token>

Tenant or organization identifier

In: header

Path Parameters

planIdstring

Query Parameters

billingPeriod?string

Optional billing period. If not provided, uses the plan's default billing period. If provided, validates that a PlanPrice exists for this billing period. If not available, returns a FailedPrecondition error.

Value in"BILLING_PERIOD_UNSPECIFIED" | "BILLING_PERIOD_HOUR" | "BILLING_PERIOD_DAY" | "BILLING_PERIOD_WEEK" | "BILLING_PERIOD_MONTH" | "BILLING_PERIOD_QUARTER" | "BILLING_PERIOD_YEAR"

Response Body

application/json

curl -X POST "https://api.nrings.io/v1/plans/{planId}:subscribe?billingPeriod" \  -H "Authorization: Bearer {your_token}" \  -H "X-Organization-ID: {your_org_id}"
{
  "subscription": {
    "id": "string",
    "startDate": "2019-08-24T14:15:22Z",
    "trialEndDate": "2019-08-24T14:15:22Z",
    "currentPeriodStart": "2019-08-24T14:15:22Z",
    "currentPeriodEnd": "2019-08-24T14:15:22Z",
    "canceledAt": "2019-08-24T14:15:22Z",
    "subscriptionStatus": "SUBSCRIPTION_STATUS_UNSPECIFIED",
    "cancelAtPeriodEnd": true,
    "quantity": 0,
    "organization": "string",
    "organizationName": "string",
    "activatedByUser": "string",
    "plan": "string",
    "planName": "string",
    "planCode": "string",
    "resourceHostname": "string",
    "resourceProviderName": "string",
    "resourceVmId": "string",
    "resourceRegionName": "string",
    "resourceCpu": 0,
    "resourceMemory": 0,
    "resourceStorage": 0,
    "planBillingPeriod": "BILLING_PERIOD_UNSPECIFIED",
    "platformFeeId": "string",
    "platformFeeType": "string",
    "platformFeePercent": 0.1,
    "platformFeeCurrency": "string",
    "metadata": {},
    "status": "STATUS_UNSPECIFIED",
    "timestamps": {
      "createTime": "2019-08-24T14:15:22Z",
      "updateTime": "2019-08-24T14:15:22Z"
    }
  }
}