Files
Dokploy-ts-sdk/docs/sdks/stripe/README.md
2025-09-26 02:33:10 +00:00

21 KiB
Raw Permalink Blame History

Stripe

(stripe)

Overview

Available Operations

getProducts

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.stripe.getProducts();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { stripeGetProducts } from "dokploy/funcs/stripeGetProducts.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await stripeGetProducts(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("stripeGetProducts failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

createCheckoutSession

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.stripe.createCheckoutSession({
    productId: "<id>",
    serverQuantity: 4592.6,
    isAnnual: false,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { stripeCreateCheckoutSession } from "dokploy/funcs/stripeCreateCheckoutSession.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await stripeCreateCheckoutSession(dokploy, {
    productId: "<id>",
    serverQuantity: 4592.6,
    isAnnual: false,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("stripeCreateCheckoutSession failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.StripeCreateCheckoutSessionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

createCustomerPortalSession

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.stripe.createCustomerPortalSession();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { stripeCreateCustomerPortalSession } from "dokploy/funcs/stripeCreateCustomerPortalSession.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await stripeCreateCustomerPortalSession(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("stripeCreateCustomerPortalSession failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*

canCreateMoreServers

Example Usage

import { Dokploy } from "dokploy";

const dokploy = new Dokploy({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const result = await dokploy.stripe.canCreateMoreServers();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DokployCore } from "dokploy/core.js";
import { stripeCanCreateMoreServers } from "dokploy/funcs/stripeCanCreateMoreServers.js";

// Use `DokployCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dokploy = new DokployCore({
  authorization: process.env["DOKPLOY_AUTHORIZATION"] ?? "",
});

async function run() {
  const res = await stripeCanCreateMoreServers(dokploy);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("stripeCanCreateMoreServers failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ErrorT>

Errors

Error Type Status Code Content Type
errors.DokployDefaultError 4XX, 5XX */*