Skip to main content
POST
/
api
/
v1
/
subscriptions
/
{id}
/
transfer
JavaScript
import Stigg from '@stigg/typescript';

const client = new Stigg({
  apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});

const subscription = await client.v1.subscriptions.transfer('x', {
  destinationResourceId: 'destinationResourceId',
});

console.log(subscription.data);
{
  "data": {
    "id": "<string>",
    "customerId": "<string>",
    "billingId": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "startDate": "2023-11-07T05:31:56Z",
    "planId": "<string>",
    "payingCustomerId": "<string>",
    "resourceId": "<string>",
    "endDate": "2023-11-07T05:31:56Z",
    "effectiveEndDate": "2023-11-07T05:31:56Z",
    "cancellationDate": "2023-11-07T05:31:56Z",
    "trialEndDate": "2023-11-07T05:31:56Z",
    "metadata": {},
    "currentBillingPeriodStart": "2023-11-07T05:31:56Z",
    "currentBillingPeriodEnd": "2023-11-07T05:31:56Z",
    "billingCycleAnchor": "2023-11-07T05:31:56Z",
    "prices": [],
    "addons": [],
    "coupons": [],
    "futureUpdates": [],
    "budget": {
      "limit": 123,
      "hasSoftLimit": true
    },
    "minimumSpend": {
      "amount": 123
    },
    "subscriptionEntitlements": [],
    "latestInvoice": {
      "billingId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "requiresAction": true,
      "total": 123,
      "amountDue": 123,
      "currency": "<string>",
      "pdfUrl": "<string>"
    },
    "trial": {}
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-ACCOUNT-ID
string

Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.

X-ENVIRONMENT-ID
string

Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).

Path Parameters

id
string
required

The unique identifier of the entity

Required string length: 1 - 255

Body

application/json

Transfer a subscription to a different resource within the same customer. The subscription maintains its plan, billing cycle, and entitlements but is moved to the specified destination resource.

destinationResourceId
string
required

Resource ID to transfer the subscription to

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$

Response

The updated subscription object.

Response object

data
Subscription · object
required

Customer subscription to a plan