Skip to main content
POST
/
api
/
v1
/
subscriptions
/
import
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 response = await client.v1.subscriptions.import({
  subscriptions: [
    {
      id: 'id',
      customerId: 'customerId',
      planId: 'planId',
    },
  ],
});

console.log(response.data);
{
  "data": {
    "taskId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-API-KEY
string
required

API Key

Body

application/json

Bulk import up to 1000 subscriptions. Creates an async import task that processes subscriptions in the background. Existing subscriptions are updated, new ones are created.

subscriptions
object[]
required

List of subscription objects to import

Required array length: 1 - 1000 elements

Response

OK

Response object

data
object
required